• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/textmodes/

Lines Matching +defs:log +defs:view +defs:file +defs:re

10 ;; This file is part of GNU Emacs.
23 ;; along with GNU Emacs; see the file COPYING. If not, write to the
43 ;; printing and sharing of notes, an Org-mode file can be exported as a
44 ;; structured ASCII file, as HTML, or (todo and agenda items only) as an
45 ;; iCalendar file. It can also serve as a publishing tool for a set of
56 ;; The documentation of Org-mode can be found in the TeXInfo file. The
74 ;; the file noutline.el being loaded.
87 "The version number of the file org.el.")
116 This can also be configured on a per-file basis by adding one of
136 "Non-nil means, align all tables when visiting a file.
138 in table fields. Such tables will look correct only after the first re-align.
139 This can also be configured on a per-file basis by adding one of
146 (defcustom org-insert-mode-line-in-empty-file nil
148 When the function `org-mode' is called interactively in an empty file, this
149 normally means that the file name does not automatically trigger Org-mode.
150 To ensure that the file will always be in Org-mode in the future, a
258 (defvar org-repeat-re "\\<REPEAT(\\([-+ 0-9dwmy]+\\))"
274 Org-mode often shows locations in an org-mode file which might have
309 Org-mode often shows locations in an org-mode file which might have
337 Org-mode often shows locations in an org-mode file which might have
422 You may also set this on a per-file basis by adding one of the following
576 The first part is a file name - when omitted, archiving happens in the same
577 file. %s will be replaced by the current file name (without directory part).
578 Archiving to a different file is useful to keep archived entries from
583 at the end of the file, as top-level entries.
587 If the current file is Projects.org, archive in file
591 Archive in the current file, under the top-level headline
595 Archive in file ~/org/archive.org (absolute path), as top-level trees.
598 Archive in file ./basement (relative path), as level 3 trees
601 You may set this option on a per-file basis by adding to the buffer a
609 "Non-nil means, mark entries as DONE when they are moved to the archive file."
614 "Non-nil means, add a time stamp to entries moved to an archive file.
641 very good at guessing when a re-align will be necessary, but you can always
751 "Non-nil means, automatically re-align table when pressing TAB or RETURN.
882 (defcustom org-link-file-path-type 'adaptive
883 "How the path name in file links should be stored.
886 relative relative to the current directory, i.e. the directory of the file
959 (defcustom org-context-in-file-links t
960 "Non-nil means, file links from `org-store-link' contain context.
961 A search string will be added to the file name with :: as separator and
975 Org-mode file (offering completion for all stored links). When this
1023 (file . find-file-other-window))
1035 `find-file'
1036 `find-file-other-window'
1037 `find-file-other-frame'
1052 (cons (const file)
1054 (const find-file)
1055 (const find-file-other-window)
1056 (const find-file-other-frame)))))
1060 Activating internal links (from one location in a file to another location
1061 in the same file) normally just jumps to the location. When the link is
1070 "Non-nil means, `org-open-file' will open non-existing files.
1122 (defconst org-file-apps-defaults-gnu
1125 "Default file applications on a UNIX or GNU/Linux system.
1126 See `org-file-apps'.")
1128 (defconst org-file-apps-defaults-macosx
1137 "Default file applications on a MacOS X system.
1140 See `org-file-apps'.")
1142 (defconst org-file-apps-defaults-windowsnt
1149 "open" 'file)))
1150 "Default file applications on a Windows NT system.
1152 See `org-file-apps'.")
1154 (defcustom org-file-apps
1163 "External applications for opening `file:path' items in a document.
1164 Org-mode uses system defaults for different file types, but
1165 you can use this variable to set the application for a given file
1168 file identifier are
1171 `remote' Matches a remote file, accessible through tramp or efs.
1177 `emacs' The file will be visited by the current Emacs process.
1178 `default' Use the default application for this file type.
1180 by the path to the file.
1181 sexp A Lisp form which will be evaluated. The file path will
1182 be available in the Lisp variable `file'.
1184 `org-file-apps-defaults-macosx'
1185 `org-file-apps-defaults-windowsnt'
1186 `org-file-apps-defaults-gnu'."
1192 (const :tag "Remote file" remote)
1220 (defcustom org-default-notes-file "~/.notes"
1223 the value of `remember-data-file'.
1228 (const :tag "Default from remember-data-file" nil)
1229 file))
1232 "The headline that should be the default location in the notes file.
1245 specify a destination file for remember items created with this template.
1246 The default file is given by `org-default-notes-file'. An optional third
1247 element can specify the headline in that file that should be offered
1248 first when the user is asked to file the entry. The default headline is
1284 info | %:type %:file %:node
1298 (file :tag "Destination file (optional)")
1302 "Non-nil means, store new notes at the beginning of a file or entry.
1303 When nil, new notes will be filed to the end of a file or entry."
1308 (repeat :tag "By file name regexp"
1357 (defcustom org-log-done nil
1376 `org-log-note-headings'.
1378 Logging can also be configured on a per-file basis by adding one of
1396 (defcustom org-log-note-headings
1471 To turn this on on a per-file basis, insert anywhere in the file:
1613 Such files should use a file variable to set it, for example
1621 If the file does not specify a category, then file's base name
1627 Entries may be added to this list with \\[org-agenda-file-to-front] and removed with
1628 \\[org-remove-file]. You can also use customize to edit the list.
1630 If the value of the variable is not a list but a single file name, then
1631 the list of agenda files is actually stored and maintained in that file, one
1632 agenda file per line."
1635 (repeat :tag "List of files" file)
1636 (file :tag "Store list in a file\n" :value "~/.agenda_files")))
1674 todo-tree Sparse tree of specific TODO keyword in *current* file.
1675 tags-tree Sparse tree with all tags matches in *current* file.
1676 occur-tree Occur sparse tree for *current* file.
1892 dedicated-frame Create one new frame, and re-use it each time.
2076 as given by the CATEGORY keyword or derived from the file name.
2197 This path may be relative to the directory where the Org-mode file lives.
2198 The default is to put them into the same directory as the Org-mode file.
2225 or use the +OPTION lines for a per-file setting."
2474 Org-mode file."
2528 or, if you want to keep the style in a file,
2548 "Non-nil means, make file links to `file.org' point to `file.html'.
2549 When org-mode is exporting an org-mode file to HTML, links to
2553 file, assuming that the linked org-mode file will also be
2555 When nil, the links still point to the plain `.org' file."
2591 to a file."
2606 (defcustom org-combined-agenda-icalendar-file "~/org.ics"
2607 "The file name for the iCalendar file covering all agenda files.
2608 This file is created with the command \\[org-export-icalendar-all-agenda-files].
2609 The file name should be absolute."
2611 :type 'file)
2647 You may also set this on a per-file basis by adding one of the following
2669 (defvar org-emph-re nil
2673 (defun org-set-emph-re (var val)
2699 (setq org-emph-re
2733 :set 'org-set-emph-re
2756 :set 'org-set-emph-re
3137 ("logging" org-log-done t)
3138 ("logdone" org-log-done t)
3139 ("nologging" org-log-done nil)
3140 ("lognotedone" org-log-done done push)
3141 ("lognotestate" org-log-done state push)
3142 ("lognoteclock-out" org-log-done clock-out push))
3152 (let ((re (org-make-options-regexp
3161 (while (re-search-forward re nil t)
3320 (defvar Info-current-file)
3324 (defvar remember-data-file)
3340 ;; Defined somewhere in this file, but used before definition.
3487 Org-mode develops organizational tasks around a NOTES file which
3495 For printing and sharing of notes, an Org-mode file (or a part of it)
3496 can be exported as a structured ASCII or HTML file.
3563 ;; If empty file that did not turn on org-mode automatically, make it to.
3564 (if (and org-insert-mode-line-in-empty-file
3616 (if (featurep 'xemacs) [button3] [mouse-3]) 'org-find-file-at-mouse)
3629 (defconst org-link-types '("https?" "ftp" "mailto" "file" "news" "bbdb" "vm"
3631 (defconst org-link-re-with-space
3639 (defconst org-link-re-with-space2
3647 (defconst org-angle-link-re
3654 (defconst org-plain-link-re
3678 (defconst org-any-link-re
3680 org-angle-link-re "\\)\\|\\("
3681 org-plain-link-re "\\)")
3715 (if (re-search-forward org-emph-re limit t)
3728 (if (re-search-forward org-plain-link-re limit t)
3739 (if (re-search-forward org-angle-link-re limit t)
3762 (if (re-search-forward org-bracket-link-regexp limit t)
3791 (if (re-search-forward org-tsr-regexp-both limit t)
3814 (if (re-search-forward org-target-link-regexp limit t)
3825 "Find all radio targets in this file and update the regular expression."
3849 "Return a list of all targets in this file.
3851 (let ((re (if radio org-radio-target-regexp org-target-regexp))
3855 (while (re-search-forward re nil t)
3876 (if (re-search-forward "[ \t]\\(:[A-Za-z_@0-9:]+:\\)[ \r\n]" limit t)
3922 (list org-repeat-re '(0 'org-special-keyword t))
3984 deactivate-mark buffer-file-name buffer-file-truename)
4182 (if (re-search-forward (concat "^" outline-regexp) nil t)
4229 (when (re-search-forward (concat "^\\(" outline-regexp "\\)") nil t)
4615 (if (and (re-search-forward (concat "^" outline-regexp) nil t)
4635 (unless (save-excursion (re-search-forward prohibit end t))
4636 (while (re-search-forward "^[ \t]+" end t)
4644 "Convert an org-mode file with all levels allowed to one with odd levels.
4652 (while (re-search-forward "^\\*\\*+" nil t)
4660 "Convert an org-mode file with only odd levels to one with odd and even levels.
4661 This promotes level 3 to level 2, level 5 to level 3 etc. If the file contains a
4662 section with an even level, conversion would destroy the structure of the file. An error
4667 (when (re-search-forward "^\\(\\*\\*\\)+[^*]" nil t)
4669 (error "Not all levels are odd in this file. Conversion not possible."))
4674 (while (re-search-forward "^\\*\\*+" nil t)
4792 (^re (concat "^\\(" outline-regexp "\\)"))
4793 (re (concat "\\(" outline-regexp "\\)"))
4796 (old-level (if (string-match ^re txt)
4808 (if (looking-at re)
4816 (if (looking-at re)
4875 (re (concat "^" outline-regexp))
4880 (while (setq start (string-match re kill (1+ start)))
4919 start beg end entries stars re re2 p nentries (nremoved 0)
4939 ;; we will sort the top-level entries in this file
4949 re (concat "^" (regexp-quote stars) " +")
4963 (org-split-string txt re)))
5137 (re "\\(\\[[0-9]*%\\]\\)\\|\\(\\[[0-9]*/[0-9]*\\]\\)")
5138 (re-box "^[ \t]*\\([-+*]\\|[0-9]+[.)]\\) +\\(\\[[ X]\\]\\)")
5145 (while (re-search-forward re end t)
5157 (while (re-search-forward re-box lim t)
5168 (if all "in entire file" "in current outline entry") cstat)))))
5463 The archive can be a certain top-level heading in the current file, or in
5464 a different file. The tree will be moved to that location, the subtree
5486 (re "^#\\+ARCHIVE:[ \t]+\\(\\S-.*\\S-\\)[ \t]*$")
5487 file heading buffer level newfile-p)
5491 (if (or (re-search-backward re nil t) (re-search-forward re nil t))
5496 (setq file (format (match-string 1 org-archive-location)
5497 (file-name-nondirectory buffer-file-name))
5500 (if (> (length file) 0)
5501 (setq newfile-p (not (file-exists-p file))
5502 buffer (find-file-noselect file))
5505 (error "Cannot access file \"%s\"" file))
5519 (let ((org-insert-mode-line-in-empty-file t))
5523 (insert (format "\nArchived entries from file %s\n\n"
5524 (buffer-file-name this-buffer))))
5539 (if (re-search-forward
5555 ;; No specific heading, just go to end of file.
5561 (let (org-log-done)
5578 (concat "in file: " (abbreviate-file-name file)))))))
5585 (let ((re (concat "^\\*+ +" org-not-done-regexp)) re1
5606 (while (re-search-forward re1 endm t)
5610 (if (re-search-forward re end t)
5647 (let* ((re (concat ":" org-archive-tag ":")))
5649 (while (re-search-forward re end t)
5660 (if (re-search-forward "[ \t]:\\([a-zA-Z0-9_@:]+\\):[ \t]*$"
5835 re)
5847 (and (re-search-forward "^[^\n\t]+$" end t) (setq tabsep nil)))
5850 (setq re "^\\|\t")
5851 (setq re (format "^ *\\| *\t *\\| \\{%d,\\}"
5854 (while (re-search-forward re end t)
5860 (defun org-table-import (file arg)
5862 The file is assumed to be tab-separated. Such files can be produced by most
5869 (insert-file-contents file)
5873 "Export table as a tab-separated file.
5874 Such a file can be imported into a spreadsheet program like Excel."
5879 (file (read-file-name "Export table to: "))
5881 (unless (or (not (file-exists-p file))
5882 (y-or-n-p (format "Overwrite file %s? " file)))
5884 (with-current-buffer (find-file-noselect file)
5890 (while (re-search-forward "^[ \t]*|[ \t]*" nil t)
5894 (while (re-search-forward "[ \t]*|[ \t]*$" nil t)
5898 (while (re-search-forward "^-[-+]*$" nil t)
5903 (while (re-search-forward "[ \t]*|[ \t]*" nil t)
5915 "List of flags for flushright alignment, from the last re-alignment.
5956 (setq links (re-search-forward org-bracket-link-regexp end t))
5959 (re-search-forward org-ts-regexp-both end t)))
5968 (re-search-forward "<[0-9]+>" end t)))
6114 (if (not (re-search-backward
6127 (if (not (re-search-forward
6146 ;; This is not the same table, force a full re-align
6176 Before doing so, re-align the table if necessary."
6188 (re-search-forward "|" end)
6190 (re-search-forward "|" end))
6193 (re-search-forward "^[ \t]*|\\([^-]\\)" end t))
6205 Before doing so, re-align the table if necessary."
6214 (re-search-backward "|" (org-table-begin))
6215 (re-search-backward "|" (org-table-begin))
6217 (re-search-backward "|" (org-table-begin)))
6223 Before doing so, re-align the table if necessary."
6269 (re-search-backward org-table-dataline-regexp
6444 (if (re-search-forward "|" (org-table-end t) t)
6633 (re-search-forward "| ?" (point-at-eol) t)
6730 (if (re-search-backward org-table-hline-regexp tbeg t)
6735 (if (re-search-forward org-table-hline-regexp tend t)
6847 (while (re-search-forward "^\\([ \t]*\\)\\+-.*\n" end t)
6856 (while (re-search-forward "^\\([ \t]*\\)|-.*\n" end t)
6868 (while (re-search-forward "^\\([ \t]*\\)|-" end t)
6871 (while (re-search-forward "-|[ \t]*$" end t)
6984 (while (re-search-forward "^#.*\n?" nil t) (replace-match ""))
6985 (while (re-search-forward "\\([ \t]*\n[ \t]*\\)+" nil t)
7074 (while (re-search-forward org-table-any-line-regexp nil t)
7079 (re-search-forward org-table-any-border-regexp nil 1))))
7109 (unless (re-search-forward "^[ \t]*|[^-]" nil t)
7114 (unless (re-search-backward "^[ \t]*|[^-]" nil t)
7272 (let ((re (concat key "\\([0-9]+\\)"))
7280 (while (re-search-forward re2 (point-at-eol) t)
7282 (while (re-search-forward re (point-at-eol) t)
7302 (when (re-search-forward "^[ \t]*| *! *\\(|.*\\)" end t)
7313 (while (re-search-forward "^[ \t]*| *\\$ *\\(|.*\\)" end t)
7320 (while (re-search-forward "^[ \t]*| *\\([_^]\\) *\\(|.*\\)" end t)
7402 (not (re-search-forward "^[ \t]*|[^-|][^|]*[^#!$*_^| \t][^|]*|" end t))))
7476 This function makes use of Dave Gillespie's Calc package, in my view the
7806 (line-re org-table-dataline-regexp)
7826 (if (re-search-forward org-table-calculate-mark-regexp end t)
7828 (setq line-re org-table-recalculate-regexp)
7830 (if (and (re-search-forward org-table-dataline-regexp end t)
7831 (re-search-forward org-table-hline-regexp end t)
7832 (re-search-forward org-table-dataline-regexp end t))
7839 (while (re-search-forward line-re end t)
7994 (while (re-search-forward
8027 "Pretty-print and re-indent Lisp expressions in the Formula Editor."
8052 (while (re-search-forward "[ \t]*\n[ \t]*" nil t)
8057 (while (re-search-forward "^." nil t)
8141 (if (re-search-forward (concat "^[ \t]*| *! *.*?| *\\(" var "\\) *|")
8155 (if (re-search-forward (concat "^[ \t]*| *\\$ *.*?| *\\(" var "=\\)") nil t)
8187 (let* ((re org-table-dataline-regexp)
8188 (p1 (save-excursion (re-search-forward re nil 'move)))
8189 (p2 (save-excursion (re-search-backward re nil 'move))))
8305 (while (re-search-forward "[+|]-+" eol t)
8732 (unless (re-search-forward
8738 (unless (re-search-forward (concat "END RECEIVE ORGTBL +" name) nil t)
8767 (re (if commented re1 re2))
8771 (while (looking-at re) (beginning-of-line 0))
8774 (while (looking-at re) (beginning-of-line 2))
9032 For file links, arg negates `org-context-in-file-links'."
9047 (file-name-nondirectory Info-current-file)
9049 (setq cpltxt (concat (file-name-nondirectory Info-current-file)
9051 (org-store-link-props :type "info" :file Info-current-file
9071 (folder buffer-file-name)
9079 (setq folder (abbreviate-file-name folder))
9123 (let ((folder buffer-file-name)
9172 (setq cpltxt (url-view-url t)
9174 (org-store-link-props :type "w3" :url (url-view-url t)))
9179 (org-store-link-props :type "w3m" :url (url-view-url t)))
9182 'org-create-file-search-functions))
9183 (setq link (concat "file:" (abbreviate-file-name buffer-file-name)
9188 (setq cpltxt (concat "file:"
9189 (abbreviate-file-name buffer-file-name))
9191 (org-store-link-props :type "image" :file buffer-file-name))
9194 ;; link to the file in the current line
9195 (setq cpltxt (concat "file:"
9196 (abbreviate-file-name
9197 (expand-file-name
9201 ((and buffer-file-name (org-mode-p))
9203 (setq cpltxt (concat "file:"
9204 (abbreviate-file-name buffer-file-name)))
9206 (when (org-xor org-context-in-file-links arg)
9223 (buffer-file-name
9224 ;; Just link to this file here.
9225 (setq cpltxt (concat "file:"
9226 (abbreviate-file-name buffer-file-name)))
9228 (when (org-xor org-context-in-file-links arg)
9240 (error "Cannot link to a buffer which is not visiting a file"))
9348 (let ((re (mapconcat (lambda (x) (regexp-quote (car x)))
9350 (while (string-match re text)
9360 (let ((re (mapconcat (lambda (x) (regexp-quote (cdr x)))
9362 (while (string-match re text)
9380 (if (re-search-forward "^From:\\s-+\\(.*\\)" nil t)
9387 (if (re-search-forward "^message-id:\\s-+\\(.*\\)" nil t)
9390 (if (re-search-forward "^subject:\\s-+\\(.*\\)" nil t)
9407 (defun org-insert-link (&optional complete-file)
9422 With a \\[universal-argument] prefix, prompts for a file to link to. The file name can be
9423 selected using completion. The path to the file will be relative to
9424 the current directory if the file is in the current directory or a
9426 completed in the minibuffer (i.e. normally ~/path/to/file).
9428 With two \\[universal-argument] prefixes, enforce an absolute path even if the file
9437 link desc entry remove file)
9446 ((or (org-in-regexp org-angle-link-re)
9447 (org-in-regexp org-plain-link-re))
9452 ((equal complete-file '(4))
9453 ;; Completing read for file names.
9454 (setq file (read-file-name "File: "))
9455 (let ((pwd (file-name-as-directory (expand-file-name ".")))
9456 (pwd1 (file-name-as-directory (abbreviate-file-name
9457 (expand-file-name ".")))))
9459 ((equal complete-file '(16))
9461 "file:"
9462 (abbreviate-file-name (expand-file-name file)))))
9463 ((string-match (concat "^" (regexp-quote pwd1) "\\(.+\\)") file)
9464 (setq link (org-make-link "file:" (match-string 1 file))))
9466 (expand-file-name file))
9468 "file:" (match-string 1 (expand-file-name file)))))
9469 (t (setq link (org-make-link "file:" file))))))
9481 (if (funcall (if (equal complete-file '(64)) 'not 'identity)
9488 (if (string-match org-plain-link-re link)
9492 ;; Check if we are linking to the current file with a search option
9494 (when (and buffer-file-name
9495 (string-match "\\<file:\\(.+?\\)::\\([^>]+\\)" link))
9500 (if (equal (file-truename buffer-file-name) (file-truename path))
9501 ;; We are linking to this same file, with a search option
9505 (when (string-match "\\<file:\\(.*\\)" link)
9509 ((eq org-link-file-path-type 'absolute)
9510 (setq path (abbreviate-file-name (expand-file-name path))))
9511 ((eq org-link-file-path-type 'noabbrev)
9512 (setq path (expand-file-name path)))
9513 ((eq org-link-file-path-type 'relative)
9514 (setq path (file-relative-name path)))
9518 (file-name-as-directory
9519 (expand-file-name "."))))
9520 (expand-file-name path))
9521 ;; We are linking a file with relative path name.
9522 (setq path (substring (expand-file-name path)
9524 (setq link (concat "file:" path))))
9552 (if (re-search-forward org-any-link-re nil t)
9572 (if (re-search-backward org-any-link-re nil t)
9580 (defun org-find-file-at-mouse (ev)
9581 "Open file link or URL at mouse."
9587 "Open file link or URL at mouse."
9604 optional argument IN-EMACS is non-nil, Emacs will visit the file."
9620 (if (string-match org-link-re-with-space2 link)
9635 (when (or (org-in-regexp org-angle-link-re)
9636 (org-in-regexp org-plain-link-re))
9676 (org-tags-view in-emacs path))
9689 ((string= type "file")
9696 (org-open-file path in-emacs line search))
9780 (defvar org-create-file-search-functions nil
9781 "List of functions to construct the right search string for a file link.
9786 handle this file type, for example by checking the major-mode or
9787 the file extension. If it decides not to handle this file, it
9789 does handle the file, it must return the search string to be used
9791 file link, given after a double colon, and `org-open-at-point'
9794 added to the companion hook `org-execute-file-search-functions',
9802 (defvar org-execute-file-search-functions nil
9803 "List of functions to execute a file search triggered by a link.
9806 search string that was part of the file link, the part after the
9809 file extension. If it decides not to handle this search, it
9838 ((run-hook-with-args-until-success 'org-execute-file-search-functions s))
9843 (re-search-forward
9906 "Execute `re-search-forward', but only accept matches that do not
9910 (while (apply 're-search-forward args)
9949 (when (re-search-forward "match[a-z]+" nil t)
9951 (if (re-search-forward "^[ \t]*[0-9]+" nil t)
9964 (setq org-mark-ring nil org-mark-ring-last-goto nil) ;; in case file is reloaded
9986 Org-mode commands jumping to a different position in the current file,
9987 or to another Org-mode file, automatically push the old position
10052 "Follow an info file & node link to NAME."
10080 (file (match-string 3 folder)))
10083 ;; use tramp to access the file
10085 (setq folder (format "[%s@%s]%s" user host file))
10086 (setq folder (format "/%s@%s:%s" user host file))))
10090 (setq folder (format "/%s@%s:%s" user host file))))))
10099 (if (not (re-search-forward
10129 (rmail (if (string= folder "RMAIL") rmail-file-name folder))
10134 (if (re-search-backward
10141 (rmail (if (string= folder "RMAIL") rmail-file-name folder))
10182 (re-search-forward "^\\(+.*\\)$" nil t)
10254 ;; file links to BibTeX database entries.
10256 (defun org-create-file-search-in-bibtex ()
10280 (defun org-execute-file-search-in-bibtex (s)
10283 ;; Yes, we want to do the search in this file.
10286 (and (re-search-forward (concat "@[a-zA-Z]+[ \t\n]*{[ \t\n]*"
10301 (add-hook 'org-create-file-search-functions 'org-create-file-search-in-bibtex)
10302 (add-hook 'org-execute-file-search-functions 'org-execute-file-search-in-bibtex)
10306 ;;; Following file links
10308 (defun org-open-file (path &optional in-emacs line search)
10309 "Open the file at PATH.
10310 First, this expands any special file name abbreviations. Then the
10311 configuration variable `org-file-apps' is checked if it contains an
10312 entry for this file type, and if yes, the corresponding command is launched.
10313 If no application is found, Emacs simply visits the file.
10314 With optional argument IN-EMACS, Emacs will visit the file.
10316 search for. If LINE or SEARCH is given, the file will always be
10318 If the file does not exist, an error is thrown."
10320 (let* ((file (if (equal path "")
10321 buffer-file-name
10322 (substitute-in-file-name (expand-file-name path))))
10323 (apps (append org-file-apps (org-default-apps)))
10324 (remp (and (assq 'remote apps) (org-file-remote-p file)))
10325 (dirp (if remp nil (file-directory-p file)))
10326 (dfile (downcase file))
10350 (not (file-exists-p file))
10352 (error "No such file: %s" file))
10355 ;; Remove quotes around the file name - we'll use shell-quote-argument.
10358 (setq cmd (format cmd (shell-quote-argument file)))
10363 (funcall (cdr (assq 'file org-link-frame-setup)) file)
10368 (t (funcall (cdr (assq 'file org-link-frame-setup)) file)))
10378 org-file-apps-defaults-macosx)
10380 org-file-apps-defaults-windowsnt)
10381 (t org-file-apps-defaults-gnu)))
10383 (defun org-expand-file-name (path)
10384 "Replace special path abbreviations and expand the file name."
10385 (expand-file-name path))
10388 (defun org-file-remote-p (file)
10394 (cond ((fboundp 'file-remote-p)
10395 (file-remote-p file))
10396 ((fboundp 'tramp-handle-file-remote-p)
10397 (tramp-handle-file-remote-p file))
10399 (string-match (car ange-ftp-name-format) file))
10417 RET at beg-of-buf -> Append to file as level 2 headline
10439 (file (if (and (nth 1 entry) (stringp (nth 1 entry))
10442 org-default-notes-file))
10459 "## `C-c C-c' to file interactively, `C-u C-c C-c' to file directly.
10460 ## Target file \"%s\", headline \"%s\"
10462 (abbreviate-file-name (or file org-default-notes-file))
10466 (while (re-search-forward "%\\([tTuUai]\\)" nil t)
10480 (while (re-search-forward "%\\(:[-a-zA-Z]+\\)" nil t)
10487 (if (and file (string-match "\\S-" file) (not (file-directory-p file)))
10488 (org-set-local 'org-default-notes-file file))
10493 (while (re-search-forward "%^\\({\\([^}]*\\)}\\)?\\([uUtT]\\)?" nil t)
10508 (if (re-search-forward "%\\?" nil t)
10510 (and (re-search-forward "^[^#\n]" nil t) (backward-char 1))))
10516 "Call `remember'. If this is already a remember buffer, re-apply template.
10535 "Store stuff from remember.el into an org file.
10536 First prompts for an org file. If the user just presses return, the value
10537 of `org-default-notes-file' is used.
10538 Then the command offers the headings tree of the selected file in order to
10539 file the text at a specific location.
10541 file, or you can use vertical cursor motion and visibility cycling (TAB) to
10546 RET buffer-start as level 2 heading at end of file
10554 the default file. This way your current train of thought is not
10573 (file (if fastp org-default-notes-file (org-get-org-file)))
10575 (visiting (org-find-base-buffer-visiting file))
10597 ;; Find the file
10598 (if (not visiting) (find-file-noselect file))
10599 (with-current-buffer (or visiting (get-file-buffer file))
10601 (not (re-search-forward "^\\* " nil t))
10611 (if (re-search-forward
10636 (re-search-forward "^\\*" nil t)
10658 (defun org-get-org-file ()
10660 (let ((default (or org-default-notes-file remember-data-file)))
10661 (read-file-name (format "File name [%s]: " default)
10662 (file-name-as-directory org-directory)
10666 "Check if the current file should receive notes in reversed order."
10675 (if (string-match (car entry) buffer-file-name)
10687 (setq pos (and (re-search-forward (concat "^#\\+BEGIN:[ \t]+" name "\\>")
10693 (defconst org-dblock-start-re
10697 (defconst org-dblock-end-re "^#\\+END\\([: \t\r\n]\\|$\\)"
10717 (unless (looking-at org-dblock-start-re)
10723 (unless (re-search-forward org-dblock-end-re nil t)
10737 (while (re-search-forward org-dblock-start-re nil t)
10743 (unless (re-search-forward org-dblock-end-re nil t)
10753 (or (looking-at org-dblock-start-re)
10774 (if (and (re-search-backward org-dblock-start-re nil t)
10776 (re-search-forward org-dblock-end-re nil t)
10798 setting file options.
10846 (while (re-search-forward org-todo-line-regexp nil t)
10982 (when org-log-done
10984 (listp org-log-done) (memq 'state org-log-done)))
10988 (and dostates (org-add-log-maybe 'state state 'findpos)))
10990 (org-add-log-maybe 'state state 'findpos))
10995 (org-add-log-maybe 'done state 'findpos))))
11016 (if (re-search-forward
11017 org-repeat-re (save-excursion (outline-next-heading) (point)) t)
11021 (defvar org-log-post-message)
11031 (org-log-done)
11032 re type n what start)
11037 (unless (memq 'org-add-log-note (default-value 'post-command-hook))
11039 (let ((org-log-done '(done)))
11040 (org-add-log-maybe 'done org-done-string 'findpos)))
11043 (setq re (concat "\\(" org-scheduled-time-regexp "\\)\\|\\("
11045 (while (re-search-forward
11046 re (save-excursion (outline-next-heading) (point)) t)
11056 (setq org-log-post-message msg)
11068 (kwd-re
11076 (org-occur (concat "^" outline-regexp " +" kwd-re )))))
11130 (re-search-forward org-scheduled-time-regexp nil t))
11132 (re-search-forward org-deadline-time-regexp nil t))
11134 (re-search-forward org-closed-time-regexp nil t)))
11156 (defvar org-log-note-marker (make-marker))
11157 (defvar org-log-note-purpose nil)
11158 (defvar org-log-note-state nil)
11159 (defvar org-log-note-window-configuration nil)
11160 (defvar org-log-note-return-to (make-marker))
11161 (defvar org-log-post-message nil
11162 "Message to be displayed after a log note has been stored.
11165 (defun org-add-log-maybe (&optional purpose state findpos)
11167 (when (and (listp org-log-done)
11168 (memq purpose org-log-done))
11175 (move-marker org-log-note-marker (point))
11176 (setq org-log-note-purpose purpose)
11177 (setq org-log-note-state state)
11178 (add-hook 'post-command-hook 'org-add-log-note 'append))))
11180 (defun org-add-log-note (&optional purpose)
11182 (remove-hook 'post-command-hook 'org-add-log-note)
11183 (setq org-log-note-window-configuration (current-window-configuration))
11185 (move-marker org-log-note-return-to (point))
11186 (switch-to-buffer (marker-buffer org-log-note-marker))
11187 (goto-char org-log-note-marker)
11193 ((eq org-log-note-purpose 'clock-out) "stopped clock")
11194 ((eq org-log-note-purpose 'done) "closed todo item")
11195 ((eq org-log-note-purpose 'state) "state change")
11197 (org-set-local 'org-finish-function 'org-store-log-note))
11199 (defun org-store-log-note ()
11200 "Finish taking a log note, and insert it to where it belongs."
11202 (note (cdr (assq org-log-note-purpose org-log-note-headings)))
11219 (cons "%s" (if org-log-note-state
11220 (concat "\"" org-log-note-state "\"")
11225 (set-buffer (marker-buffer org-log-note-marker))
11227 (goto-char org-log-note-marker)
11228 (move-marker org-log-note-marker nil)
11235 (set-window-configuration org-log-note-window-configuration)
11236 (with-current-buffer (marker-buffer org-log-note-return-to)
11237 (goto-char org-log-note-return-to))
11238 (move-marker org-log-note-return-to nil)
11239 (and org-log-post-message (message org-log-post-message)))
11263 (while (re-search-forward regexp nil t)
11421 (let* ((re (concat "[\n\r]" outline-regexp " *\\(\\<\\("
11433 (format "mouse-2 or RET jump to org file %s"
11434 (abbreviate-file-name buffer-file-name))))
11442 (while (re-search-forward re nil t)
11519 (re "^&?\\([-+:]\\)?\\({[^}]+}\\|LEVEL=\\([0-9]+\\)\\|[A-Za-z_@0-9]+\\)")
11522 orterms term orlist re-p level-p)
11542 (while (string-match re term)
11546 re-p (equal (string-to-char tag) ?{)
11549 (re-p `(org-match-any-p ,(substring tag 1 -1) tags-list))
11568 (while (string-match re term)
11572 re-p (equal (string-to-char kwd) ?{)
11574 mm (if re-p
11593 (defun org-match-any-p (re list)
11594 "Does re match any element of list?"
11595 (setq list (mapcar (lambda (x) (string-match re x)) list))
11606 (let* ((re (concat "^" outline-regexp))
11614 (while (re-search-forward re nil t)
11647 (if (re-search-forward
11699 (if (re-search-forward "[ \t]+Next change exits" (point-at-eol) t)
11819 (while (re-search-forward "[{}]" nil t) (replace-match " ")))
11873 (while (re-search-forward "\\[.\\] \\([a-zA-Z0-9_@]+\\)" nil t)
11902 (while (re-search-forward "[ \t]:\\([A-Za-z_@0-9:]+\\):[ \t\r\n]" nil t)
12003 (re-search-backward
12012 (view-diary-entries-initially nil)
12013 (view-calendar-holidays-initially nil)
12204 (re org-ts-regexp-both)
12206 (while (setq start (string-match re string start))
12288 (re-search-forward org-tr-regexp (point-at-eol) t))
12506 (view-calendar-holidays-initially nil)
12507 (view-diary-entries-initially nil))
12579 (org-add-log-maybe 'clock-out)
12593 (defvar org-clock-file-total-minutes nil
12594 "Holds the file total time in minutes, after a call to `org-clock-sum'.")
12595 (make-variable-buffer-local 'org-clock-file-total-minutes)
12602 (re (concat "^\\(\\*+\\)[ \t]\\|^[ \t]*"
12614 (while (re-search-backward re nil t)
12637 (setq org-clock-file-total-minutes (aref ltimes 0)))
12642 If TOTAL-ONLY is non-nil, only show the total time for the entire file
12655 (setq h (/ org-clock-file-total-minutes 60)
12656 m (- org-clock-file-total-minutes (* 60 h)))
12661 (message "Total file time: %d:%02d (%d hours and %d minutes)" h m h m)))
12713 (let ((org-log-done (if (and (listp org-log-done)
12714 (member 'clock-out org-log-done))
12716 org-log-done)))
12759 (let ((re (concat "[ \t]*" org-clock-string
12763 (if (not (looking-at re))
12853 (setq h (/ org-clock-file-total-minutes 60)
12854 m (- org-clock-file-total-minutes (* 60 h)))
12855 (insert-before-markers "|-\n|0|" "*Total file time*| "
12892 (let ((re (concat "^[ \t]*" org-clock-string
12899 (while (re-search-forward re nil t)
12915 (setq closedp (re-search-forward org-closed-time-regexp next t))
12932 (defvar org-agenda-menu) ; defined later in this file.
12934 (defvar org-agenda-show-log nil)
12938 (defvar org-agenda-force-single-file nil)
12941 "Mode for time-sorted view on action items in Org-mode files.
12967 org-agenda-show-log nil))
12974 "Restricted to single file"
12976 '(org-edit-agenda-file-list)
12979 (mapcar 'org-file-menu-entry (org-agenda-files))))
13005 (define-key org-agenda-mode-map "d" 'org-agenda-day-view)
13006 (define-key org-agenda-mode-map "w" 'org-agenda-week-view)
13020 (define-key org-agenda-mode-map "l" 'org-agenda-log-mode)
13109 ["Create iCalendar file" org-export-icalendar-combine-agenda-files t])
13112 ["Day View" org-agenda-day-view :active (org-agenda-check-type nil 'agenda)
13114 ["Week View" org-agenda-week-view :active (org-agenda-check-type nil 'agenda)
13117 ["Show Logbook entries" org-agenda-log-mode
13118 :style toggle :selected org-agenda-show-log :active (org-agenda-check-type nil 'agenda 'timeline)]
13230 m Call `org-tags-view' to display headlines with tags matching
13239 If the current buffer is in Org-mode and visiting a file, you can also
13241 next use of \\[org-agenda]) restricted to the current file."
13245 (bfn (buffer-file-name (buffer-base-buffer)))
13324 (if restrict-ok " (restricted to current file)" ""))
13337 (org-let lprops '(org-tags-view current-prefix-arg match)))
13339 (org-let lprops '(org-tags-view '(4) match)))
13361 ((equal c ?m) (call-interactively 'org-tags-view))
13362 ((equal c ?M) (org-call-with-arg 'org-tags-view (or arg '(4))))
13365 (error "This is not an Org-mode file"))
13390 '(org-tags-view current-prefix-arg match)))
13393 '(org-tags-view '(4) match)))
13437 ;;; Agenda file list
13445 ((stringp org-agenda-files) (org-read-agenda-file-list))
13449 (defun org-edit-agenda-file-list ()
13452 `org-agenda-files', or it visits the file that is holding the list. In the
13458 (find-file org-agenda-files)
13466 (message "New agenda file list installed"))
13472 (defun org-store-new-agenda-file-list (list)
13473 "Set new value for the agenda file list and save it correcly."
13477 (with-temp-file f
13483 (defun org-read-agenda-file-list ()
13484 "Read the list of agenda files from a file."
13487 (insert-file-contents org-agenda-files)
13494 If the current buffer visits an agenda file, find the next one in the list.
13495 If the current buffer does not, find the first agenda file."
13499 (tcf (if buffer-file-name (file-truename buffer-file-name)))
13500 file)
13503 (while (setq file (pop files))
13504 (if (equal (file-truename file) tcf)
13506 (find-file (car files))
13508 (find-file (car fs)))
13511 (defun org-agenda-file-to-end ()
13512 "Move/add the current file to the end of the agenda file list.
13513 If the file is not present in the list, it is appended to the list. If it is
13516 (org-agenda-file-to-front 'to-end))
13518 (defun org-agenda-file-to-front (&optional to-end)
13519 "Move/add the current file to the top of the agenda file list.
13520 If the file is not present in the list, it is added to the front. If it is
13524 (let ((file-alist (mapcar (lambda (x)
13525 (cons (file-truename x) x))
13527 (ctf (file-truename buffer-file-name))
13529 (setq x (assoc ctf file-alist) had x)
13531 (if (not x) (setq x (cons ctf (abbreviate-file-name buffer-file-name))))
13533 (setq file-alist (append (delq x file-alist) (list x)))
13534 (setq file-alist (cons x (delq x file-alist))))
13535 (org-store-new-agenda-file-list (mapcar 'cdr file-alist))
13537 (message "File %s to %s of agenda file list"
13540 (defun org-remove-file (&optional file)
13541 "Remove current file from the list of files in variable `org-agenda-files'.
13543 Optional argument FILE means, use this file instead of the current."
13545 (let* ((file (or file buffer-file-name))
13546 (true-file (file-truename file))
13547 (afile (abbreviate-file-name file))
13550 (if (equal true-file
13551 (file-truename x))
13556 (org-store-new-agenda-file-list files)
13558 (message "Removed file: %s" afile))
13561 (defun org-file-menu-entry (file)
13562 (vector file (list 'find-file file) t))
13564 (defun org-check-agenda-file (file)
13566 (when (not (file-exists-p file))
13567 (message "non-existent file %s. [R]emove from list or [A]bort?"
13568 (abbreviate-file-name file))
13572 (org-remove-file file)
13630 bmp file re)
13633 (while (setq file (pop files))
13634 (org-check-agenda-file file)
13635 (set-buffer (org-get-agenda-file-buffer file))
13642 (while (re-search-forward rea nil t)
13646 (setq re (concat "^\\*+ +" org-comment-string "\\>"))
13647 (while (re-search-forward re nil t)
13707 (defun org-get-agenda-file-buffer (file)
13710 (let ((buf (org-find-base-buffer-visiting file)))
13714 (setq buf (find-file-noselect file))
13722 (let (buf file)
13724 (setq file (buffer-file-name buf))
13726 file
13727 (y-or-n-p (format "Save file %s? " file)))
13737 (while (re-search-forward "\\(^\\|\r\\)#\\+CATEGORY:[ \t]*\\(.*\\)" nil t)
13747 (if buffer-file-name
13748 (file-name-sans-extension
13749 (file-name-nondirectory buffer-file-name))
13762 "Show a time-sorted view of the entries in the current org file.
13774 (doclosed org-agenda-show-log)
13775 (entry buffer-file-name)
13847 (let ((re (if inactive org-ts-regexp-both org-ts-regexp))
13853 (while (re-search-forward re end t)
13859 (while (re-search-forward org-tr-regexp end t)
13891 "Produce a weekly view from all files in variable `org-agenda-files'.
13892 The view will be for the current week, but from the overview buffer you
13897 on the days are also shown. See the variable `org-log-done' for how
13929 s e rtn rtnall file date d start-pos end-pos todayp nd)
13946 (while (setq file (pop files))
13948 (org-check-agenda-file file)
13951 file date :todo))
13971 (while (setq file (pop files))
13973 (org-check-agenda-file file)
13974 (if org-agenda-show-log
13976 file date
13979 file date
14029 "Show all TODO entries from all agenda file in a single list.
14046 rtn rtnall files file pos)
14059 (while (setq file (pop files))
14061 (org-check-agenda-file file)
14062 (setq rtn (org-agenda-get-day-entries file date :todo))
14094 (defun org-tags-view (&optional todo-only match)
14103 rtn rtnall files file pos matcher
14109 (list 'org-tags-view (list 'quote todo-only)
14113 (while (setq file (pop files))
14115 (org-check-agenda-file file)
14116 (setq buffer (if (file-exists-p file)
14117 (org-get-agenda-file-buffer file)
14118 (error "No such file %s" file)))
14120 ;; If file does not exist, merror message to agenda
14122 (format "ORG-AGENDA-ERROR: No such org-file %s" file))
14126 (error "Agenda file %s is not in `org-mode'" file))
14176 (setq skip (re-search-forward org-agenda-skip-regexp end t)))
14180 "Create agenda view for projects that are stuck.
14191 (todo-re (concat "^\\*+[ \t]+\\("
14194 (tags-re (concat "^\\*+.*:\\("
14201 (concat todo-re "\\|" tags-re))
14202 (todo todo-re)
14203 (tags tags-re)
14205 (org-tags-view nil matcher)
14221 (diary-file-name-prefix-function nil) ; turn this feature off
14262 (re-search-forward "\n=+$" nil t)
14264 (while (re-search-backward "^ +\n?" nil t) (replace-match "")))
14265 (re-search-forward "\n=+$" nil t)
14268 (while (re-search-forward "^ +\n" nil t)
14271 (if (re-search-forward "^Org-mode dummy\n?" nil t)
14284 buffer-file-name)
14292 'help-echo (format "mouse-2 or RET jump to diary file %s"
14293 (abbreviate-file-name buffer-file-name))
14328 :todo List all TODO items from the org-file. This may be a
14333 The call in the diary file should look like this:
14337 Use a separate line for each org file to check. Or, if you omit the file name,
14358 file rtn results)
14362 (while (setq file (pop files))
14363 (setq rtn (apply 'org-agenda-get-day-entries file date args))
14370 (defun org-agenda-get-day-entries (file date &rest args)
14372 FILE is the path to a file to be checked for entries. DATE is date like
14379 (buffer (if (file-exists-p file)
14380 (org-get-agenda-file-buffer file)
14381 (error "No such file %s" file)))
14384 ;; If file does not exist, make sure an error message ends up in diary
14385 (list (format "ORG-AGENDA-ERROR: No such org-file %s" file))
14388 (error "Agenda file %s is not in `org-mode'" file))
14424 (and (re-search-backward "[\r\n]\\*" nil t)
14453 (format "mouse-2 or RET jump to org file %s"
14454 (abbreviate-file-name buffer-file-name))))
14464 (while (re-search-forward regexp nil t)
14470 (re-search-forward org-scheduled-time-regexp end t))
14472 (re-search-forward org-deadline-time-regexp end t)
14510 (format "mouse-2 or RET jump to org file %s"
14511 (abbreviate-file-name buffer-file-name))))
14522 (while (re-search-forward regexp nil t)
14543 (if (re-search-backward "\\(^\\|\r\\)\\*+" nil t)
14579 (format "mouse-2 or RET jump to org file %s"
14580 (abbreviate-file-name buffer-file-name))))
14593 (while (re-search-forward regexp nil t)
14606 (if (re-search-backward "\\(^\\|\r\\)\\*+" nil t)
14632 (format "mouse-2 or RET jump to org file %s"
14633 (abbreviate-file-name buffer-file-name))))
14640 (while (re-search-forward regexp nil t)
14653 (if (re-search-backward "\\(^\\|\r\\)\\*+[ \t]*" nil t)
14689 (format "mouse-2 or RET jump to org file %s"
14690 (abbreviate-file-name buffer-file-name))))
14697 (while (re-search-forward regexp nil t)
14709 (if (re-search-backward "\\(^\\|\r\\)\\*+[ \t]*" nil t)
14739 (format "mouse-2 or RET jump to org file %s"
14740 (abbreviate-file-name buffer-file-name))))
14745 (while (re-search-forward regexp nil t)
14760 (if (re-search-backward "\\(^\\|\r\\)\\*+" nil t)
14824 category taken from local variable or file name. It will replace the `%c'
14836 (if buffer-file-name
14837 (file-name-sans-extension
14838 (file-name-nondirectory buffer-file-name))
15011 (let (re pl)
15015 (setq re (get-text-property (point) 'org-not-done-regexp))
15017 (and (looking-at (concat "[ \t]*\\.*" re))
15020 (setq re (concat (get-text-property 0 'org-not-done-regexp x))
15022 (and re (equal (string-match (concat "\\(\\.*\\)" re) x (or pl 0)) pl)
15178 (defun org-agenda-week-view ()
15179 "Switch to weekly view for agenda."
15183 (error "This is already the week view"))
15193 (message "Switched to week view"))
15195 (defun org-agenda-day-view ()
15196 "Switch to daily view for agenda."
15200 (error "This is already the day view"))
15210 (message "Switched to day view"))
15219 (if (not (re-search-forward "^\\S-" nil t arg))
15230 (if (not (re-search-backward "^\\S-" nil t arg))
15262 (defun org-agenda-log-mode ()
15263 "Toggle log mode in an agenda buffer."
15266 (setq org-agenda-show-log (not org-agenda-show-log))
15270 (if org-agenda-show-log "on" "off")))
15301 (if org-agenda-show-log " Log" "")))
15329 "Go to the Org-mode file which contains the item at point."
15364 (while (re-search-forward "^[ \t]*\\S-" dend t) (setq n (1+ n)))))
15425 (if (or (re-search-forward org-bracket-link-regexp eol t)
15426 (re-search-forward org-angle-link-re eol t)
15427 (re-search-forward org-plain-link-re eol t))
15432 "Go to the Org-mode file which contains the item at point."
15449 "Go to the Org-mode file which contains the item at the mouse click."
15455 "Display the Org-mode file which contains the item at point."
15462 "Display the Org-mode file which contains the item at point and recenter."
15470 "Display the Org-mode file which contains the item at the mouse click."
15506 "Cycle TODO state of line at point, also in Org-mode file.
15508 the same tree node, and the headline of the tree node in the Org-mode file."
15542 `equal' against all `org-hd-marker' text properties in the file.
15590 (while (re-search-forward "\\([ \t]+\\):[a-zA-Z0-9_@:]+:[ \t]*$"
15600 "Increase the priority of line at point, also in Org-mode file."
15605 "Decrease the priority of line at point, also in Org-mode file."
15610 "Set the priority of line at point, also in Org-mode file.
15612 the same tree node, and the headline of the tree node in the Org-mode file."
15869 ; (buf (get-file-buffer (substitute-in-file-name diary-file)))
15948 (view-calendar-holidays-initially nil)
15949 (view-diary-entries-initially nil))
16057 (re-search-backward (concat "^\\(" paragraph-start "\\)") nil t)
16059 dd-on str (start 0) m re)
16063 re (nth 1 (assoc "$" org-latex-regexps)))
16064 (while (string-match re str start)
16071 (when (setq m (re-search-backward "\\(\\\\begin{[^}]*}\\|\\\\(\\|\\\\\\[\\)\\|\\(\\\\end{[^}]*}\\|\\\\)\\|\\\\\\]\\)\\|\\(\\$\\$\\)" lim t))
16076 (while (re-search-backward "\\$\\$" lim t)
16143 (re-search-backward (concat "^" outline-regexp) nil t))))
16160 (concat "ltxpng/" (file-name-sans-extension
16161 (file-name-nondirectory
16162 buffer-file-name)))
16179 (let* ((prefixnodir (file-name-nondirectory prefix))
16180 (absprefix (expand-file-name prefix dir))
16181 (todir (file-name-directory absprefix))
16184 (re-list org-latex-regexps)
16185 (cnt 0) txt link beg end re e checkdir
16188 (when (file-directory-p todir)
16189 (mapc 'delete-file
16194 (while (setq e (pop re-list))
16195 (setq m (car e) re (nth 1 e) n (nth 2 e)
16199 (while (re-search-forward re nil t)
16206 link (concat block "[[file:" linkfile "]]" block))
16211 (or (file-directory-p todir) (make-directory todir)))
16222 (make-glyph (vector 'png :file movefile))))
16225 (list 'image :type 'png :file movefile :ascent 'center)))
16235 temporary-file-directory))
16237 (expand-file-name "orgtex" tmpdir)))
16239 ;(texfilebase (make-temp-file "orgtex"))
16240 ; (dummy (delete-file texfilebase))
16247 (with-temp-file texfile
16264 (if (not (file-exists-p dvifile))
16265 (progn (message "Failed to create dvi file from %s" texfile) nil)
16271 (if (not (file-exists-p pngfile))
16272 (progn (message "Failed to create png file from %s" texfile) nil)
16273 ;; Use the requested file name and clean up
16274 (copy-file pngfile tofile 'replace)
16275 (loop for e in '(".dvi" ".tex" ".aux" ".log" ".png") do
16276 (delete-file (concat texfilebase e)))
16293 (defvar org-current-export-file nil) ; dynamically scoped parameter
16333 "Return the property list with file-local settings for export."
16336 (let ((re (org-make-options-regexp
16339 (while (re-search-forward re nil t)
16383 (re (concat "^" outline-regexp)))
16385 (not (string-match re (car list))))
16426 \[i] export current file as iCalendar file
16428 \[c] export agenda files into combined iCalendar file
16430 \[F] publish current file
16441 (?i . org-export-icalendar-this-file)
16444 (?F . org-publish-current-file)
16739 ("log"."log")
16763 (let* ((re-radio (and org-target-link-regexp
16765 (re-plain-link (concat "\\([^[<]\\)" org-plain-link-re))
16766 (re-angle-link (concat "\\([^[]\\)" org-angle-link-re))
16767 (re-archive (concat ":" org-archive-tag ":"))
16768 (re-quote (concat "^\\*+[ \t]+" org-quote-string "\\>"))
16782 (while (re-search-forward re-archive nil t)
16792 (while (re-search-forward "^[ \t]*:.*\\(\n[ \t]*:.*\\)*" nil t)
16797 (while (re-search-forward "^#\\+HTML:[ \t]*\\(.*\\)" nil t)
16803 (while (re-search-forward
16810 (while (re-search-forward re-quote nil t)
16819 (while (re-search-forward "^#.*?\\(<<<?[^>\r\n]+>>>?\\).*" nil t)
16824 (while (re-search-forward "^#.*\n?" nil t)
16829 (when re-radio
16830 (while (re-search-forward re-radio nil t)
16836 (while (re-search-forward "\\(\\(\\[\\|\\]\\)\\[[^]]*?\\)[ \t]*\n[ \t]*\\([^]]*\\]\\(\\[\\|\\]\\)\\)" nil t)
16844 (concat "ltxpng/" (file-name-sans-extension
16845 (file-name-nondirectory
16846 org-current-export-file)))
16853 (while (re-search-forward re-plain-link nil t)
16860 (while (re-search-forward re-angle-link nil t)
16867 (while (re-search-forward org-bracket-link-regexp nil t)
16882 (while (re-search-forward org-emph-re nil t)
16954 "Export the outline as a pretty ASCII file.
16977 (filename (concat (file-name-as-directory
16979 (file-name-sans-extension
16980 (file-name-nondirectory buffer-file-name))
16982 (buffer (find-file-noselect filename))
16989 (file-name-sans-extension
16990 (file-name-nondirectory buffer-file-name))))
16994 ; (quote-re (concat "^\\(\\*+\\)\\([ \t]*" org-quote-string "\\>\\)"))
17002 (find-file-noselect filename)
17119 (re org-todo-line-regexp)
17123 (if (string-match re line)
17185 org-mode file will not be removed but presented to you so that you can
17203 (file buffer-file-name)
17220 (while (re-search-forward "[\n\r]#[^\n\r]*" nil t)
17224 (let ((buffer-file-name file)
17277 (file-name-nondirectory buffer-file-name)
17289 (cond ((eq t org-log-done) "logdone")
17290 ((not org-log-done) "nologging")
17291 ((listp org-log-done)
17293 org-log-done " ")))
17302 "org file:~/org/%s.org"
17328 (re "[ \t]*\\(:\\)")
17335 (setq off (looking-at re))
17344 ((and off (looking-at re))
17365 (org-open-file buffer-file-name))
17376 "Export the outline as a pretty HTML file.
17382 org-mode's default settings, but still inferior to file-local settings."
17405 (org-current-export-file buffer-file-name)
17417 (filename (concat (file-name-as-directory
17419 (file-name-sans-extension
17420 (file-name-nondirectory buffer-file-name))
17422 (current-dir (file-name-directory buffer-file-name))
17423 (buffer (find-file-noselect filename))
17429 (file-name-sans-extension
17430 (file-name-nondirectory buffer-file-name))))
17432 (quote-re (concat "^\\(\\*+\\)\\([ \t]*" org-quote-string "\\>\\)"))
17446 (coding-system (and (boundp 'buffer-file-coding-system)
17447 buffer-file-coding-system))
17668 (when (and descp (org-file-image-p desc))
17670 (if (string-match "^file:" desc)
17685 (org-file-image-p path))
17693 ((string= type "file")
17696 (abs-p (file-name-absolute-p filename))
17697 thefile file-is-image-p search)
17706 (setq file-is-image-p (org-file-image-p filename))
17707 (setq thefile (if abs-p (expand-file-name filename) filename))
17721 (when (string-match "^file:" desc)
17725 (setq rpl (if (and file-is-image-p
17768 (when (string-match quote-re line)
17883 (while (re-search-forward "<p>[ \r\n\t]*</p>" nil t)
17886 (while (re-search-forward "<li>[ \r\n\t]*</li>\n?" nil t)
17907 (re (concat "^[ \t]*" (regexp-quote ll)))
17908 (spanning (delq nil (mapcar (lambda (x) (not (string-match re x)))
18062 (if (not (re-search-forward "|[^+]" nil t))
18164 (re nothing)
18168 re (concat re or next)
18170 (concat left "\\(" re "\\)" right)))
18200 (while (string-match org-emph-re string)
18220 ; (re-search-backward "</?\\(ul\\|ol\\|li\\|[hH][0-9]\\)>" nil t))
18276 (defun org-export-icalendar-this-file ()
18277 "Export current file as an iCalendar file.
18278 The iCalendar file will be located in the same directory as the Org-mode
18279 file, but with extension `.ics'."
18281 (org-export-icalendar nil buffer-file-name))
18286 Each iCalendar file will be located in the same directory as the Org-mode
18287 file, but with extension `.ics'."
18293 "Export all files in `org-agenda-files' to a single combined iCalendar file.
18294 The file is stored under the name `org-combined-agenda-icalendar-file'."
18301 file and store it under the name `org-combined-agenda-icalendar-file'."
18306 file ical-file ical-buffer category started org-agenda-new-buffers)
18309 (setq ical-file
18310 (if (file-name-absolute-p org-combined-agenda-icalendar-file)
18311 org-combined-agenda-icalendar-file
18312 (expand-file-name org-combined-agenda-icalendar-file dir))
18313 ical-buffer (org-get-agenda-file-buffer ical-file))
18315 (while (setq file (pop files))
18317 (org-check-agenda-file file)
18318 (set-buffer (org-get-agenda-file-buffer file))
18320 (setq ical-file (concat (file-name-as-directory dir)
18321 (file-name-sans-extension
18322 (file-name-nondirectory buffer-file-name))
18324 (setq ical-buffer (org-get-agenda-file-buffer ical-file))
18327 (file-name-sans-extension
18328 (file-name-nondirectory buffer-file-name))))
18333 (org-start-icalendar-file org-icalendar-combined-name))
18334 (org-start-icalendar-file category))
18337 (org-finish-icalendar-file)
18340 (run-hooks 'org-after-save-iCalendar-file-hook)))))
18343 (defvar org-after-save-iCalendar-file-hook nil
18344 "Hook run after an iCalendar file has been saved.
18346 A good way to use this is to tell a desktop calenndar application to re-read
18347 the iCalendar file.")
18350 "Print iCalendar entries for the current Org-mode file to `standard-output'.
18361 (while (re-search-forward org-ts-regexp nil t)
18399 (while (re-search-forward org-todo-line-regexp nil t)
18425 (defun org-start-icalendar-file (name)
18426 "Start an iCalendar file by inserting the header."
18438 (defun org-finish-icalendar-file ()
18439 "Finish an iCalendar file by inserting the END statement."
18478 (filename (concat (file-name-as-directory
18480 (file-name-sans-extension
18481 (file-name-nondirectory buffer-file-name))
18483 (out (find-file-noselect filename))
18490 (while (re-search-forward "^\\(\\*+\\) \\(.+\\)" (point-max) 't)
18652 (define-key org-mode-map "\C-c[" 'org-agenda-file-to-front)
18653 (define-key org-mode-map "\C-c]" 'org-remove-file)
18726 still be marked for re-alignment if the field did fill the entire column,
18749 still be marked for re-alignment if the field did fill the entire column,
18817 (arg (message "Content view to level: ")
18995 - If the cursor is on a #+TBLFM line, re-apply the formulas to
19001 - If the current buffer is a remember buffer, close note and file it.
19002 with a prefix argument, file it without further interaction to the default
19028 (re-search-forward "|" (save-excursion (end-of-line 2) (point)))
19246 (progn (setq org-log-done (not org-log-done))
19249 (if org-log-done "automatically" "not")))
19250 :style toggle :selected org-log-done])
19254 ("Special views current file"
19300 (defun org-toggle-log-option (type)
19301 (if (not (listp org-log-done)) (setq org-log-done nil))
19302 (if (memq type org-log-done)
19303 (setq org-log-done (delq type org-log-done))
19304 (add-to-list 'org-log-done type)))
19306 (defun org-check-log-option (type)
19307 (and (listp org-log-done) (memq type org-log-done)))
19327 ["Edit File List" (org-edit-agenda-file-list) t]
19328 ["Add/Move Current File to Front of List" org-agenda-file-to-front t]
19329 ["Remove Current File from List" org-remove-file t]
19332 (mapcar 'org-file-menu-entry (org-agenda-files t))))))))
19462 (defun org-in-regexp (re &optional nlines visually)
19474 (while (re-search-forward re eol t)
19538 e re rpl)
19540 (setq re (concat "%-?[0-9.]*" (substring (car e) 1)))
19541 (while (string-match re string)
19564 (while (re-search-forward regexp end t)
19570 (defun org-find-base-buffer-visiting (file)
19573 (let ((buf (find-buffer-visiting file)))
19635 (defun org-image-file-name-regexp ()
19636 "Return regexp matching the file names of images."
19637 (if (fboundp 'image-file-name-regexp)
19638 (image-file-name-regexp)
19639 (let ((image-file-name-extensions
19644 image-file-name-extensions)
19645 image-file-name-extensions)
19649 (defun org-file-image-p (file)
19652 (string-match (org-image-file-name-regexp) file)))
19710 (let ((fun (if previous 're-search-backward 're-search-forward))
19712 (re (concat "^" outline-regexp))
19718 (while (funcall fun re nil t)
19792 (re-search-forward (concat "[\r\n]\\(" outline-regexp "\\)") nil 'move)