2010-04-10 Carsten Dominik <carsten.dominik@gmail.com>

* org.el (org-insert-link): Find the link buffer on visible
	frames.
	(org-export-latex-default-packages-alist): hyperref must be loaded
	late.
	(org-open-file): More care with the new matching for file links.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-latex.el (org-export-latex-preprocess): Do not yet protect
	defined entities - these will be taken care of later.
	(org-export-latex-special-chars): Post-process entity replacement.
	(org-export-latex-fontify-headline): Do not yet protect defined
	entities - these will be taken care of later.
	(org-export-latex-tables, org-export-latex-links): Format the
	caption properly.

	* org-entities.el (org-entities-user): Fix typo.

	* org.el (org-prepare-agenda-buffers): Uniquify TODO keywords

	* org-entities.el (org-entities-user): Improve docstring.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-entities.el (org-macs): Require org-macs, to be sure that we
	have `declare-function' defined.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-latex.el (org-export-latex-classes): Update docstring.

	* org.el (org-format-latex-header): Add cookies to the header.
	(org-splice-latex-header): Implement placement according to
	cookies.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-publish.el (org-publish-aux-preprocess): Control case
	sensitivity.

2010-04-10  Bastien Guerry  <bzg@altern.org>

	* org.el (org-splice-latex-header): Fix typo.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-latex.el (org-export-latex-make-header): Use
	`org-splice-latex-header' to build the header.
	(org-export-latex-classes): Update docstring.

	* org.el (org-splice-latex-header): New function.
	(org-create-formula-image): Use `org-splice-latex-header' to build
	the header.

	* org-gnus.el (org-gnus-follow-link): Handle nndoc backend.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-export-latex-packages-alist)
	(org-export-latex-default-packages-alist): Fix docstring to
	reflect the expected structure.

	* org-docbook.el (org-docbook-do-expand): Fix bug with variable names.
	(org-export-docbook-finalize-table): Make use of label for tables.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-attach.el (org-attach-commit): Split on newlines.

	* org.el (org-export-latex-default-packages-alist): Use list
	instead of cons for the entries.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-entities.el (org-entity-get-representation): Catch the case
	that there is not entry in the list.

	* org-mobile.el (org-mobile-use-encryption)
	(org-mobile-encryption-tempfile, org-mobile-encryption-password):
	New options.
	(org-mobile-check-setup): CHeck the encryption setup.
	(org-mobile-copy-agenda-files, org-mobile-sumo-agenda-command)
	(org-mobile-create-sumo-agenda): Use encryption code.
	(org-mobile-encrypt-and-move): New function.
	(org-mobile-encrypt-file, org-mobile-decrypt-file): New
	functions.
	(org-mobile-move-capture): Decrypt the capture file.

	* org.el (org-entities): Require the new file.
	(org-export-latex-default-packages-alist): New variable.
	(org-complete): Use new entity code for completion.
	(org-create-formula-image): Use the new packages variable.

	* org-latex.el (org-export-latex-classes): Remove the standard
	packages from the class headers.
	(org-export-latex-make-header): Use the new package variable.
	(org-export-latex-special-chars): Better regexp for entities, to
	support entity name that contain numbers.
	(org-export-latex-treat-backslash-char): Use the new entity code.

	* org-html.el (org-html-do-expand): Use the new entity code.

	* org-exp.el (org-export): Add the new export commands.
	(org-html-entities): Constant removed.
	(org-export-visible): Add the new export commands.

	* org-entities.el: New file.

	* org-docbook.el (org-docbook-do-expand): Use new entity code.

	* org-ascii.el (org-export-ascii-entities): New variable.
	(org-export-as-latin1, org-export-as-latin1-to-buffer)
	(org-export-as-utf8, org-export-as-utf8-to-buffer): New commands.
	(org-export-as-encoding): New function.
	(org-export-ascii-preprocess): Call `org-ascii-replace-entities'.
	(org-ascii-replace-entities): New function.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-html.el (org-html-level-start): Catch the case that target
	might be nil.

2010-04-10  Dan Davison  <davison@stats.ox.ac.uk>

	* org.el (org-appearance): Change Customize group variable name
	from org-font-lock to org-appearance, and change tag from "Org
	Font Lock" to "Org Appearance"
	(org-odd-levels-only): Change Customize group variable name
	(org-level-color-stars-only): Change Customize group variable name
	(org-hide-leading-stars): Change Customize group variable name
	(org-hidden-keywords): Change Customize group variable name
	(org-fontify-done-headline): Change Customize group variable name
	(org-fontify-emphasized-text): Change Customize group variable name
	(org-fontify-whole-heading-line): Change Customize group variable name
	(org-highlight-latex-fragments-and-specials): Change Customize
	group variable name
	(org-hide-emphasis-markers): Change Customize group variable name
	(org-emphasis-alist): Change Customize group variable name
	(org-emphasis-regexp-components): Change Customize group variable
	name
	(org-modules): Remove mention of org-R

	* org-faces.el (org-faces): Change Customize group variable name

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-agenda.el (org-diary-last-run-time): New variable.
	(org-diary): prepare agenda buffers only if last call was some
	time ago.

	* org-html.el (org-export-html-preprocess): Replace \ref macros
	with a link.
	(org-format-org-table-html): Add the label as an anchor.

	* org-docbook.el (org-export-docbook-format-image): Do some
	formatting on captions.

	* org-latex.el (org-export-latex-tables, org-export-latex-links):
	Do some formatting on captions.

	* org-html.el (org-export-html-format-image)
	(org-format-org-table-html): Do some formatting on captions.

2010-04-10  Dan Davison  <davison@stats.ox.ac.uk>

	* org.el (org-hidden-keywords): New customizable variable. This is
	a list of symbols specifying which of the special keywords #+DATE,
	#+AUTHOR, #+EMAIL and #+TITLE should be hidden by font lock.
	(org-fontify-meta-lines-and-blocks): Changes to font-lock code
	implementing new faces and hiding behaviour.

	* org-faces.el (org-document-title): New face for #+TITLE lines
	(org-document-info): New face for #+DATE, #+AUTHOR, #+EMAIL lines
	(org-document-info-keyword): New face for #+DATE, #+AUTHOR, #+EMAIL keywords

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-publish.el (org-publish-sanitize-plist): New function to
	rename "index" properties to "sitemap".  Do this renaming
	globally.
	(org-publish-with-aux-preprocess-maybe): New macro.
	(org-publish-org-to-pdf, org-publish-org-to-html): Use the new
	macro.
	(org-publish-aux-preprocess)
	(org-publish-index-generate-theindex.inc): New function.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-table.el (org-table-align): Interpret <N> at fixed width,
	not as maximum width.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-exp.el (org-export-author-info, org-export-email-info): Fix
	docstrings.

	* org-beamer.el (org-beamer-select-environment): Renamed from
	`org-beamer-set-environment-tag'.  Improve docstring.

	* org-freemind.el (org-freemind-write-mm-buffer): Fix another
	problem with odd levels.

	* org-ascii.el (org-export-as-ascii): Export email only if the
	author wants it.

	* org-docbook.el (org-export-as-docbook): Export email only if the
	author wants it.

	* org-html.el (org-export-as-html): Export email only if the
	author wants it.

	* org-exp.el (org-export-email-info): New option.
	(org-export-plist-vars): Add entry for `org-export-email'.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-table.el (org-table-goto-line): Fix typo.

2010-04-10  Mikael Fornius  <mfo@abc.se>

	* org.el (org-agenda-files): Typo.
	(org-read-agenda-file-list): Add optional argument to help
	`org-store-new-agenda-file-list' to remember un-expanded file
	names.  Expand file names relative to `org-directory'.
	(org-store-new-agenda-file-list): Keep un-expanded file names when
	saving, if available.
	(org-agenda-files): Update documentation.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-ascii.el (org-export-as-ascii): Catch the case of exporting
	a buffer with no file name attached.

	* org.el (org-log-refile): New option.
	(org-log-note-headings): Add a heading for refiling.
	(org-startup-options): Add keywords for logging of the refile
	action.
	(org-refile): Add logging action.
	(org-add-log-note): Allow for refiling action.

	* org-agenda.el (org-agenda-bulk-action): Make sure
	`org-log-refile' is not `note' during a bulk action.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-map-dblocks): Use save-excursion to remember the
	position.

	* org-attach.el (org-attach-commit): Remove dependence on xargs.
	(org-attach-delete-one): Commit after deleting a file.

	* org-latex.el (org-export-latex-fontify): Do not mistake table.el
	borders for strike-through emphasis.

	* org-freemind.el (org-freemind-write-mm-buffer): Simplify the
	handling of odd levels.

	* org-agenda.el (org-agenda-todo-ignore-deadlines): Document `past'
	and `future' values.
	(org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item):
	Handle `past' and `future' values.

	* org.el (org-read-agenda-file-list): Interpret file names
	relative to org-directory and allow environment variables and
	"~".

	* org-latex.el (org-export-latex-special-chars): Allow a
	parenthesis before an exponent or subscript.

2010-04-10  Dan Davison  <davison@stats.ox.ac.uk>

	* org-src.el (org-edit-src-exit): When returning from code edit
	buffer, if code block is hidden, leave point at start of
	#+begin_src line

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-insert-heading): Do not remove all spaces if the
	headline is empty.

	* org-indent.el (org-indent): Fix group name.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-table.el (org-table-goto-column): Fix forcing a non-existing
	column.
	(org-table-get, org-table-put, org-table-goto-line)
	(org-table-current-line): New functions.

2010-04-10  Jan Böcker  <jan.boecker@jboecker.de>

	* org.el (org-open-file): Allow regular expressions in
	org-file-apps to capture link parameters using groups.  In a
	command string to be executed, the parameters can be referenced
	using %1, %2, etc.  Lisp forms can access them using
	(match-string n link).
	(org-apps-regexp-alist): Adopt the created regexp, as this is now
	matched against a file: link instead of the file name.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-crypt.el (org-reveal-start-hook): Add a decryption function
	to this hook.
	(org-decrypt-entries, org-encrypt-entries, org-decrypt-entry): Add
	docstrings.

	* org.el (org-point-at-end-of-empty-headline)
	(org-level-increment, org-get-previous-line-level): New function.
	(org-cycle-level): Rewritten to be independent of when this
	function is called.
	(org-in-regexps-block-p): New function.
	(org-reveal-start-hook): New hook.
	(org-reveal): Run new hook.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-latex.el (org-export-latex-keywords): Start a new paragraph
	after time keywords, do not add "\newline".

	* org-html.el (org-export-as-html): Avoid double # in href.

	* org.el (org-refile-get-location): Catch an invalid target
	specification.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-agenda.el (org-agenda-add-entry-to-org-agenda-diary-file):
	Make sure the behavior regarding to extracting time is
	consistent.

2010-04-10  Stephen Eglen  <stephen@gnu.org>

	* org-agenda.el (org-agenda-insert-diary-extract-time): New
	variable.
	(org-agenda-add-entry-to-org-agenda-diary-file): Use this new
	variable rather than `org-agenda-search-headline-for-time'.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-list.el (org-fix-bullet-type): Improve cursor positioning.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-adaptive-fill-regexp-backup): New variable.
	(org-set-autofill-regexps): Store a backup of
	`adaptive-fill-regexp'.
	(org-adaptive-fill-function): Fix filling of comments and ordered
	lists. If there is no other match, till try adaptive fill.

2010-04-10  John Wiegley  <jwiegley@gmail.com>

	* org-agenda.el (org-agenda-include-deadlines): Added new
	customization variable to determine whether unscheduled tasks
	should appear in the agenda solely because of their deadline.
	Default to true, which was the previous behavior (it just wasn't
	configurable).
	(org-agenda-mode-map, org-agenda-view-mode-dispatch): Bind ! in
	the agenda to show/hide deadline tasks.
	(org-agenda-menu): Added menu option for show/hide deadlines.
	(org-agenda-list): Make the agenda list sensitive to the value of
	`org-agenda-include-deadlines'.
	(org-agenda-toggle-deadlines): New function to toggle the value of
	`org-agenda-include-deadlines' and repaint the modeline
	indicators.
	(org-agenda-set-mode-name): Show "Deadlines" in the agenda
	modeline if deadline tasks are being displayed.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-table.el (org-table-eval-formula): Replace $# and @# by
	current column and row number.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-set-property, org-delete-property): Go back to
	prompting for the property.

	* org-latex.el (org-export-latex-make-header): Fully process
	author line.
	(org-export-latex-fontify-headline): Allow several arguments, not
	just one.
	(org-export-latex-fix-inputenc): Catch the error when
	`latexenc-coding-system-to-inputenc' is not defined.

	* org-agenda.el (org-agenda-skip-if-todo): New function.
	(org-agenda-skip-if): Add conditions for TODO keywords.
	(org-agenda-skip-if): Document the new todo conditions.

2010-04-10  Mikael Fornius  <mfo@abc.se>

	* org.el (org-at-property-p): Check if we are inside a property
	drawer not just any drawer.
	(org-set-property, org-delete-property): When cursor is on a
	property key value pair do not prompt for property name instead
	use name at cursor.
	(org-ctrl-c-ctrl-c): Still do org-property-action when cursor is
	on the first line of a property drawer.
	(org-property-end-re): Spell check.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-exp.el (org-export-attach-captions-and-attributes): Add the
	properties to the entire table, in case the first line is
	removed.

	* org-archive.el (org-archive-reversed-order): New option.
	(org-archive-subtree, org-archive-to-archive-sibling): Use the new
	option `org-archive-reversed-order'.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-agenda.el (org-agenda-entry-types): New variable.
	(org-agenda-list): Use `org-agenda-entry-types'.
	(org-agenda-custom-commands-local-options): Support for setting
	`org-agenda-entry-types' as an option.
	(org-diary): Shift some documentation from here to the variable
	`org-agenda-entry-types'.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-latex.el (org-export-latex-make-header): Apply macros in
	author field.

	* org-clock.el (org-clocking-buffer, org-clocking-p): New function.
	(org-clock-select-task, org-clock-notify-once-if-expired)
	(org-clock-in, org-clock-out, org-clock-cancel, org-clock-goto)
	(org-clock-out-if-current, org-clock-save): Use the new functions.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-docbook.el (org-export-as-docbook): Remove unnecessary
	newline.
	(org-export-as-docbook): Remove unnecessary newline.
	(org-export-as-docbook): Fix problem with double footnote
	reference in one place.

	* org-exp.el (org-export-format-source-code-or-example): Remove
	unnecessary newline.

	* org.el (org-deadline, org-schedule): Allow rescheduling entries
	with repeaters.

	* org-table.el (org-table-convert-refs-to-rc): Better way to catch
	function calls that look like references.

	* org.el (org-open-at-point): Get link abbreviations from
	reference buffer.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-table.el (org-table-convert-refs-to-rc): Do not read arctan2
	as a reference.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-link-unescape): Solve issue with lower-case escapes.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-latex.el (org-export-latex-classes): Add
	\usepackage{latexsym} to all classes.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-html.el (org-export-as-html): Do not allow protected lines
	into the table of contents.

	* org-latex.el (org-export-latex-special-chars): Find subsequent
	occurrences of special characters.
	(org-export-latex-tables): Do not convert table-like stuff that is
	protected.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-list.el (org-toggle-checkbox): No errors when updating
	checkbox count fails because there is no heading.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-clock.el (org-clock-report-include-clocking-task): New
	option.
	(org-clock-sum): Add the current clocking task.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-cycle): Print a message when in a table.el table.
	(org-edit-special): Recognize the table.el context.
	(org-ctrl-c-ctrl-c): Print a message when in a table.el table.

	* org-src.el (org-at-table.el-p): Declare.
	(org-edit-src-code): Handle a special case for table.el editing.
	(org-edit-src-find-region-and-lang): Recognize the table.el
	context.

	* org-latex.el (org-export-latex-tables): Convert table.el
	tables.
	(org-export-latex-convert-table.el-table): New function.

	* org-html.el (org-html-expand): Fix table.el export.

	* org-latex.el (org-export-latex-preprocess): Protect footnotes in
	headings.

	* org-id.el (org-id-find-id-file): Fix bug when there is no hash
	table for the id locations.

	* org.el (org-read-date-analyze): Match American-style dates, like
	5/30 or 5/13/7.  Make sure cal-iso.el is loaded.  Don't force he
	current year when reading ISO and American dates.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-face-from-face-or-color): New function.
	(org-get-todo-face, org-font-lock-add-priority-faces)
	(org-get-tag-face): Use `org-face-from-face-or-color'.

	* org-faces.el (org-todo-keyword-faces, org-priority-faces): Allow
	simple colors as values.
	(org-faces-easy-properties): New option.

	* org-agenda.el (org-agenda-set-mode-name): Show if the agenda is
	restricted, as an agenda mode.
	(org-agenda-fontify-priorities): Allow simple colors as values.

2010-04-10  Bastien Guerry  <bzg@altern.org>

	* org-timer.el (org-timer-current-timer): Renamed from
	`org-timer-last-timer'.
	(org-timer-timer1, org-timer-timer2, org-timer-timer3): Removed.
	(org-timer-cancel-timer, org-timer-show-remaining-time)
	(org-timer-set-timer): Update to use only one timer.

	* org.el (org-set-property): Remove useless space in the prompt.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-html.el (org-export-html-style-default): Add a default style
	for textareas.

	* org-exp.el (org-export-format-source-code-or-example): Fix
	textarea tag.

2010-04-10  Bastien Guerry  <bzg@altern.org>

	* org-clock.el (org-clock-current-task): New variable to store
	last clocked in task.
	(org-clock-set-current, org-clock-delete-current): New functions.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-remember.el (org-remember-apply-template): Extend comment.
	(org-remember-handler): Implement clock sibling filing.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-publish.el (org-publish-all, org-publish-current-file)
	(org-publish-current-project): When called with prefix argument
	FORCE, also rebuild the validation file list.

	* org-latex.el (org-export-latex-preprocess): Protect footnotes in
	section headings.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-html.el (org-export-as-html-and-open): Kill product buffer
	if the user wants that.

	* org-latex.el (org-export-as-pdf-and-open): Kill product buffer
	if the user wants that.

	* org-exp.el (org-export-kill-product-buffer-when-displayed): New
	option.

	* org-agenda.el (org-batch-agenda-csv): Use the time property
	instead of the `time-of-day' property.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-timer.el (org-timer-start-hook, org-timer-stop-hook)
	(org-timer-pause-hook, org-timer-set-hook)
	(org-timer-cancel-hook): New hooks.
	(org-timer-start): Run `org-timer-start-hook'.
	(org-timer-pause-or-continue): Run `org-timer-pause-hook'.
	(org-timer-stop): Run `org-timer-stop-hook'.
	(org-timer-cancel-timers): Run `org-timer-cancel-hook'.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-reveal): Double prefix arg shows the subtree of the
	parent.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-agenda.el (org-search-view): Fix bug with searching full
	words in headlines in search view.
	(org-agenda-skip-deadline-prewarning-if-scheduled): New option.
	(org-agenda-get-deadlines): Suppress pre-warning if the entry is
	scheduled (if the user configures it so.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-hide-archived-subtrees): Don't jump to end of
	subtree if the match was not in a headline.
	(org-inside-latex-macro-p): Allow more complex arguments.
	(org-emphasize): Protect against use at end of buffer.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-agenda.el (org-agenda-align-tags): Avoid side effects on
	text properties.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-agenda.el (org-agenda-todo-ignore-scheduled): More allowed
	values.
	(org-agenda-todo-ignore-scheduled)
	(org-agenda-todo-ignore-deadlines): More control with different
	allowed values.
	(org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item):
	Honor the new option settings.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-get-location): Make sure the selection buffer is
	shown in the current frame.

	* org-ascii.el (org-export-ascii-table-widen-columns): New
	option.
	(org-export-ascii-preprocess): Realign tables to remove narrowing
	if `org-export-ascii-table-widen-columns' is set.

	* org-table.el (org-table-do-narrow): New variable.
	(org-table-align): Narrow only if `org-table-do-narrow' is t.

	* org.el (org-deadline, org-schedule): Allow updating if the
	relevant time stamp does not have a repeater, i.e. do not require
	that no time stamp has a repeater.

	* org-agenda.el (org-agenda-align-tags): Don't add a face to the
	new white space before the tags.

	* org-latex.el (org-export-as-latex): Do nit require the buffer to
	be visiting a file when only exporting to a buffer or string.
	(org-export-latex-fix-inputenc): Only save the buffer is there is
	a file name attached to it.

2010-04-10  Dan Davison  <davison@stats.ox.ac.uk>

	* org-src.el (org-edit-src-exit): Widen before exiting edit buffers

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-fontify-meta-lines-and-blocks): Honor
	`org-fontify-quote-and-verse-blocks'.

	* org-faces.el (org-fontify-quote-and-verse-blocks): New option.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-open-at-point): Also check for text property
	org-linked-text before offering collected links.

2010-04-10  Stephen Eglen  <stephen@gnu.org>

	* org-agenda.el (org-agenda-add-entry-to-org-agenda-diary-file):
	Optionally extract time specification from text and add to the
	timestamp.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-exp.el (org-html-entities): Fix typo.

	* org-latex.el (org-export-latex-make-header): Use \providecommand
	to make sure the \alert macro is defined.

	* org.el (org-format-latex-signal-error)
	(org-create-formula-image): Use `org-format-latex-signal-error'.

2010-04-10  Stephen Eglen  <stephen@gnu.org>

	* org.el (org-store-link): For dired buffers, use
	default-directory as link name if dired-get-filename returns
	nil.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-exp.el (org-export-concatenate-multiline-links): The for
	protectedness at beginning of match.

	* org-latex.el (org-export-latex-fix-inputenc): Never leave the
	AUTO as a coding system, instead default to utf8.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-block-todo-from-children-or-siblings-or-parent)
	(org-block-todo-from-checkboxes): Respect the local variable
	value when deciding if blocking should be active.

	* org-latex.el (org-export-latex-make-header): Define the align
	macro if it is not yet defined.

	* org-agenda.el (org-agenda-insert-diary-make-new-entry): Call
	`org-insert-heading' with the INVISIBLE-OK argument.

	* org-mac-message.el (org-mac-message-insert-flagged): Call
	`org-insert-heading' with the INVISIBLE-OK argument.

	* org.el (org-insert-heading):  New argument INVISIBLE-OK.

	* org-agenda.el (org-agenda-view-mode-dispatch): Improve the
	prompt message.

	* org-html.el (org-html-level-start): Use the
	`html-container-class' text property to set an additional class
	for an outline container.

	* org-exp.el (org-export-remember-html-container-classes): New
	function.
	(org-export-preprocess-string): Call
	`org-export-remember-html-container-classes'.

	* org.el (org-cycle): Mention level cycling in the docstring.
	(org-default-properties): Add new property HTML_CONTAINER_CLASS.

	* org-remember.el (org-remember-apply-template): Do file insertion
	first.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-habit.el (org-habit-insert-consistency-graphs): Fix a
	problem with mis-aligned graphs when showing habits.

2010-04-10  Mikael Fornius  <mfo@abc.se>

	* org.el (org-assign-fast-keys): Prefer keys used in keyword name
	when assigning. Begin using numerical characters when all in name
	is used up. This is to spare alphanumeric characters for better
	match with other keywords.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-exp.el (org-export-preprocess-hook): Improve documentation.

	* org-latex.el (org-export-latex-preprocess): More consistent
	conversion and protection of the words LaTeX and TeX.
	(org-export-latex-fontify-headline, org-export-latex-preprocess):
	Allow angle brackets in commands, for beamer.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-clock.el (org-clock-in): Improve the look of the clock line
	by formatting links.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-latex.el (org-export-latex-classes): Use AUTO as the place
	holder string for the coding system.  And improve the
	documentation.
	(org-export-latex-fix-inputenc): Only modify the coding system if
	it is given by the placeholder AUTO.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-clock.el (org-task-overrun-text): New option.
	(org-task-overrun, org-clock-update-period): New variables.
	(org-clock-get-clock-string, org-clock-update-mode-line): Mark
	overrun clock.
	(org-clock-notify-once-if-expired): Check if clock is overrun.

	* org-faces.el: New face `org-mode-line-clock-overrun'.

2010-04-10  Jan Böcker  <jan.boecker@jboecker.de>

	* org.el (org-narrow-to-subtree): Position the end of the narrowed
	region before the line with the next heading, to prevent the user
	from prepending text to the next headline.

2010-04-10  Stephen Eglen  <stephen@gnu.org>

	* org-agenda.el (org-get-time-of-day): Use
	org-agenda-time-leading-zero to allow leading zero (rather than
	space) for times.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-agenda.el (org-agenda-diary-entry-in-org-file): Make sure
	org-datetree.el is loaded.

	* org-datetree.el: autoload `org-datetree-find-day-create'

	* org-latex.el (org-export-latex-hyperref-format): New option.
	(org-export-latex-links): Use `org-export-latex-hyperref-format'.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-ctags.el (org-ctags-enable): Change order of functions.
	(org-ctags-create-tags): Add wildcard to file name expansion.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-entry-properties): Fix some important bugs.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-link-unescape, org-link-escape): Only use hexlify if
	the table is not explicitly given.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-clock.el (org-clock-out-when-done): Allow a list of keywords
	as value.
	(org-clock-out-if-current): Work with the new list value of
	`org-clock-out-when-done'.
	(org-clock-out, org-clock-out-if-current): Avoid circular logic
	between clocking out and state changes.

	* org-ctags.el (org-ctags-path-to-ctags): Better system-type test.

	* org-latex.el (org-export-latex-treat-backslash-char): Do not by
	accident protect a character that is before a backslash.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-agenda.el (org-diary-class): Use
	`org-order-calendar-date-args'.

	* org.el (org-order-calendar-date-args): New function.

	* org-exp.el (org-export-target-internal-links): Check for
	protectedness after the first bracket.

	* org.el (org-entry-properties): Don't match wrong-case TODO
	keywords.

	* org-agenda.el (org-agenda-schedule, org-agenda-deadline):
	Document that ARG is passed through to remove the date.
	(org-agenda-bulk-action): Accept prefix arg and pass it on.  Do
	not read a date when the user has given a `C-u' prefix.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-agenda.el (org-agenda-fix-displayed-tags): Fix bug when all
	tags are hidden.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-latex.el (org-export-latex-fix-inputenc): New function.
	(org-export-latex-inputenc-alist): New option.

	* org-exp.el (org-export): New key SPC to publish enclosing
	subtree.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-indent.el (org-indent-add-properties): Catch case when there
	is no headline in the buffer.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-exp.el (org-html-entities): Add checkmark symbol.

	* org-ascii.el (org-export-ascii-preprocess): Protect targets in
	verbatim code for ASCII export.

	* org.el (org-update-statistics-cookies): Also see checkboxes in
	ordered lists.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-agenda.el (org-agenda-view-mode-dispatch): Define the `L'
	key.

	* org-beamer.el (org-beamer-amend-header): Change the location
	where `org-beamer-header-extra' is inserted.

	* org.el (org-compute-latex-and-specials-regexp): Don't do BIND
	just for computing this regexp.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-beamer.el (org-beamer-frame-default-options): New option.
	(org-beamer-sectioning): Use default options if the user does not
	have defined any.
	(org-beamer-fix-toc): Put a frame around the table of contents.

	* org-exp.el (org-export-remove-comment-blocks-and-subtrees): Make
	sure case-folding works well when processing comment stuff.

	* org-latex.el (org-export-latex-after-save-hook): New hook.
	(org-export-as-latex): Run the new hook.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-beamer.el (org-beamer-environments-default): Add the note
	environments.
	(org-beamer-after-initial-vars): Allow several BEAMER_HEADER_EXTRA
	lines and collect and combine the content.
	(org-beamer-after-initial-vars): Check for note tags and make sure
	they will be seen like a property.

	* org.el (org-offer-links-in-entry): Fix bug when there is a
	single link.

	* org-exp.el (org-export): Make sure the mark is activated, also
	when `transient-mark-mode' is off.

	* org-agenda.el (org-agenda-search-view-always-boolean): New option.
	(org-agenda-search-view-search-words-only): Obsolete variable, is
	now an alias for `org-agenda-search-view-always-boolean'.
	(org-agenda-search-view-force-full-words): New option.
	(org-search-view): Improve docstring, and implement a better logic
	for Boolean and phrase searches.
	(org-agenda-last-search-view-search-was-boolean): New variable.
	(org-agenda-manipulate-query): Consider the type of the last
	search when modifying the search string.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-latex.el (org-export-as-latex): Do the first letbind in the
	right moment.

	* org-agenda.el (org-get-entries-from-diary): Add the new face to
	these entries.

	* org-faces.el (org-agenda-diary): New face.

	* org.el (org-make-link-regexps): Allow regexp-special characters
	in link types.
	(org-open-file): When in-emacs is `system', also force system
	opening, like when the value was `(16)'.
	(org-update-statistics-cookies): Handle entries without children.

	* org-exp.el
	(org-export-preprocess-before-normalizing-links-hook): New hook.
	(org-export-preprocess-string): Run the new hook.

	* org.el (org-offer-links-in-entry): Make RET open all links.

	* org-html.el (org-export-as-html): Remove any leftover display
	properties in the html file.

	* org-wl.el (org-wl-store-link): Work-around for format bug with
	text properties.

	* org-habit.el (org-habit-insert-consistency-graphs): Turn off
	invisibility while adding the graphs.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-remember.el (org-select-remember-template): Use C letter to
	customize remember templates.

	* org-agenda.el (org-agenda-bulk-mark, org-agenda-bulk-unmark):
	Move cursor to next visible line.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-beamer.el (org-beamer-sectioning): Leave columns environment
	by specifying 0 or 1 for column width.
	(org-beamer-column-widths): Make 0 stand for 0.0.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-exp.el (org-export-mark-radio-links): Don't match inside
	<<target>>.

	* org.el (org-format-latex-header-extra): New variable.
	(org-format-latex): Set org-format-latex-header-extra from
	in-buffer stuff.
	(org-format-latex): Add org-format-latex-header-extra to the
	variables on which image creation depends.
	(org-create-formula-image): Add the header stuff from in-buffer
	settings.
	(org-read-date-analyze): Base the analysis for future preference
	on NOW, not on the default date.

	* org-inlinetask.el (org-inlinetask-export-handler): Add CSS class
	for TODO keyword in inline tasks.

	* org.el (org-log-note-headings): New headings for removing
	deadline or scheduling date.
	(org-deadline, org-schedule): Arrange for logging when removing a
	date.
	(org-add-log-note): Handle deadline and scheduling removal.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-exp.el (org-export-visible): Add LaTeX/pdf export.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-agenda.el (org-diary-class): New function.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-latex.el (org-export-latex-preprocess): Do process the text
	of a radio target.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-entry-properties): Add TIMESTAMP properties back
	in.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-all-time-keywords): New variable.
	(org-set-regexps-and-options): Set `org-all-time-keywords'.
	(org-entry-blocked-p): New function.
	(org-special-properties): Add BLOCKED as a new special property.
	(org-entry-properties): New optional argument SPECIFIC, only parse
	for this property when it is specified.
	(org-entry-get): Pass a SPECIFIC argument to
	`org-entry-properties'.

	* org-latex.el (org-export-as-latex): Preprocess TEXT as well.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-latex.el (org-export-latex-tables): No forced line end if
	there is no caption.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-exp.el (org-html-entities): Add Euro symbols from Marvosym
	package.

	* org-latex.el (org-export-latex-tables): Only add a caption when
	macro in in longtable environments if one has been defined.

	* org-html.el (org-export-as-html): Only take title from buffer if
	not exporting body-only.

	* org-latex.el (org-export-latex-preprocess): Better version of
	the regular expression for protecting LaTeX macros.
	(org-export-latex-preprocess): Start searching for macros to
	protect from beginning of buffer.

	* org-exp.el (org-export-target-internal-links): Check for
	protectedness earlier in the string.

	* org-agenda.el (org-agenda-highlight-todo): Match TODO keywords
	case sensitively.

	* org-id.el (org-id-store-link): Match TODO keywords case
	sensitively.

	* org.el (org-heading-components, org-get-outline-path)
	(org-display-outline-path): Match TODO keywords case sensitively.

	* org-latex.el (org-export-as-latex): Ignore read-only
	properties.

	* org-exp.el (org-export-preprocess-string): Remove any
	`read-only' properties.

	* org-agenda.el (org-agenda-inactive-leader): New option.
	(org-agenda-get-timestamps): Use `org-agenda-inactive-leader'.
	(org-tags-view): Prompt for matcher if MATCH is an empty string.
	(org-todo-list): Prompt for matcher if ARG is an empty string.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-open-link-functions): New hook.
	(org-open-at-point): Run `org-open-link-functions'.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-agenda.el (org-agenda-date-prompt): Allow inactive time
	stamps as well.

	* org.el (org-inhibit-startup-visibility-stuff): New variable.
	(org-mode): Don't do startup visibility if inhibited.
	(org-outline-overlay-data, org-set-outline-overlay-data): New
	functions.
	(org-save-outline-visibility): New macro.
	(org-log-note-headings): Document that one should not change the
	`state' note format.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-make-link-regexps): Capture link path into a group.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-beamer.el (org-beamer-after-initial-vars): Do not overwrite
	the options plist.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.el (org-startup-with-beamer-mode): New option.
	(org-property-changed-functions)
	(org-property-allowed-value-functions): New hooks.
	(org-entry-put, org-property-get-allowed-values): Run the new
	hooks.
	(org-property-next-allowed-value): Run the new hooks.

	* org-exp.el (org-export-select-backend-specific-text): Add the
	special beamer tags.

	* org-beamer.el
	(org-export-preprocess-before-selecting-backend-code-hook): New
	file.

	* org-latex.el (org-export-latex-after-initial-vars-hook): New hook.
	(org-export-as-latex): Run
	`org-export-latex-after-initial-vars-hook'.
	(org-export-latex-format-toc-function)
	(org-export-latex-make-header): Call
	`org-export-latex-format-toc-function'.

	* org.el (org-fill-template): Make template searches case sensitive.

	* org-exp.el (org-export): Use "1" as a sign to export only the
	subtree.

	* org-colview-xemacs.el (org-columns-edit-value): Use
	org-unrestricted property.

	* org-colview.el (org-columns-edit-value):  Use
	org-unrestricted property.

	* org.el (org-compute-property-at-point): Set org-unrestricted
	text property if the list contains ":ETC".
	(org-insert-property-drawer):  Use
	org-unrestricted property.

	* org-exp.el
	(org-export-preprocess-before-selecting-backend-code-hook): New hook.
	(org-export-preprocess-string): Run
	`org-export-preprocess-before-selecting-backend-code-hook'.

	* org-xoxo.el (org-export-as-xoxo): Run `org-export-first-hook'.

	* org-latex.el (org-export-region-as-latex): Run
	`org-export-first-hook'.

	* org-html.el (org-export-as-html): Run `org-export-first-hook'.

	* org-docbook.el (org-export-as-docbook): Run
	`org-export-first-hook'.

	* org-ascii.el (org-export-as-ascii): Run `org-export-first-hook'.

	* org-exp.el (org-export-first-hook): New hook.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-list.el (org-previous-item): Exit at the beginning of the
	buffer.

	* org-id.el (org-id-locations-save): Only write the id locations
	if any are defined.

	* org-archive.el (org-archive-all-done): Make this work in a file
	with org-odd-levels-only set.

	* org.el (org-get-refile-targets): Catch the case when a buffer
	has no file.

	* org-latex.el (org-export-as-latex): Cleanup forced line ends
	where they are not needed.
	(org-export-latex-subcontent): Remove unnecessary newlines.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-latex.el (org-export-latex-make-header): Remove \obeylines.
	(org-export-latex-fontify): Fix regexp bug that takes special
	care of protecting the right boundary characters in emphasis
	matches.
	(org-export-latex-preprocess): Allow multiple arguments to latex
	macros.

	* org.el (org-make-link-regexps): Use John Gruber's regexp for
	urls.

	* org-macs.el (org-re): Interpret :punct: in regexps.

	* org-exp.el (org-export-replace-src-segments-and-examples): Also
	take the final newline after the END line.

	* org.el (org-clean-visibility-after-subtree-move): Only fix
	entries that are not entirely invisible already.
	(org-insert-link): Respect org-link-file-path-type for
	"docview:" links in addition to "file:" links.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-exp.el (org-export-format-source-code-or-example): Avoid
	additional extra white lines in LaTeX.

	* org-list.el (org-list-parse-list): Leave empty lines after the
	list, don't consider them as part of the list.

	* org-mobile.el (org-mobile-sumo-agenda-command): Allow tagstodo
	searches.

	* org-clock.el (org-clock-select-task): Convert integer to
	character for XEmacs.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-clock.el (org-clock-resolve): Make reading a char XEmacs
	compatible.

2010-04-10  Tassilo Horn  <tassilo@member.fsf.org>

	* org.el (org-complete-tags-always-offer-all-agenda-tags): New
	variable.
	(org-set-tags): Use it.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-list.el (org-empty-line-terminates-plain-lists): Update
	docstring.

	* org.el (org-format-latex): Fix link creation for processed latex
	snippets.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-footnote.el (org-footnote-normalize): Protect replacement
	text.

	* org.el (org-inside-latex-macro-p): Save match data.

2010-04-10  Jan Böcker  <jan.boecker@jboecker.de>

	* org-docview.el: New file.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-latex.el (org-export-latex-class-options): New variable.
	(org-export-latex-set-initial-vars): Use the class options.

	* org.el (org-forward-same-level): Stop at headings that start
	with an invisible character.
	(org-additional-option-like-keywords): Add LaTeX_CLASS_OPTIONS.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-footnote.el (org-footnote-normalize): Don't take optional
	arguments in LaTeX macros as footnotes.

	* org.el (org-inside-latex-macro-p): New function.

	* org-latex.el (org-latex-to-pdf-process): Change customization
	group to `org-export-pdf'.

	* org-agenda.el (org-agenda-get-blocks): Look at time string also
	on days after the first one.

	* org.el (org-insert-heading): Also check for item before assuming
	before-first-heading condition.

	* org-latex.el (org-latex-to-pdf-process): Fix typo in group tag.
	(org-export-pdf-logfiles): New option.
	(org-export-as-pdf): Use `org-export-pdf-logfiles'.
	(org-export-pdf-logfiles): Fix customization type.

	* org.el (org-insert-link): Improve error message when there is no
	default link to select with RET.

	* org-agenda.el (org-agenda-filter-by-tag): Use char argument from
	parameter list.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-latex.el (org-export-latex-parse-global)
	(org-export-latex-parse-content)
	(org-export-latex-parse-subcontent): Use
	`org-re-search-forward-unprotected'.
	(org-export-as-pdf): Remove log files produced by XeTeX.

	* org-macs.el (org-re-search-forward-unprotected): New function.

2010-04-10  James TD Smith  <ahktenzero@mohorovi.cc>

	* org-colview.el (org-agenda-colview-summarize): Sort out some
	confusion between properties and titles, which resulted in
	agenda summaries not working if a title was set for a column.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-mobile.el (org-mobile-agendas): New option.
	(org-mobile-sumo-agenda-command): Select the right agendas.

	* org-latex.el (org-export-latex-format-image): Preserve the
	original-indentation property.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-clock.el (org-clock-insert-selection-line): Catch error when
	an old tasks no longer exists.

	* org-latex.el (org-export-as-pdf): Remove also the .idx file.
	(org-export-as-pdf): Don't remove the old PDF file before making
	the new one.

	* org-mouse.el (org-mouse-end-headline, org-mouse-insert-item)
	(org-mouse-context-menu): Use `org-looking-back'.

	* org.el (org-cycle-level): Use `org-looking-back'.

	* org-list.el (org-cycle-item-indentation): Use
	`org-looking-back'.

	* org-compat.el (org-looking-back): New function.

	* org.el (org-insert-heading): Catch before-first-headline when
	inserting a headline.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-latex.el (org-export-latex-format-image): Indent figure
	environment, so that it does not interrupt plain list.

	* org.el (org-open-at-point): Allow long link descriptions.

2010-04-10  Carsten Dominik  <carsten.dominik@gmail.com>

	* org-html.el (org-export-as-html): Remove empty lines at the
	beginning of the exported text.



2010-04-15  Carsten Dominik  <carsten.dominik@gmail.com>

	* org.texi (LaTeX and PDF export): Add a footnote about xetex.
	(LaTeX/PDF export commands): Section renamed and
	moved.
	(Sectioning structure): Update.
	(References): New use case for field coordinates.
	(The export dispatcher): Renamed from ASCII export.
	(Setting up the staging area): Document the availability of
	encryption for MobileOrg.
	(Images and tables): Document how to reference labels.
	(Index entries): New section.
	(Generating an index): New section.
	(Column width and alignment): Document that <N> now
	means a fixed width, not a maximum width.
	(Publishing options): Document the :email option.
	(Beamer class export): Fix bug in the BEAMER example.
	(Refiling notes): Document refile logging.
	(In-buffer settings): Document refile logging keywords.
	(Drawers): Document `C-c C-z' command.
	(Agenda commands): Mention the alternative key `C-c C-z'.
	(Special properties): Document the BLOCKED property.
	(The spreadsheet): Mention the formula editor.
	(References): Document field coordinates.
	(Publishing action): Correct the documentation for the
	publishing function.
	(The date/time prompt): Document that we accept dates
	like month/day/year.
	(Cooperation): Document the changes in table.el support.
	(Faces for TODO keywords, Faces for TODO keywords)
	(Priorities): Document the easy colors.
	(Visibility cycling): Document the new double prefix
	arg for `org-reveal'.
	(Cooperation): Remember.el is part of Emacs.
	(Clean view): Mention that `wrap-prefix' is also set by
	org-indent-mode.
	(Agenda commands): Add information about prefix args to
	scheduling and deadline commands.
	(Search view): Point to the docstring of
	`org-search-view' for more details.
	(Agenda commands): Document that `>' prompts for a
	date.
	(Setting tags): Document variable
	org-complete-tags-always-offer-all-agenda-tags.
	(Column attributes): Cross-reference special
	properties.
This commit is contained in:
Carsten Dominik 2010-04-15 12:11:52 +02:00
parent 0f8a85ccd9
commit ed21c5c84c
57 changed files with 7314 additions and 1896 deletions

View file

@ -1,3 +1,50 @@
2010-04-15 Carsten Dominik <carsten.dominik@gmail.com>
* org.texi (LaTeX and PDF export): Add a footnote about xetex.
(LaTeX/PDF export commands): Section renamed and
moved.
(Sectioning structure): Update.
(References): New use case for field coordinates.
(The export dispatcher): Renamed from ASCII export.
(Setting up the staging area): Document the availability of
encryption for MobileOrg.
(Images and tables): Document how to reference labels.
(Index entries): New section.
(Generating an index): New section.
(Column width and alignment): Document that <N> now
means a fixed width, not a maximum width.
(Publishing options): Document the :email option.
(Beamer class export): Fix bug in the BEAMER example.
(Refiling notes): Document refile logging.
(In-buffer settings): Document refile logging keywords.
(Drawers): Document `C-c C-z' command.
(Agenda commands): Mention the alternative key `C-c C-z'.
(Special properties): Document the BLOCKED property.
(The spreadsheet): Mention the formula editor.
(References): Document field coordinates.
(Publishing action): Correct the documentation for the
publishing function.
(The date/time prompt): Document that we accept dates
like month/day/year.
(Cooperation): Document the changes in table.el support.
(Faces for TODO keywords, Faces for TODO keywords)
(Priorities): Document the easy colors.
(Visibility cycling): Document the new double prefix
arg for `org-reveal'.
(Cooperation): Remember.el is part of Emacs.
(Clean view): Mention that `wrap-prefix' is also set by
org-indent-mode.
(Agenda commands): Add information about prefix args to
scheduling and deadline commands.
(Search view): Point to the docstring of
`org-search-view' for more details.
(Agenda commands): Document that `>' prompts for a
date.
(Setting tags): Document variable
org-complete-tags-always-offer-all-agenda-tags.
(Column attributes): Cross-reference special
properties.
2010-04-10 Michael Albinus <michael.albinus@gmx.de>
Synchronize with Tramp repository.

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
% Reference Card for Org Mode
\def\orgversionnumber{6.33x}
\def\versionyear{2009} % latest update
\def\orgversionnumber{6.35i}
\def\versionyear{2010} % latest update
\def\year{2010} % latest copyright year
%**start of header
@ -11,10 +11,6 @@
% Specify how many you want here.
\columnsperpage=3
% Set letterpaper to 0 for A4 paper, 1 for letter (US) paper. Useful
% only when columnsperpage is 2 or 3.
\letterpaper=0
% PDF output layout. 0 for A4, 1 for letter (US), a `l' is added for
% a landscape layout.
\input pdflayout.sty
@ -22,7 +18,7 @@
% Nothing else needs to be changed below this line.
% Copyright (C) 1987, 1993, 1996, 1997, 2001, 2002, 2003, 2004, 2005,
% 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
% 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
% This file is part of GNU Emacs.
@ -279,12 +275,12 @@
\section{Getting Started}
%
\vskip -2mm
\beginexample%
(add-to-list 'auto-mode-alist '("\\\\.org\$" . org-mode))
(define-key global-map "\\C-cl" 'org-store-link)$^1$
(define-key global-map "\\C-ca" 'org-agenda)$^1$
\endexample
%\vskip -2mm
%\beginexample%
%(add-to-list 'auto-mode-alist '("\\\\.org\$" . org-mode))
%(define-key global-map "\\C-cl" 'org-store-link)$^1$
%(define-key global-map "\\C-ca" 'org-agenda)$^1$
%\endexample
%
\metax{To read the on-line documentation try}{M-x org-info}
@ -374,9 +370,9 @@ \section{Tables}
{\bf Regions}
\key{cut rectangular region}{C-c C-x C-w}
\key{copy rectangular region}{C-c C-x M-w}
\key{paste rectangular region}{C-c C-x C-y}
\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}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -40,7 +40,12 @@
:type '(choice
(const org-archive-subtree)
(const org-archive-to-archive-sibling)
(const org-archive-set-tag)))
(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.
@ -50,7 +55,7 @@ See `org-archive-to-archive-sibling' for more information."
:type 'string)
(defcustom org-archive-mark-done nil
"Non-nil means, mark entries as DONE when they are moved to the archive file.
"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
@ -60,7 +65,7 @@ use the first keyword in its list that means done."
(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.
"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
@ -273,7 +278,11 @@ this heading."
(end-of-line 0))
;; Make the subtree visible
(show-subtree)
(org-end-of-subtree t)
(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")))
@ -355,7 +364,9 @@ sibling does not exist, it will be created at the end of the subtree."
(beginning-of-line 0)
(org-toggle-tag org-archive-tag 'on))
(beginning-of-line 1)
(org-end-of-subtree t t)
(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)))
@ -389,7 +400,8 @@ When TAG is non-nil, don't move trees, but mark them with the ARCHIVE tag."
(progn
(setq re1 (concat "^" (regexp-quote
(make-string
(1+ (- (match-end 0) (match-beginning 0) 1))
(+ (- (match-end 0) (match-beginning 0) 1)
(if org-odd-levels-only 2 1))
?*))
" "))
(move-marker begm (point))

View file

@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -52,19 +52,34 @@ Org-mode file."
:type '(repeat character))
(defcustom org-export-ascii-links-to-notes t
"Non-nil means, convert links to notes before the next headline.
"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.
"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
@ -74,6 +89,41 @@ for column grouping."
(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.
@ -156,6 +206,7 @@ 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
@ -181,6 +232,11 @@ publishing directory."
(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
@ -219,8 +275,10 @@ publishing directory."
(and (not
(plist-get opt-plist :skip-before-1st-heading))
(org-export-grab-title-from-buffer))
(file-name-sans-extension
(file-name-nondirectory bfname))))
(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 "\\>"))
@ -287,7 +345,9 @@ publishing directory."
(if (and (or author email)
org-export-author-info)
(insert(concat (nth 1 lang-words) ": " (or author "")
(if email (concat " <" email ">") "")
(if (and org-export-email-info
email (string-match "\\S-" email))
(concat " <" email ">") "")
"\n")))
(cond
@ -482,18 +542,31 @@ publishing directory."
(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))))))
;; 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)))
(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)
(replace-match "\\1\\2")))
(org-if-unprotected-at (match-beginning 1)
(replace-match "\\1\\2"))))
(defun org-html-expand-for-ascii (line)
"Handle quoted HTML for ASCII export."
@ -503,6 +576,15 @@ publishing directory."
(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))

View file

@ -4,7 +4,7 @@
;; Author: John Wiegley <johnw@newartisans.com>
;; Keywords: org data task
;; Version: 6.33x
;; Version: 6.35i
;; This file is part of GNU Emacs.
;;
@ -92,7 +92,7 @@ ln create a hard link. Note that this is not supported
:type 'boolean)
(defcustom org-attach-allow-inheritance t
"Non-nil means, allow attachment directories be inherited."
"Non-nil means allow attachment directories be inherited."
:group 'org-attach
:type 'boolean)
@ -241,12 +241,17 @@ the ATTACH_DIR property) their own attachment directory."
"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)))
(if (file-exists-p (expand-file-name ".git" dir))
(shell-command
(concat "(cd " dir "; "
" git add .; "
" git ls-files --deleted -z | xargs -0 git rm; "
" git commit -m 'Synchronized attachments')")))))
(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."
@ -322,7 +327,8 @@ The attachment is created as an Emacs buffer."
(setq file (expand-file-name file attach-dir))
(unless (file-exists-p file)
(error "No such attachment: %s" file))
(delete-file file)))
(delete-file file)
(org-attach-commit)))
(defun org-attach-delete-all (&optional force)
"Delete all attachments from the current task.

View file

@ -7,7 +7,7 @@
;; Thomas Baumann <thomas dot baumann at ch dot tum dot de>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;

624
lisp/org/org-beamer.el Normal file
View file

@ -0,0 +1,624 @@
;;; org-beamer.el --- Beamer-specific LaTeX export for org-mode
;;
;; Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
;;
;; Version: 6.35i
;; 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.
(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 se 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 '(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 '(string :tag "Beamer column view format"))
(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 emite 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 excapes
%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 convenince) 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 cloase columns, go back to full width
(org-beamer-close-columns-maybe)
(when (setq ass (assoc "BEAMER_envargs" props))
(let (case-fold-search)
(when (string-match "C\\(\\[[^][]*\\]\\)" (cdr ass))
(setq columns-option (match-string 1 (cdr ass)))
(setcdr ass (replace-match "" t t (cdr ass))))
(when (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\\|desctiption\\)}[ \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 herder.
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]*\\\\documentclass\\>" nil t)
(beginning-of-line 2)
(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 setings 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 funcion 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-beamer-settings-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))
(org-entry-put nil "BEAMER_HEADER_EXTRA" org-beamer-themes)
(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")
(insert "#+BEAMER_HEADER_EXTRA: " org-beamer-themes "\n")
(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

View file

@ -5,7 +5,7 @@
;; Author: Bastien Guerry <bzg at altern dot org>
;; Carsten Dominik <carsten dot dominik at gmail dot com>
;; Keywords: org, wp, remember
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;

View file

@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -63,13 +63,20 @@ which see."
(defcustom org-clock-out-when-done t
"When non-nil, clock will be stopped when the clocked entry is marked DONE.
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."
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 'boolean)
: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."
"Non-nil means remove the clock line when the resulting time is zero."
:group 'org-clock
:type 'boolean)
@ -105,7 +112,7 @@ state to switch it to."
: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."
"Non-nil means `org-clock-goto' can go to recent task if no active clock."
:group 'org-clock
:type 'boolean)
@ -193,6 +200,17 @@ auto Automatically, either `all', or `repeat' for repeating tasks"
(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
@ -222,6 +240,11 @@ string as argument."
(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)
(defvar org-clock-in-prepare-hook nil
"Hook run when preparing the clock.
This hook is run before anything happens to the task that
@ -250,7 +273,7 @@ to add an effort property.")
(defvar org-clock-heading-for-remember "")
(defvar org-clock-start-time "")
(defvar org-clock-left-over-time nil
(defvar org-clock-leftover-time nil
"If non-nil, user cancelled a clock; this is when leftover time started.")
(defvar org-clock-effort ""
@ -310,6 +333,14 @@ of a different task.")
(mapc (lambda (m) (org-check-and-save-marker m beg end))
org-clock-history))
(defun org-clocking-buffer ()
"Returns clocking buffer if we are currently clocking a task or nil"
(marker-buffer org-clock-marker))
(defun org-clocking-p ()
"Returns 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)
@ -326,7 +357,7 @@ of a different 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 (marker-buffer org-clock-marker)
(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))
@ -339,6 +370,7 @@ of a different task.")
(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)
@ -360,56 +392,82 @@ pointing to it."
(save-excursion
(save-restriction
(widen)
(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))))))
(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 show in the mode line.
If an effort estimate was defined for current item, use
"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 (and org-clock-effort)
(let* ((effort-in-minutes (org-hh:mm-string-to-minutes org-clock-effort))
(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))))
(format (concat "-[" org-time-clocksum-format "/" org-time-clocksum-format " (%s)]")
h m effort-h effort-m org-clock-heading))
(format (concat "-[" org-time-clocksum-format " (%s)]")
h m org-clock-heading))))
(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
(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)
'face 'org-mode-line-clock))
(if org-clock-effort (org-clock-notify-once-if-expired))
))
(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 ()
@ -461,10 +519,13 @@ the mode line."
(defun org-clock-notify-once-if-expired ()
"Show notification if we spent more time than we estimated before.
Notification is shown only once."
(when (marker-buffer org-clock-marker)
(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 (>= clocked-time effort-in-minutes)
(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
@ -651,7 +712,7 @@ This routine can do one of many things:
(org-clock-clock-out clock fail-quietly resolve-to)
(unless org-clock-clocking-in
(if close-p
(setq org-clock-left-over-time resolve-to)
(setq org-clock-leftover-time resolve-to)
(org-clock-clock-in clock)))))))
(defun org-clock-resolve (clock &optional prompt-fn last-valid fail-quietly)
@ -699,12 +760,19 @@ was started."
(goto-char (match-end 0)))
nil))))))
(let (char-pressed)
(while (null char-pressed)
(if (featurep 'xemacs)
(progn
(message (concat (funcall prompt-fn clock)
" [(kK)eep (sS)ubtract (C)ancel]? "))
(setq char-pressed (read-char-exclusive)))
(while (or (null char-pressed)
(and (not (memq char-pressed '(?k ?K ?s ?S ?C ?i)))
(or (ding) t)))
(setq char-pressed
(read-char (concat (funcall prompt-fn clock)
" [(kK)eep (sS)ubtract (C)ancel]? ")
" [(kK)p (sS)ub (C)ncl (i)gn]? ")
nil 45)))
char-pressed))))
(and (not (eq char-pressed ?i)) char-pressed))))))
(default (floor (/ (org-float-time
(time-subtract (current-time) last-valid)) 60)))
(keep (and (memq ch '(?k ?K))
@ -779,17 +847,13 @@ non-dangling (i.e., currently open and valid) clocks."
(defun org-user-idle-seconds ()
"Return the number of seconds the user has been idle for.
This routine returns a floating point number."
(if (or (eq system-type 'darwin) (eq window-system 'x))
(let ((emacs-idle (org-emacs-idle-seconds)))
;; If Emacs has been idle for longer than the user's
;; `org-clock-idle-time' value, check whether the whole system has
;; really been idle for that long.
(if (> emacs-idle (* 60 org-clock-idle-time))
(min emacs-idle (if (eq system-type 'darwin)
(org-mac-idle-seconds)
(org-x11-idle-seconds)))
emacs-idle))
(org-emacs-idle-seconds)))
(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)
@ -800,11 +864,11 @@ 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))
(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
@ -829,16 +893,16 @@ the clocking selection, associated with the letter `d'."
(setq org-clock-notification-was-shown nil)
(catch 'abort
(let ((interrupting (and (not org-clock-resolving-clocks-due-to-idleness)
(marker-buffer org-clock-marker)))
(org-clocking-p)))
ts selected-task target-pos (msg-extra "")
(left-over (and (not org-clock-resolving-clocks)
org-clock-left-over-time)))
(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-left-over-time nil)
(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))
@ -849,15 +913,29 @@ the clocking selection, associated with the letter `d'."
(when interrupting
;; We are interrupting the clocking of a different task.
;; Save a marker to this task, so that we can go back.
(move-marker org-clock-interrupted-task
(marker-position org-clock-marker)
(marker-buffer org-clock-marker))
(org-clock-out t))
;; First check if we are trying to clock into the same task!
(if (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)
(progn
(move-marker org-clock-interrupted-task
(marker-position org-clock-marker)
(org-clocking-buffer))
(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)))
@ -878,6 +956,7 @@ the clocking selection, associated with the letter `d'."
(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
@ -898,7 +977,9 @@ the clocking selection, associated with the letter `d'."
(functionp org-clock-heading-function))
(funcall org-clock-heading-function))
((looking-at org-complex-heading-regexp)
(match-string 4))
(replace-regexp-in-string
"\\[\\[.*?\\]\\[\\(.*?\\)\\]\\]" "\\1"
(match-string 4)))
(t "???")))
(setq org-clock-heading (org-propertize org-clock-heading
'face nil))
@ -939,13 +1020,13 @@ the clocking selection, associated with the letter `d'."
(setq org-clock-total-time (org-clock-sum-current-item
(org-clock-get-sum-start)))
(setq org-clock-start-time
(or (and left-over
(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 left-over)) 60)))
left-over)
(org-float-time leftover)) 60)))
leftover)
(current-time)))
(setq ts (org-insert-time-stamp org-clock-start-time
'with-hm 'inactive))))
@ -963,7 +1044,9 @@ the clocking selection, associated with the letter `d'."
(cancel-timer org-clock-mode-line-timer)
(setq org-clock-mode-line-timer nil))
(setq org-clock-mode-line-timer
(run-with-timer 60 60 'org-clock-update-mode-line))
(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))
@ -972,6 +1055,15 @@ the clocking selection, associated with the letter `d'."
(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 (org-get-heading)))
(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)
@ -1104,11 +1196,11 @@ line and position cursor in that line."
If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
(interactive)
(catch 'exit
(if (not (marker-buffer org-clock-marker))
(if (not (org-clocking-p))
(if fail-quietly (throw 'exit t) (error "No active clock")))
(let (ts te s h m remove)
(save-excursion
(set-buffer (marker-buffer org-clock-marker))
(set-buffer (org-clocking-buffer))
(save-restriction
(widen)
(goto-char org-clock-marker)
@ -1151,7 +1243,8 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
(when org-clock-out-switch-to-state
(save-excursion
(org-back-to-heading t)
(let ((org-inhibit-logging 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)
@ -1166,15 +1259,16 @@ If there is no running clock, throw an error, unless FAIL-QUIETLY is set."
(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))))))
(run-hooks 'org-clock-out-hook)
(org-clock-delete-current))))))
(defun org-clock-cancel ()
"Cancel the running clock be removing the start timestamp."
(interactive)
(if (not (marker-buffer org-clock-marker))
(if (not (org-clocking-p))
(error "No active clock"))
(save-excursion
(set-buffer (marker-buffer org-clock-marker))
(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
@ -1196,7 +1290,7 @@ With prefix arg SELECT, offer recently clocked tasks for selection."
(select
(or (org-clock-select-task "Select task to go to: ")
(error "No task selected")))
((marker-buffer org-clock-marker) org-clock-marker)
((org-clocking-p) org-clock-marker)
((and org-clock-goto-may-find-recent-task
(car org-clock-history)
(marker-buffer (car org-clock-history)))
@ -1210,6 +1304,7 @@ With prefix arg SELECT, offer recently clocked tasks for selection."
(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)))
@ -1259,6 +1354,13 @@ TSTART and TEND can mark a time range to be considered."
(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)))
(let ((time (floor (- (org-float-time)
(org-float-time org-clock-start-time)) 60)))
(setq t1 (+ t1 time))))
(setq level (- (match-end 1) (match-beginning 1)))
(when (or (> t1 0) (> (aref ltimes level) 0))
(loop for l from 0 to level do
@ -1365,16 +1467,20 @@ from the `before-change-functions' in the current buffer."
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
(member state org-done-keywords)
(equal (or (buffer-base-buffer (marker-buffer org-clock-marker))
(marker-buffer org-clock-marker))
(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))
(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
@ -1857,7 +1963,7 @@ The details of what will be saved are regulated by the variable
system-name (format-time-string
(cdr org-time-stamp-formats))))
(if (and (memq org-clock-persist '(t clock))
(setq b (marker-buffer org-clock-marker))
(setq b (org-clocking-buffer))
(setq b (or (buffer-base-buffer b) b))
(buffer-live-p b)
(buffer-file-name b)
@ -1866,7 +1972,7 @@ The details of what will be saved are regulated by the variable
(substring-no-properties org-clock-heading)
") "))))
(insert "(setq resume-clock '(\""
(buffer-file-name (marker-buffer org-clock-marker))
(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

View file

@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -459,10 +459,16 @@ Where possible, use the standard interface for changing this line."
((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-set-environment-tag))))
(t
(setq allowed (org-property-get-allowed-values pom key 'table))
(if allowed
(setq nval (org-icompleting-read "Value: " allowed nil t))
(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))
@ -1377,10 +1383,11 @@ and tailing newline characters."
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)))
(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)
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
@ -1404,9 +1411,10 @@ This will add overlays to the date lines, to show the summary for each day."
(mapcar
(lambda (f)
(setq prop (car f)
stype (nth 3 f)
sumfunc (nth 5 f)
calc (or (nth 6 f) 'identity))
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)

View file

@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -362,6 +362,40 @@ TIME defaults to the current time."
(time-to-seconds (or time (current-time)))
(float-time time)))
; 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)))))
(provide 'org-compat)
;; arch-tag: a0a0579f-e68c-4bdf-9e55-93768b846bbe

View file

@ -4,7 +4,7 @@
;; Emacs Lisp Archive Entry
;; Filename: org-crypt.el
;; Version: 6.33x
;; Version: 6.35i
;; Keywords: org-mode
;; Author: John Wiegley <johnw@gnu.org>
;; Maintainer: Peter Jones <pjones@pmade.com>
@ -94,7 +94,7 @@ heading. This can also be overridden in the CRYPTKEY property."
"Returns the encryption key for the current heading."
(save-excursion
(org-back-to-heading t)
(or (org-entry-get nil "CRYPTKEY" 'selective)
(or (org-entry-get nil "CRYPTKEY" 'selective)
org-crypt-key
(and (boundp 'epa-file-encrypt-to) epa-file-encrypt-to)
(error "No crypt key set"))))
@ -116,7 +116,7 @@ heading. This can also be overridden in the CRYPTKEY property."
(org-back-over-empty-lines)
(setq end (point)
encrypted-text
(epg-encrypt-string
(epg-encrypt-string
epg-context
(buffer-substring-no-properties beg end)
(epg-list-keys epg-context crypt-key)))
@ -129,6 +129,7 @@ heading. This can also be overridden in the CRYPTKEY property."
nil))))
(defun org-decrypt-entry ()
"Decrypt the content of the current headline."
(interactive)
(require 'epg)
(save-excursion
@ -136,12 +137,12 @@ heading. This can also be overridden in the CRYPTKEY property."
(forward-line)
(when (looking-at "-----BEGIN PGP MESSAGE-----")
(let* ((beg (point))
(end (save-excursion
(end (save-excursion
(search-forward "-----END PGP MESSAGE-----")
(forward-line)
(point)))
(epg-context (epg-make-context nil t t))
(decrypted-text
(decrypted-text
(decode-coding-string
(epg-decrypt-string
epg-context
@ -152,24 +153,28 @@ heading. This can also be overridden in the CRYPTKEY property."
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-scan-tags
'org-decrypt-entry
(cdr (org-make-tags-matcher org-crypt-tag-matcher))))
(defun org-crypt-use-before-save-magic ()
"Adds a hook that will automatically encrypt entries before a
file is saved to disk."
(add-hook
'org-mode-hook
(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

539
lisp/org/org-ctags.el Normal file
View file

@ -0,0 +1,539 @@
;;; 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: 1.0
;; Keywords: org, wp
;; Version: 6.35i
;;
;; 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))
(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, that 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,
and if 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 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 behaviour
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
behaviour 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,
containing tag definitions for all the files in the directory and its
subdirectories which are recognised 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

View file

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -39,10 +39,11 @@ This is normally one, but if the buffer has an entry with a DATE_TREE
property, 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 nit, the buffer will be widened to make sure an existing date
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))

View file

@ -4,7 +4,7 @@
;;
;; Emacs Lisp Archive Entry
;; Filename: org-docbook.el
;; Version: 6.33x
;; Version: 6.35i
;; Author: Baoqiu Cui <cbaoqiu AT yahoo DOT com>
;; Maintainer: Baoqiu Cui <cbaoqiu AT yahoo DOT com>
;; Keywords: org, wp, docbook
@ -384,6 +384,8 @@ 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))
@ -609,7 +611,9 @@ publishing directory."
</info>\n"
(org-docbook-expand title)
firstname othername surname
(if email (concat "<email>" email "</email>") "")
(if (and org-export-email-info
email (string-match "\\S-" email))
(concat "<email>" email "</email>") "")
)))
(org-init-section-numbers)
@ -622,7 +626,7 @@ publishing directory."
;; End of quote section?
(when (and inquote (string-match "^\\*+ " line))
(insert "]]>\n</programlisting>\n")
(insert "]]></programlisting>\n")
(org-export-docbook-open-para)
(setq inquote nil))
;; Inside a quote section?
@ -642,7 +646,7 @@ publishing directory."
(not (string-match "^[ \t]*\\(:.*\\)"
(car lines))))
(setq infixed nil)
(insert "]]>\n</programlisting>\n")
(insert "]]></programlisting>\n")
(org-export-docbook-open-para))
(throw 'nextline nil))
@ -910,7 +914,8 @@ publishing directory."
(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)))
(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\"/>"
@ -922,9 +927,10 @@ publishing directory."
(match-string 1 line)
org-export-docbook-footnote-id-prefix
num
(save-match-data
(org-docbook-expand
(cdr (assoc num footnote-list)))))
(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))))))
@ -1090,7 +1096,7 @@ publishing directory."
;; Properly close all local lists and other lists
(when inquote
(insert "]]>\n</programlisting>\n")
(insert "]]></programlisting>\n")
(org-export-docbook-open-para))
(when in-local-list
;; Close any local lists before inserting a new header line
@ -1119,6 +1125,13 @@ publishing directory."
"[ \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.
@ -1246,16 +1259,14 @@ string, don't modify these."
(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 ass)
(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 ass (assoc wd org-html-entities))
(setq s (replace-match (or (cdr ass)
(concat "&" (car ass) ";"))
t t s))
(if (setq rep (org-entity-get-representation wd 'html))
(setq s (replace-match rep t t s))
(setq start (+ start (length wd))))))))
s)
@ -1312,6 +1323,7 @@ string, don't modify these."
(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)))))
@ -1337,18 +1349,33 @@ string, don't modify these."
(replace-match ""))))
(defun org-export-docbook-finalize-table (table)
"Change TABLE to informaltable if caption does not exist.
"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."
(if (string-match
"^<table \\(\\(.\\|\n\\)+\\)<caption></caption>\n\\(\\(.\\|\n\\)+\\)</table>"
table)
(replace-match (concat "<informaltable "
(match-string 1 table)
(match-string 3 table)
"</informaltable>")
nil nil table)
table))
(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.

86
lisp/org/org-docview.el Normal file
View file

@ -0,0 +1,86 @@
;;; org-docview.el --- support for links to doc-view-mode buffers
;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 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: 6.35i
;;
;; 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 "doc-view" (page))
(declare-function doc-view-current-page "doc-view" (&optional win))
(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 (doc-view-current-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)

493
lisp/org/org-entities.el Normal file
View file

@ -0,0 +1,493 @@
;;; 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: 6.35i
;;
;; 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:
(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 preduce special characters.
Each entry in this list is a list of strings. It associate 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 he 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 written out as an explanatory text.
But see the variable `org-entities-ascii-keep-macro-form'.
Latin1 replacement Use the special characters available in latin1.
utf-8 replacement Use special character 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
'(("nbsp" "~" nil "&nbsp;" " " " " " ")
("iexcl" "!`" nil "&iexcl;" "!" "¡" "¡")
("cent" "\\textcent{}" nil "&cent;" "cent" "¢" "¢")
("pound" "\\pounds{}" nil "&pound;" "pound" "£" "£")
("curren" "\\textcurrency{}" nil "&curren;" "curr." "¤" "¤")
("yen" "\\textyen{}" nil "&yen;" "yen" "¥" "¥")
("brvbar" "\\textbrokenbar{}" nil "&brvbar;" "|" "¦" "¦")
("vert" "\\vert{}" t "&#124;" "|" "|" "|")
("sect" "\\S" nil "&sect;" "paragraph" "§" "§")
("uml" "\\textasciidieresis{}" nil "&uml;" "[diaeresis]" "¨" "¨")
("copy" "\\textcopyright{}" nil "&copy;" "(c)" "©" "©")
("ordf" "\\textordfeminine{}" nil "&ordf;" "_a_" "ª" "ª")
("laquo" "\\guillemotleft{}" nil "&laquo;" "<<" "«" "«")
("not" "\\textlnot{}" nil "&not;" "[angled dash]" "¬" "¬")
("shy" "\\-" nil "&shy;" "" "" "")
("reg" "\\textregistered{}" nil "&reg;" "(r)" "®" "®")
("macr" "\\textasciimacron{}" nil "&macr;" "[macron]" "¯" "¯")
("deg" "\\textdegree{}" nil "deg" "degree" "°" "°")
("pm" "\\textpm{}" nil "&plusmn;" "+-" "±" "±")
("plusmn" "\\textpm{}" nil "&plusmn;" "+-" "±" "±")
("sup2" "\\texttwosuperior{}" nil "&sup2;" "^2" "²" "²")
("sup3" "\\textthreesuperior{}" nil "&sup3;" "^3" "³" "³")
("acutex" "\\acute x" t "&acute;x" "'x" "'x" "𝑥́")
("micro" "\\textmu{}" nil "&micro;" "micro" "µ" "µ")
("para" "\\P{}" nil "&para;" "[pilcrow]" "" "")
("middot" "\\textperiodcentered{}" nil "&middot;" "." "·" "·")
("odot" "\\odot" t "o" "[circled dot]" "[circled dot]" "ʘ")
("star" "\\star" t "*" "*" "*" "")
("cedil" "\\c{}" nil "&cedil;" "[cedilla]" "¸" "¸")
("sup1" "\\textonesuperior{}" nil "&sup1;" "^1" "¹" "¹")
("ordm" "\\textordmasculine{}" nil "&ordm;" "_o_" "º" "º")
("raquo" "\\guillemotright{}" nil "&raquo;" ">>" "»" "»")
("iquest" "?`" nil "&iquest;" "?" "¿" "¿")
("Agrave" "\\`{A}" nil "&Agrave;" "A" "À" "À")
("Aacute" "\\'{A}" nil "&Aacute;" "A" "Á" "Á")
("Acirc" "\\^{A}" nil "&Acirc;" "A" "Â" "Â")
("Atilde" "\\~{A}" nil "&Atilde;" "A" "Ã" "Ã")
("Auml" "\\\"{A}" nil "&Auml;" "Ae" "Ä" "Ä")
("Aring" "\\AA{}" nil "&Aring;" "A" "Å" "Å")
("AA" "\\AA{}" nil "&Aring;" "A" "Å" "Å")
("AElig" "\\AE{}" nil "&AElig;" "AE" "Æ" "Æ")
("Ccedil" "\\c{C}" nil "&Ccedil;" "C" "Ç" "Ç")
("Egrave" "\\`{E}" nil "&Egrave;" "E" "È" "È")
("Eacute" "\\'{E}" nil "&Eacute;" "E" "É" "É")
("Ecirc" "\\^{E}" nil "&Ecirc;" "E" "Ê" "Ê")
("Euml" "\\\"{E}" nil "&Euml;" "E" "Ë" "Ë")
("Igrave" "\\`{I}" nil "&Igrave;" "I" "Ì" "Ì")
("Iacute" "\\'{I}" nil "&Iacute;" "I" "Í" "Í")
("Icirc" "\\^{I}" nil "&Icirc;" "I" "Î" "Î")
("Iuml" "\\\"{I}" nil "&Iuml;" "I" "Ï" "Ï")
("ETH" "\\DH{}" nil "&ETH;" "D" "Ð" "Ð")
("Ntilde" "\\~{N}" nil "&Ntilde;" "N" "Ñ" "Ñ")
("Ograve" "\\`{O}" nil "&Ograve;" "O" "Ò" "Ò")
("Oacute" "\\'{O}" nil "&Oacute;" "O" "Ó" "Ó")
("Ocirc" "\\^{O}" nil "&Ocirc;" "O" "Ô" "Ô")
("Otilde" "\\~{O}" nil "&Otilde;" "O" "Õ" "Õ")
("Ouml" "\\\"{O}" nil "&Ouml;" "Oe" "Ö" "Ö")
("times" "\\texttimes{}" nil "&times;" "*" "×" "×")
("Oslash" "\\O" nil "&Oslash;" "O" "Ø" "Ø")
("Ugrave" "\\`{U}" nil "&Ugrave;" "U" "Ù" "Ù")
("Uacute" "\\'{U}" nil "&Uacute;" "U" "Ú" "Ú")
("Ucirc" "\\^{U}" nil "&Ucirc;" "U" "Û" "Û")
("Uuml" "\\\"{U}" nil "&Uuml;" "Ue" "Ü" "Ü")
("Yacute" "\\'{Y}" nil "&Yacute;" "Y" "Ý" "Ý")
("THORN" "\\TH{}" nil "&THORN;" "TH" "Þ" "Þ")
("szlig" "\\ss{}" nil "&szlig;" "ss" "ß" "ß")
("agrave" "\\`{a}" nil "&agrave;" "a" "à" "à")
("aacute" "\\'{a}" nil "&aacute;" "a" "á" "á")
("acirc" "\\^{a}" nil "&acirc;" "a" "â" "â")
("atilde" "\\~{a}" nil "&atilde;" "a" "ã" "ã")
("auml" "\\\"{a}" nil "&auml;" "ae" "ä" "ä")
("aring" "\\aa{}" nil "&aring;" "a" "å" "å")
("aelig" "\\ae{}" nil "&aelig;" "ae" "æ" "æ")
("ccedil" "\\c{c}" nil "&ccedil;" "c" "ç" "ç")
("checkmark" "\\checkmark" t "&#10003;" "[checkmark]" "[checkmark]" "")
("egrave" "\\`{e}" nil "&egrave;" "e" "è" "è")
("eacute" "\\'{e}" nil "&eacute;" "e" "é" "é")
("ecirc" "\\^{e}" nil "&ecirc;" "e" "ê" "ê")
("euml" "\\\"{e}" nil "&euml;" "e" "ë" "ë")
("igrave" "\\`{i}" nil "&igrave;" "i" "ì" "ì")
("iacute" "\\'{i}" nil "&iacute;" "i" "í" "í")
("icirc" "\\^{i}" nil "&icirc;" "i" "î" "î")
("iuml" "\\\"{i}" nil "&iuml;" "i" "ï" "ï")
("eth" "\\dh{}" nil "&eth;" "dh" "ð" "ð")
("ntilde" "\\~{n}" nil "&ntilde;" "n" "ñ" "ñ")
("ograve" "\\`{o}" nil "&ograve;" "o" "ò" "ò")
("oacute" "\\'{o}" nil "&oacute;" "o" "ó" "ó")
("ocirc" "\\^{o}" nil "&ocirc;" "o" "ô" "ô")
("otilde" "\\~{o}" nil "&otilde;" "o" "õ" "õ")
("ouml" "\\\"{o}" nil "&ouml;" "oe" "ö" "ö")
("oslash" "\\o{}" nil "&oslash;" "o" "ø" "ø")
("ugrave" "\\`{u}" nil "&ugrave;" "u" "ù" "ù")
("uacute" "\\'{u}" nil "&uacute;" "u" "ú" "ú")
("ucirc" "\\^{u}" nil "&ucirc;" "u" "û" "û")
("uuml" "\\\"{u}" nil "&uuml;" "ue" "ü" "ü")
("yacute" "\\'{y}" nil "&yacute;" "y" "ý" "ý")
("thorn" "\\th{}" nil "&thorn;" "th" "þ" "þ")
("yuml" "\\\"{y}" nil "&yuml;" "y" "ÿ" "ÿ")
("fnof" "\\textit{f}" nil "&fnof;" "f" "f" "ƒ")
("Alpha" "A" nil "&Alpha;" "Alpha" "Alpha" "Α")
("Beta" "B" nil "&Beta;" "Beta" "Beta" "Β")
("Gamma" "\\Gamma" t "&Gamma;" "Gamma" "Gamma" "Γ")
("Delta" "\\Delta" t "&Delta;" "Delta" "Gamma" "Δ")
("Epsilon" "E" nil "&Epsilon;" "Epsilon" "Epsilon" "Ε")
("Zeta" "Z" nil "&Zeta;" "Zeta" "Zeta" "Ζ")
("Eta" "H" nil "&Eta;" "Eta" "Eta" "Η")
("Theta" "\\Theta" t "&Theta;" "Theta" "Theta" "Θ")
("Iota" "I" nil "&Iota;" "Iota" "Iota" "Ι")
("Kappa" "K" nil "&Kappa;" "Kappa" "Kappa" "Κ")
("Lambda" "\\Lambda" t "&Lambda;" "Lambda" "Lambda" "Λ")
("Mu" "M" nil "&Mu;" "Mu" "Mu" "Μ")
("Nu" "N" nil "&Nu;" "Nu" "Nu" "Ν")
("Xi" "\\Xi" t "&Xi;" "Xi" "Xi" "Ξ")
("Omicron" "O" nil "&Omicron;" "Omicron" "Omicron" "Ο")
("Pi" "\\Pi" t "&Pi;" "Pi" "Pi" "Π")
("Rho" "P" nil "&Rho;" "Rho" "Rho" "Ρ")
("Sigma" "\\Sigma" t "&Sigma;" "Sigma" "Sigma" "Σ")
("Tau" "T" nil "&Tau;" "Tau" "Tau" "Τ")
("Upsilon" "\\Upsilon" t "&Upsilon;" "Upsilon" "Upsilon" "Υ")
("Phi" "\\Phi" t "&Phi;" "Phi" "Phi" "Φ")
("Chi" "X" nil "&Chi;" "Chi" "Chi" "Χ")
("Psi" "\\Psi" t "&Psi;" "Psi" "Psi" "Ψ")
("Omega" "\\Omega" t "&Omega;" "Omega" "Omega" "Ω")
("alpha" "\\alpha" t "&alpha;" "alpha" "alpha" "α")
("beta" "\\beta" t "&beta;" "beta" "beta" "β")
("gamma" "\\gamma" t "&gamma;" "gamma" "gamma" "γ")
("delta" "\\delta" t "&delta;" "delta" "delta" "δ")
("epsilon" "\\epsilon" t "&epsilon;" "epsilon" "epsilon" "ε")
("varepsilon" "\\varepsilon" t "&epsilon;" "varepsilon" "varepsilon" "ε")
("zeta" "\\zeta" t "&zeta;" "zeta" "zeta" "ζ")
("eta" "\\eta" t "&eta;" "eta" "eta" "η")
("theta" "\\theta" t "&theta;" "theta" "theta" "θ")
("iota" "\\iota" t "&iota;" "iota" "iota" "ι")
("kappa" "\\kappa" t "&kappa;" "kappa" "kappa" "κ")
("lambda" "\\lambda" t "&lambda;" "lambda" "lambda" "λ")
("mu" "\\mu" t "&mu;" "mu" "mu" "μ")
("nu" "\\nu" t "&nu;" "nu" "nu" "ν")
("xi" "\\xi" t "&xi;" "xi" "xi" "ξ")
("omicron" "\\textit{o}" nil "&omicron;" "omicron" "omicron" "ο")
("pi" "\\pi" t "&pi;" "pi" "pi" "π")
("rho" "\\rho" t "&rho;" "rho" "rho" "ρ")
("sigmaf" "\\varsigma" t "&sigmaf;" "sigmaf" "sigmaf" "ς")
("varsigma" "\\varsigma" t "&sigmaf;" "varsigma" "varsigma" "ς")
("sigma" "\\sigma" t "&sigma;" "sigma" "sigma" "σ")
("tau" "\\tau" t "&tau;" "tau" "tau" "τ")
("upsilon" "\\upsilon" t "&upsilon;" "upsilon" "upsilon" "υ")
("phi" "\\phi" t "&phi;" "phi" "phi" "φ")
("chi" "\\chi" t "&chi;" "chi" "chi" "χ")
("psi" "\\psi" t "&psi;" "psi" "psi" "ψ")
("omega" "\\omega" t "&omega;" "omega" "omega" "ω")
("thetasym" "\\vartheta" t "&thetasym;" "theta" "theta" "ϑ")
("vartheta" "\\vartheta" t "&thetasym;" "theta" "theta" "ϑ")
("upsih" "\\Upsilon" t "&upsih;" "upsilon" "upsilon" "ϒ")
("piv" "\\varpi" t "&piv;" "omega-pi" "omega-pi" "ϖ")
("bull" "\\textbullet{}" nil "&bull;" "*" "*" "")
("bullet" "\\textbullet{}" nil "&bull;" "*" "*" "")
("hellip" "\\dots{}" nil "&hellip;" "..." "..." "")
("dots" "\\dots{}" nil "&hellip;" "..." "..." "")
("prime" "\\prime" t "&prime;" "'" "'" "")
("Prime" "\\prime{}\\prime" t "&Prime;" "''" "''" "")
("oline" "\\overline{~}" t "&oline;" "[overline]" "¯" "")
("frasl" "/" nil "&frasl;" "/" "/" "")
("weierp" "\\wp" t "&weierp;" "P" "P" "")
("image" "\\Im" t "&image;" "I" "I" "")
("real" "\\Re" t "&real;" "R" "R" "")
("trade" "\\texttrademark{}" nil "&trade;" "TM" "TM" "")
("alefsym" "\\aleph" t "&alefsym;" "aleph" "aleph" "")
("larr" "\\leftarrow" t "&larr;" "<-" "<-" "")
("leftarrow" "\\leftarrow" t "&larr;" "<-" "<-" "")
("gets" "\\gets" t "&larr;" "<-" "<-" "")
("uarr" "\\uparrow" t "&uarr;" "[uparrow]" "[uparrow]" "")
("uparrow" "\\uparrow" t "&uarr;" "[uparrow]" "[uparrow]" "")
("rarr" "\\rightarrow" t "&rarr;" "->" "->" "")
("to" "\\to" t "&rarr;" "->" "->" "")
("rightarrow" "\\rightarrow" t "&rarr;" "->" "->" "")
("darr" "\\downarrow" t "&darr;" "[downarrow]" "[downarrow]" "")
("downarrow" "\\downarrow" t "&darr;" "[downarrow]" "[downarrow]" "")
("harr" "\\leftrightarrow" t "&harr;" "<->" "<->" "")
("leftrightarrow" "\\leftrightarrow" t "&harr;" "<->" "<->" "")
("crarr" "\\hookleftarrow" t "&crarr;" "<-'" "<-'" "")
("hookleftarrow" "\\hookleftarrow" t "&crarr;" "<-'" "<-'" "")
("lArr" "\\Leftarrow" t "&lArr;" "<=" "<=" "")
("Leftarrow" "\\Leftarrow" t "&lArr;" "<=" "<=" "")
("uArr" "\\Uparrow" t "&uArr;" "[dbluparrow]" "[dbluparrow]" "")
("Uparrow" "\\Uparrow" t "&uArr;" "[dbluparrow]" "[dbluparrow]" "")
("rArr" "\\Rightarrow" t "&rArr;" "=>" "=>" "")
("Rightarrow" "\\Rightarrow" t "&rArr;" "=>" "=>" "")
("dArr" "\\Downarrow" t "&dArr;" "[dbldownarrow]" "[dbldownarrow]" "")
("Downarrow" "\\Downarrow" t "&dArr;" "[dbldownarrow]" "[dbldownarrow]" "")
("hArr" "\\Leftrightarrow" t "&hArr;" "<=>" "<=>" "")
("Leftrightarrow" "\\Leftrightarrow" t "&hArr;" "<=>" "<=>" "")
("forall" "\\forall" t "&forall;" "[for all]" "[for all]" "")
("partial" "\\partial" t "&part;" "[partial differential]" "[partial differential]" "")
("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]" "")
("nabla" "\\nabla" t "&nabla;" "[nabla]" "[nabla]" "")
("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]" "")
("prod" "\\prod" t "&prod;" "[product]" "[n-ary product]" "")
("sum" "\\sum" t "&sum;" "[sum]" "[sum]" "")
; ("minus" "\\minus" t "&minus;" "-" "-" "")
("minus" "-" t "&minus;" "-" "-" "")
("lowast" "\\ast" t "&lowast;" "*" "*" "")
("ast" "\\ast" t "&lowast;" "*" "*" "*")
("radic" "\\sqrt{\\,}" t "&radic;" "[square root]" "[square root]" "")
("prop" "\\propto" t "&prop;" "[proportional to]" "[proportional to]" "")
("proptp" "\\propto" t "&prop;" "[proportional to]" "[proportional to]" "")
("infin" "\\propto" t "&infin;" "[infinity]" "[infinity]" "")
("infty" "\\infty" t "&infin;" "[infinity]" "[infinity]" "")
("ang" "\\angle" t "&ang;" "[angle]" "[angle]" "")
("angle" "\\angle" t "&ang;" "[angle]" "[angle]" "")
("and" "\\wedge" t "&and;" "[logical and]" "[logical and]" "")
("wedge" "\\wedge" t "&and;" "[logical and]" "[logical and]" "")
("or" "\\vee" 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" "\\uptherefore" t "&there4;" "[therefore]" "[therefore]" "∴")
("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]" "")
("supe" "\\supseteq" t "&supe;" "[superset of or equal to]" "[superset of or equal to]" "")
("oplus" "\\oplus" t "&oplus;" "[circled plus]" "[circled plus]" "")
("otimes" "\\otimes" t "&otimes;" "[circled times]" "[circled times]" "")
("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;" ">" ">" "")
("loz" "\\diamond" t "&loz;" "[lozenge]" "[lozenge]" "")
("Diamond" "\\diamond" t "&diamond;" "[diamond]" "[diamond]" "")
("spades" "\\spadesuit" t "&spades;" "[spades]" "[spades]" "")
("spadesuit" "\\spadesuit" t "&spades;" "[spades]" "[spades]" "")
("clubs" "\\clubsuit" t "&clubs;" "[clubs]" "[clubs]" "")
("clubsuit" "\\clubsuit" t "&clubs;" "[clubs]" "[clubs]" "")
("hearts" "\\heartsuit" t "&hearts;" "[hearts]" "[hearts]" "")
("heartsuit" "\\heartsuit" t "&heartsuit;" "[hearts]" "[hearts]" "")
("diamondsuit" "\\diamondsuit" t "&diams;" "[diamonds]" "[diamonds]" "")
("diams" "\\diamondsuit" t "&diams;" "[diamonds]" "[diamonds]" "")
("smile" "\\smile" t "&#9786;" ":-)" ":-)" "")
("blacksmile" "\\blacksmiley{}" nil "&#9787;" ":-)" ":-)" "")
("sad" "\\frownie{}" nil "&#9785;" ":-(" ":-(" "")
("quot" "\\textquotedbl{}" nil "&quot;" "\"" "\"" "\"")
("amp" "\\&" nil "&amp;" "&" "&" "&")
("lt" "\\textless{}" nil "&lt;" "<" "<" "<")
("gt" "\\textgreater{}" nil "&gt;" ">" ">" ">")
("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" "š")
("Yuml" "\\\"{Y}" nil "&Yuml;" "Y" "Y" "Ÿ")
("circ" "\\circ" t "&circ;" "^" "^" "ˆ")
("tilde" "\\~{}" nil "&tilde;" "~" "~" "~")
("ensp" "\\hspace*{.5em}" nil "&ensp;" " " " " "")
("emsp" "\\hspace*{1em}" nil "&emsp;" " " " " "")
("thinsp" "\\hspace*{.2em}" nil "&thinsp;" " " " " "")
("zwnj" "\\/{}" nil "&zwnj;" "" "" "")
("zwj" "" nil "&zwj;" "" "" "")
("lrm" "" nil "&lrm;" "" "" "")
("rlm" "" nil "&rlm;" "" "" "")
("ndash" "--" nil "&ndash;" "-" "-" "")
("mdash" "---" nil "&mdash;" "--" "--" "")
("lsquo" "\\textquoteleft{}" nil "&lsquo;" "`" "`" "")
("rsquo" "\\textquoteright{}" nil "&rsquo;" "'" "'" "")
("sbquo" "\\quotesinglbase{}" nil "&sbquo;" "," "," "")
("ldquo" "\\textquotedblleft{}" nil "&ldquo;" "\"" "\"" "")
("rdquo" "\\textquotedblright{}" nil "&rdquo;" "\"" "\"" "")
("bdquo" "\\quotedblbase{}" nil "&bdquo;" "\"" "\"" "")
("dagger" "\\textdagger{}" nil "&dagger;" "[dagger]" "[dagger]" "")
("Dagger" "\\textdaggerdbl{}" nil "&Dagger;" "[doubledagger]" "[doubledagger]" "")
("permil" "\\textperthousand{}" nil "&permil;" "per thousand" "per thousand" "")
("lsaquo" "\\guilsinglleft{}" nil "&lsaquo;" "<" "<" "")
("rsaquo" "\\guilsinglright{}" nil "&rsaquo;" ">" ">" "")
("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" "")
("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")
("frac12" "\\textonehalf{}" nil "&frac12;" "1/2" "½" "½")
("frac14" "\\textonequarter{}" nil "&frac14;" "1/4" "¼" "¼")
("frac34" "\\textthreequarters{}" nil "&frac34;" "3/4" "¾" "¾")
("div" "\\textdiv{}" nil "&divide;" "/" "÷" "÷")
("acute" "\\textasciiacute{}" nil "&acute;" "'" "´" "´")
("nsup" "\\not\\supset" t "&nsup;" "[not a superset of]" "[not a superset of]" "")
("smiley" "\\smiley{}" nil "&#9786;" ":-)" ":-)" "")
)
"Default entities used in Org-mode to preduce 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
(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 replace-amp ()
"Postprocess HTML file to unescape the ampersant."
(interactive)
(while (re-search-forward "<td>&amp;\\([^<;]+;\\)" nil t)
(replace-match (concat "<td>&" (match-string 1)) t t)))
(provide 'org-entities)
;; arch-tag: e6bd163f-7419-4009-9c93-a74623016424
;;; org-entities.el ends here

View file

@ -4,6 +4,7 @@
;; Free Software Foundation, Inc.
;; Author: Eric Schulte
;; Version: 6.35i
;; This file is part of GNU Emacs.
;;
@ -166,7 +167,7 @@ specified in BLOCKS which default to the value of
(save-window-excursion
(let ((case-fold-search t)
(types '())
indentation type func start body headers preserve-indent)
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)))
@ -183,13 +184,15 @@ specified in BLOCKS which default to the value of
(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)))
(if (setq func (cadr (assoc type org-export-blocks)))
(progn
(replace-match (save-match-data
(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))) t t)
(apply func body headers)))))
(when replacement
(replace-match replacement t t)
(unless preserve-indent
(indent-code-rigidly (match-beginning 0) (match-end 0) indentation))))
(indent-code-rigidly
(match-beginning 0) (match-end 0) indentation)))))
(setq start (match-end 0)))
(interblock start (point-max))))))

View file

@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -54,7 +54,7 @@
:group 'org-export)
(defcustom org-export-allow-BIND 'confirm
"Non-nil means, allow #+BIND to define local variable values for export.
"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
@ -67,7 +67,7 @@ use of these lines."
(defvar org-export-publishing-directory nil)
(defcustom org-export-show-temporary-export-buffer t
"Non-nil means, show buffer after exporting to temp buffer.
"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
@ -76,7 +76,14 @@ is nil, the buffer remains buried also in these cases."
:type 'boolean)
(defcustom org-export-copy-to-kill-ring t
"Non-nil means, exported stuff will also be pushed onto the kill ring."
"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)
@ -114,7 +121,7 @@ This is without condition, so even subtrees inside that carry one of the
;; FIXME: rename, this is a general variable
(defcustom org-export-html-expand t
"Non-nil means, for HTML export, treat @<...> as HTML tag.
"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.
@ -124,7 +131,7 @@ This option can also be set with the +OPTIONS line, e.g. \"@:nil\"."
:type 'boolean)
(defcustom org-export-with-special-strings t
"Non-nil means, interpret \"\-\", \"--\" and \"---\" for export.
"Non-nil means interpret \"\-\", \"--\" and \"---\" for export.
When this option is turned on, these strings will be exported as:
Org HTML LaTeX
@ -198,7 +205,7 @@ 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.
"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)
@ -214,7 +221,7 @@ This option can also be set with the +OPTIONS line, e.g. \"H:2\"."
:type 'integer)
(defcustom org-export-with-section-numbers t
"Non-nil means, add section numbers to headlines when exporting.
"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
@ -241,7 +248,7 @@ The variable has two components.
(string :tag "Terminator")))
(defcustom org-export-with-toc t
"Non-nil means, create a table of contents in exported files.
"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
@ -263,24 +270,24 @@ or \"toc:3\"."
(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."
"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.
"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.
"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.
"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.
@ -302,21 +309,29 @@ headline Only export the headline, but skip the tree below it."
(const :tag "entirely" t)))
(defcustom org-export-author-info t
"Non-nil means, insert author name and email into the exported file.
"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-info:nil\"."
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.
"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.
"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,
@ -347,7 +362,7 @@ This option can also be set with the +OPTIONS line, e.g. \"tags:nil\"."
(const :tag "On" t)))
(defcustom org-export-with-drawers nil
"Non-nil means, export with drawers like the property drawer.
"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
@ -357,9 +372,19 @@ drawer names to export."
(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.")
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.
@ -371,11 +396,24 @@ 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-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.")
@ -390,7 +428,7 @@ returning the buffer string to the backend.")
:group 'org-export)
(defcustom org-export-with-emphasize t
"Non-nil means, interpret *word*, /word/, and _word_ as emphasized text.
"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*.
@ -409,7 +447,7 @@ This option can also be set with the +OPTIONS line, e.g. \"f:nil\"."
:type 'boolean)
(defcustom org-export-with-sub-superscripts t
"Non-nil means, interpret \"_\" and \"^\" for export.
"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
@ -438,11 +476,12 @@ This option can also be set with the +OPTIONS line, e.g. \"^:nil\"."
(const :tag "Never interpret" nil)))
(defcustom org-export-with-TeX-macros t
"Non-nil means, interpret simple TeX-like macros when exporting.
"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-html-entities'.
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\"."
@ -451,7 +490,7 @@ This option can also be set with the +OPTIONS line, e.g. \"TeX:nil\"."
:type 'boolean)
(defcustom org-export-with-LaTeX-fragments nil
"Non-nil means, convert LaTeX fragments to images when exporting to HTML.
"Non-nil means convert LaTeX fragments to images when exporting to HTML.
When set, the exporter will find LaTeX environments if the \\begin line is
the first non-white thing on a line. It will also find the math delimiters
like $a=b$ and \\( a=b \\) for inline math, $$a=b$$ and \\[ a=b \\] for
@ -466,7 +505,7 @@ is not available on all systems."
:type 'boolean)
(defcustom org-export-with-fixed-width t
"Non-nil means, lines starting with \":\" will be in fixed width font.
"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
@ -505,7 +544,7 @@ This option can also be set with the +OPTIONS line, e.g. \"|:nil\"."
:type 'boolean)
(defcustom org-export-highlight-first-table-line t
"Non-nil means, highlight the first table line.
"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
@ -523,13 +562,14 @@ the values of constants may be useful to have."
: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.
"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."
much faster. The LaTeX exporter always use the native exporter for
table.el tables."
:group 'org-export-tables
:type 'boolean)
@ -581,6 +621,7 @@ much faster."
(: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)
@ -772,9 +813,10 @@ security risks."
(defun org-install-letbind ()
"Install the values from #+BIND lines as local variables."
(let ((letbind (plist-get org-export-opt-plist :let-bind)))
(while letbind
(org-set-local (caar letbind) (nth 1 (pop letbind))))))
(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."
@ -835,29 +877,28 @@ ARG is a double universal prefix `C-u C-u', 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] export as ASCII [A] to temporary buffer
\[a/n/u] export as ASCII/Latin-1/UFT-8 [A/N/U] to temporary buffer
\[h] export as HTML [H] to temporary buffer [R] export region
\[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] export as LaTeX, process to PDF, and open the resulting PDF document
\[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 the resulting PDF document
\[D] export as DocBook [V] export as DocBook, process to PDF, 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] export agenda files into combined 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")
@ -866,6 +907,10 @@ value of `org-export-run-in-background'."
(?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)
@ -886,7 +931,8 @@ value of `org-export-run-in-background'."
(?P org-publish-current-project t)
(?X org-publish t)
(?E org-publish-all t)))
r1 r2 ass)
r1 r2 ass
(cpos (point)) (cbuf (current-buffer)) bpos)
(save-excursion
(save-window-excursion
(delete-other-windows)
@ -895,7 +941,25 @@ value of `org-export-run-in-background'."
(org-fit-window-to-buffer (get-buffer-window
"*Org Export/Publishing Help*"))
(message "Select command: ")
(setq r1 (read-char-exclusive))))
(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))
@ -916,320 +980,28 @@ value of `org-export-run-in-background'."
(set-process-sentinel p 'org-export-process-sentinel)
(message "Background process \"%s\": started" p))
;; background processing not requested, or not possible
(call-interactively (nth 1 ass)))))
(if subtree-p (progn (outline-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))
(defconst org-html-entities
'(("nbsp")
("iexcl")
("cent")
("pound")
("curren")
("yen")
("brvbar")
("vert" . "&#124;")
("sect")
("uml")
("copy")
("ordf")
("laquo")
("not")
("shy")
("reg")
("macr")
("deg")
("pm" . "&plusmn;")
("plusmn")
("sup2")
("sup3")
("acute")
("micro")
("para")
("middot")
("odot"."o")
("star"."*")
("cedil")
("sup1")
("ordm")
("raquo")
("frac14")
("frac12")
("frac34")
("iquest")
("Agrave")
("Aacute")
("Acirc")
("Atilde")
("Auml")
("Aring") ("AA"."&Aring;")
("AElig")
("Ccedil")
("Egrave")
("Eacute")
("Ecirc")
("Euml")
("Igrave")
("Iacute")
("Icirc")
("Iuml")
("ETH")
("Ntilde")
("Ograve")
("Oacute")
("Ocirc")
("Otilde")
("Ouml")
("times")
("Oslash")
("Ugrave")
("Uacute")
("Ucirc")
("Uuml")
("Yacute")
("THORN")
("szlig")
("agrave")
("aacute")
("acirc")
("atilde")
("auml")
("aring")
("aelig")
("ccedil")
("egrave")
("eacute")
("ecirc")
("euml")
("igrave")
("iacute")
("icirc")
("iuml")
("eth")
("ntilde")
("ograve")
("oacute")
("ocirc")
("otilde")
("ouml")
("divide")
("oslash")
("ugrave")
("uacute")
("ucirc")
("uuml")
("yacute")
("thorn")
("yuml")
("fnof")
("Alpha")
("Beta")
("Gamma")
("Delta")
("Epsilon")
("Zeta")
("Eta")
("Theta")
("Iota")
("Kappa")
("Lambda")
("Mu")
("Nu")
("Xi")
("Omicron")
("Pi")
("Rho")
("Sigma")
("Tau")
("Upsilon")
("Phi")
("Chi")
("Psi")
("Omega")
("alpha")
("beta")
("gamma")
("delta")
("epsilon")
("varepsilon"."&epsilon;")
("zeta")
("eta")
("theta")
("iota")
("kappa")
("lambda")
("mu")
("nu")
("xi")
("omicron")
("pi")
("rho")
("sigmaf") ("varsigma"."&sigmaf;")
("sigma")
("tau")
("upsilon")
("phi")
("chi")
("psi")
("omega")
("thetasym") ("vartheta"."&thetasym;")
("upsih")
("piv")
("bull") ("bullet"."&bull;")
("hellip") ("dots"."&hellip;")
("prime")
("Prime")
("oline")
("frasl")
("weierp")
("image")
("real")
("trade")
("alefsym")
("larr") ("leftarrow"."&larr;") ("gets"."&larr;")
("uarr") ("uparrow"."&uarr;")
("rarr") ("to"."&rarr;") ("rightarrow"."&rarr;")
("darr")("downarrow"."&darr;")
("harr") ("leftrightarrow"."&harr;")
("crarr") ("hookleftarrow"."&crarr;") ; has round hook, not quite CR
("lArr") ("Leftarrow"."&lArr;")
("uArr") ("Uparrow"."&uArr;")
("rArr") ("Rightarrow"."&rArr;")
("dArr") ("Downarrow"."&dArr;")
("hArr") ("Leftrightarrow"."&hArr;")
("forall")
("part") ("partial"."&part;")
("exist") ("exists"."&exist;")
("empty") ("emptyset"."&empty;")
("nabla")
("isin") ("in"."&isin;")
("notin")
("ni")
("prod")
("sum")
("minus")
("lowast") ("ast"."&lowast;")
("radic")
("prop") ("proptp"."&prop;")
("infin") ("infty"."&infin;")
("ang") ("angle"."&ang;")
("and") ("wedge"."&and;")
("or") ("vee"."&or;")
("cap")
("cup")
("int")
("there4")
("sim")
("cong") ("simeq"."&cong;")
("asymp")("approx"."&asymp;")
("ne") ("neq"."&ne;")
("equiv")
("le")
("ge")
("sub") ("subset"."&sub;")
("sup") ("supset"."&sup;")
("nsub")
("sube")
("supe")
("oplus")
("otimes")
("perp")
("sdot") ("cdot"."&sdot;")
("lceil")
("rceil")
("lfloor")
("rfloor")
("lang")
("rang")
("loz") ("Diamond"."&loz;")
("spades") ("spadesuit"."&spades;")
("clubs") ("clubsuit"."&clubs;")
("hearts") ("diamondsuit"."&hearts;")
("diams") ("diamondsuit"."&diams;")
("smile"."&#9786;") ("blacksmile"."&#9787;") ("sad"."&#9785;")
("quot")
("amp")
("lt")
("gt")
("OElig")
("oelig")
("Scaron")
("scaron")
("Yuml")
("circ")
("tilde")
("ensp")
("emsp")
("thinsp")
("zwnj")
("zwj")
("lrm")
("rlm")
("ndash")
("mdash")
("lsquo")
("rsquo")
("sbquo")
("ldquo")
("rdquo")
("bdquo")
("dagger")
("Dagger")
("permil")
("lsaquo")
("rsaquo")
("euro")
("arccos"."arccos")
("arcsin"."arcsin")
("arctan"."arctan")
("arg"."arg")
("cos"."cos")
("cosh"."cosh")
("cot"."cot")
("coth"."coth")
("csc"."csc")
("deg"."deg")
("det"."det")
("dim"."dim")
("exp"."exp")
("gcd"."gcd")
("hom"."hom")
("inf"."inf")
("ker"."ker")
("lg"."lg")
("lim"."lim")
("liminf"."liminf")
("limsup"."limsup")
("ln"."ln")
("log"."log")
("max"."max")
("min"."min")
("Pr"."Pr")
("sec"."sec")
("sin"."sin")
("sinh"."sinh")
("sup"."sup")
("tan"."tan")
("tanh"."tanh")
)
"Entities for TeX->HTML translation.
Entries can be like (\"ent\"), in which case \"\\ent\" will be translated to
\"&ent;\". An entry can also be a dotted pair like (\"ent\".\"&other;\").
In that case, \"\\ent\" will be translated to \"&other;\".
The list contains HTML entities for Latin-1, Greek and other symbols.
It is supplemented by a number of commonly used TeX macros with appropriate
translations. There is currently no way for users to extend this.")
;;; 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")
@ -1254,15 +1026,20 @@ on this string to produce the exported version."
(outline-regexp "\\*+ ")
target-alist rtn)
(setq org-export-target-aliases nil)
(setq org-export-preferred-target-alist nil)
(setq org-export-code-refs nil)
(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.
@ -1309,6 +1086,11 @@ on this string to produce the exported version."
;; 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)
@ -1333,6 +1115,7 @@ on this string to produce the exported version."
;; 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
@ -1364,6 +1147,7 @@ on this string to produce the exported version."
;; 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
@ -1442,7 +1226,12 @@ The new targets are added to TARGET-ALIST, which is also returned."
(if (not (assoc last-section-target
org-export-preferred-target-alist))
(push (cons last-section-target id)
org-export-preferred-target-alist))))
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))))
@ -1488,7 +1277,7 @@ 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
(org-if-unprotected-at (1+ (match-beginning 0))
(let* ((md (match-data))
(desc (match-end 2))
(link (org-link-unescape (match-string 1)))
@ -1535,6 +1324,17 @@ the current file."
(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]+\\(\\S-+\\)" 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:
@ -1739,6 +1539,7 @@ from the buffer."
(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)
@ -1811,10 +1612,10 @@ table line. If it is a link, add it to the line containing the link."
"\\|"
"^[ \t]*#\\+label:[ \t]+\\(.*\\)"
"\\|"
"^[ \t]*|[^-]"
"^[ \t]*\\(|[^-]\\)"
"\\|"
"^[ \t]*\\[\\[.*\\]\\][ \t]*$"))
cap attr label)
cap attr label end)
(while (re-search-forward re nil t)
(cond
((match-end 1)
@ -1824,25 +1625,32 @@ table line. If it is a link, add it to the line containing the link."
((match-end 3)
(setq label (org-trim (match-string 3))))
(t
(add-text-properties (point-at-bol) (point-at-eol)
(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-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 nil))
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)
"^#\\+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)))))
@ -1877,7 +1685,8 @@ When it is nil, all comments will be removed."
(unless
(save-match-data
(or (org-in-regexp org-bracket-link-regexp)
(org-in-regexp org-plain-link-re)))
(org-in-regexp org-plain-link-re)
(org-in-regexp "<<[^<>]+>>")))
(org-if-unprotected
(replace-match "\\1[[\\2]]")))))))
@ -1887,7 +1696,7 @@ When it is nil, all comments will be removed."
(while (re-search-forward "^[ \t]*|" nil t)
(beginning-of-line 1)
(if (or (looking-at "[ \t]*| *[!_^] *|")
(not
(not
(memq
nil
(mapcar
@ -1962,7 +1771,7 @@ 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
(org-if-unprotected-at (match-beginning 1)
(replace-match "\\1 \\3")
(goto-char (match-beginning 0)))))
@ -2263,24 +2072,26 @@ in the list) and remove property and value from the list in LISTVAR."
"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)
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.*\\)\\|\\(^\\([ \t]*\\)#\\+BEGIN_EXAMPLE:?\\(?:[ \t]+\\(.*\\)\\)?\n\\([^\000]+?\n\\)[ \t]*#\\+END_EXAMPLE.*\\)"
"\\(^\\([ \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)
;; src segments
(setq lang (match-string 3)
opts (match-string 4)
code (match-string 5)
indent (length (match-string 2)))
indent (length (match-string 2))
caption (get-text-property 0 'org-caption (match-string 0)))
(setq lang nil
opts (match-string 8)
code (match-string 9)
indent (length (match-string 7))))
indent (length (match-string 7))
caption (get-text-property 0 'org-caption (match-string 0))))
(setq trans (org-export-format-source-code-or-example
backend lang code opts indent))
backend lang code opts indent caption))
(replace-match trans t t))))
(defvar htmlp) ;; dynamically scoped
@ -2290,7 +2101,7 @@ in the list) and remove property and value from the list in LISTVAR."
(defvar org-export-latex-listings-langs) ;; defined in org-latex.el
(defun org-export-format-source-code-or-example
(backend lang code &optional opts indent)
(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,
@ -2341,7 +2152,7 @@ INDENT was the original indentation of the block."
(concat "\n#+BEGIN_DOCBOOK\n"
(org-add-props (concat "<programlisting><![CDATA["
rtn
"]]>\n</programlisting>\n")
"]]></programlisting>\n")
'(org-protected t))
"#+END_DOCBOOK\n"))
((eq backend 'html)
@ -2378,12 +2189,22 @@ INDENT was the original indentation of the block."
(org-export-htmlize-region-for-paste
(point-min) (point-max))))
(if (string-match "<pre\\([^>]*\\)>\n*" rtn)
(setq rtn (replace-match
(format "<pre class=\"src src-%s\">\n" lang)
t t 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\" overflow-x:scroll >\n"
(format "<p>\n<textarea cols=\"%d\" rows=\"%d\">"
cols rows)
rtn "</textarea>\n</p>\n"))
(with-temp-buffer
@ -2403,7 +2224,7 @@ INDENT was the original indentation of the block."
(concat "\n#+BEGIN_HTML\n" (org-add-props rtn '(org-protected t)) "\n#+END_HTML\n\n"))
((eq backend 'latex)
(setq rtn (org-export-number-lines rtn 'latex 0 0 num cont rpllbl fmt))
(concat "\n#+BEGIN_LaTeX\n"
(concat "#+BEGIN_LaTeX\n"
(org-add-props
(if org-export-latex-listings
(concat
@ -2417,17 +2238,20 @@ INDENT was the original indentation of the block."
org-export-latex-listings-langs))
lang)))
(format "\\lstset{language=%s}\n" lstlang))
"")
"\n")
(when caption
(format "\n%s $\\equiv$ \n" caption))
"\\begin{lstlisting}\n"
rtn "\\end{lstlisting}\n")
(concat (car org-export-latex-verbatim-wrap)
rtn (cdr org-export-latex-verbatim-wrap)))
'(org-protected t))
"#+END_LaTeX\n\n"))
"#+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 "#+BEGIN_ASCII\n"
(concat caption "\n"
"#+BEGIN_ASCII\n"
(org-add-props
(concat
(mapconcat
@ -2546,14 +2370,19 @@ 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]uffer with HTML [D]ocBook [x]OXO [ ]keep buffer")
(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 ?\C-a ?b ?\C-b ?h ?D ?x ?\ )))
(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)
(?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)
@ -2561,6 +2390,12 @@ command."
(?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)

View file

@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -49,7 +49,7 @@
(defgroup org-faces nil
"Faces in Org-mode."
:tag "Org Faces"
:group 'org-font-lock)
:group 'org-appearance)
(defface org-hide
'((((background light)) (:foreground "white"))
@ -338,29 +338,53 @@ 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, or a property
list of attributes, like (:foreground \"blue\" :weight bold :underline t)."
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")
(sexp :tag "face"))))
(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, or a property
list of attributes, like (:foreground \"blue\" :weight bold :underline t)."
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")
(sexp :tag "face"))))
(choice :tag "Face "
(string :tag "Color")
(sexp :tag "Face")))))
(defvar org-tags-special-faces-re nil)
(defun org-set-tag-faces (var value)
@ -378,15 +402,16 @@ list of attributes, like (:foreground \"blue\" :weight bold :underline t)."
(org-copy-face 'org-todo 'org-checkbox-statistics-todo
"Face used for unfinished checkbox statistics.")
"Face used for unfinished checkbox statistics.")
(org-copy-face 'org-done 'org-checkbox-statistics-done
"Face used for finished checkbox statistics.")
"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, or a property list of attributes,
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.
@ -397,8 +422,10 @@ changes."
:set 'org-set-tag-faces
:type '(repeat
(cons
(string :tag "Tag")
(sexp :tag "Face"))))
(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
@ -441,6 +468,34 @@ changes."
: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))
@ -474,6 +529,13 @@ changes."
(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))
@ -502,17 +564,17 @@ changes."
:group 'org-faces)
(org-copy-face 'org-agenda-structure 'org-agenda-date
"Face used in agenda for normal days.")
"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)
"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.")
"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.
"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)
@ -605,6 +667,12 @@ month and 365.24 days for a year)."
"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
@ -634,7 +702,10 @@ If it is less than 8, the level-1 face gets re-used for level N+1 etc."
:group 'org-faces)
(org-copy-face 'modeline 'org-mode-line-clock
"Face used for clock display in mode line.")
"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)

View file

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -234,7 +234,7 @@ following special escapes are valid as well:
:type '(string :tag "Template"))
(defcustom org-feed-save-after-adding t
"Non-nil means, save buffer after adding new feed items."
"Non-nil means save buffer after adding new feed items."
:group 'org-feed
:type 'boolean)

View file

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -47,6 +47,7 @@
(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
(defconst org-footnote-re
@ -90,7 +91,7 @@ of the file, followed by the collected and normalized footnotes."
:type 'string)
(defcustom org-footnote-define-inline nil
"Non-nil means, define footnotes inline, at reference location.
"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."
@ -98,7 +99,7 @@ will be used to define the footnote at the reference position."
:type 'boolean)
(defcustom org-footnote-auto-label t
"Non-nil means, define automatically new labels for footnotes.
"Non-nil means define automatically new labels for footnotes.
Possible values are:
nil prompt the user for each label
@ -115,7 +116,7 @@ plain Automatically create plain number labels like [1]"
(const :tag "Create automatic [N]" plain)))
(defcustom org-footnote-auto-adjust nil
"Non-nil means, automatically adjust footnotes after insert/delete.
"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
@ -132,7 +133,7 @@ The main values of this variable can be set with in-buffer options:
(const :tag "Renumber and Sort" t)))
(defcustom org-footnote-fill-after-inline-note-extraction nil
"Non-nil means, fill paragraphs after extracting footnotes.
"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."
@ -182,7 +183,7 @@ with start and label of the footnote if there is a definition at point."
(message "Edit definition and go back with `C-c &' or, if unique, with `C-c C-c'."))))
(defun org-footnote-goto-next-reference (label)
"Find the definition of the footnote with label LABEL."
"Find the next reference of the footnote with label LABEL."
(interactive "sLabel: ")
(org-mark-ring-push)
(setq label (org-footnote-normalize-label label))
@ -366,7 +367,8 @@ referenced sequence."
;; 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))
(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
@ -397,13 +399,13 @@ referenced sequence."
(skip-chars-backward " \t\n\t")
(delete-region (1+ (point)) (match-beginning 0))))))
(unless sort-only
(replace-match (concat before "[" marker "]"))
(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

View file

@ -5,7 +5,7 @@
;; Author: Lennart Borgman (lennart O borgman A gmail O com)
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -81,6 +81,7 @@
(require 'xml)
(require 'org)
(require 'rx)
(require 'org-exp)
(eval-when-compile (require 'cl))
@ -240,7 +241,7 @@ The characters \"&<> will be escaped."
;; file is utf-8:
;;
;; (format "&#x%x;" (- cc ;; ?\x800))
(format "&#x%x" (encode-char cc 'ucs))
(format "&#x%x;" (encode-char cc 'ucs))
))))
fm-str))
@ -561,11 +562,10 @@ Otherwise give an error say the file exists."
(num-top2-nodes 0)
num-left-nodes
(unclosed-nodes 0)
(odd-only org-odd-levels-only)
(first-time t)
(current-level 1)
base-level
skipping-odd
(skipped-odd 0)
prev-node-end
rich-text
unfinished-tag
@ -671,21 +671,6 @@ Otherwise give an error say the file exists."
(setq next-node-start (match-beginning 0))
(setq next-m2 (match-string-no-properties 2))
(setq next-level (length next-m1))
(when (> next-level current-level)
(if (not (and org-odd-levels-only
(/= (mod current-level 2) 0)
(= next-level (+ 2 current-level))))
(setq skipping-odd nil)
(setq skipping-odd t)
(setq skipped-odd (1+ skipped-odd)))
(unless (or (= next-level (1+ current-level))
skipping-odd)
(if (or org-odd-levels-only
(/= next-level (+ 2 current-level)))
(error "Next level step > +1 for node ending at line %s" (line-number-at-pos))
(error "Next level step = +2 for node ending at line %s, forgot org-odd-levels-only?"
(line-number-at-pos)))
))
(setq next-children-visible
(not (eq 'outline
(get-char-property (line-end-position) 'invisible))))
@ -698,11 +683,8 @@ Otherwise give an error say the file exists."
(while (>= current-level next-level)
(with-current-buffer mm-buffer
(insert "</node>\n")
(setq current-level (1- current-level))
(when (< 0 skipped-odd)
(setq skipped-odd (1- skipped-odd))
(setq current-level (1- current-level)))
)))
(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)
@ -725,7 +707,8 @@ Otherwise give an error say the file exists."
(with-current-buffer mm-buffer
(while (> current-level base-level)
(insert "</node>\n")
(setq current-level (1- current-level))
(setq current-level
(- current-level (if odd-only 2 1)))
))
(with-current-buffer mm-buffer
(insert "</map>")

View file

@ -7,7 +7,7 @@
;; Tassilo Horn <tassilo at member dot fsf dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -48,7 +48,7 @@
(defvaralias 'org-usenet-links-prefer-google 'org-gnus-prefer-web-links))
(defcustom org-gnus-prefer-web-links nil
"Non-nil means, `org-store-link' will create web links to Google groups.
"Non-nil means `org-store-link' will create web links to Google groups.
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."
@ -169,19 +169,28 @@ If `org-store-link' was called with a prefix arg the meaning of
(cond ((and group article)
(gnus-activate-group group t)
(condition-case nil
(let ((articles 1)
group-opened)
(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.")))
(let ((backend (car (gnus-find-method-for-group group))))
(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)
(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))))

View file

@ -5,7 +5,7 @@
;; Author: John Wiegley <johnw at gnu dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -67,52 +67,52 @@ relative to the current effective date."
:type 'boolean)
(defface org-habit-clear-face
'((((background light)) (:background "slateblue"))
'((((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 "powderblue"))
'((((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 "green"))
'((((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 "palegreen"))
'((((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 "yellow"))
'((((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 "palegoldenrod"))
'((((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 "red"))
'((((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 "mistyrose"))
'((((background light)) (:background "#fc9590"))
(((background dark)) (:background "darkred")))
"Face for days on which a task is overdue."
:group 'org-habit
@ -305,6 +305,7 @@ current time."
(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

View file

@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -81,7 +81,7 @@ and corresponding declarations."
(string :tag "Declaration")))))
(defcustom org-export-html-style-include-scripts t
"Non-nil means, include the javascript snippets in exported HTML files.
"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
@ -137,6 +137,7 @@ not be modified."
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; }
@ -153,7 +154,7 @@ 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.
"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."
@ -253,7 +254,7 @@ document title."
: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'.
"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
@ -265,7 +266,7 @@ When nil, the links still point to the plain `.org' file."
:type 'boolean)
(defcustom org-export-html-inline-images 'maybe
"Non-nil means, inline images into exported HTML pages.
"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
@ -333,13 +334,13 @@ will give even lines the class \"tr-even\" and odd lines the class \"tr-odd\"."
(defcustom org-export-html-table-use-header-tags-for-first-column nil
"Non-nil means, format column one in tables with header tags.
"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 validationlink to postamble of HTML exported files."
"Non-nil means add validationlink to postamble of HTML exported files."
:group 'org-export-html
:type '(choice
(const :tag "Nothing" nil)
@ -420,7 +421,7 @@ This may also be a function, building and inserting the postamble.")
"Hook run during HTML export, after blockquote, verse, center are done.")
(defvar org-export-html-final-hook nil
"Hook run during HTML export, after blockquote, verse, center are done.")
"Hook run at the end of HTML export, in the new buffer.")
;;; HTML export
@ -433,7 +434,16 @@ This may also be a function, building and inserting the postamble.")
(file-name-nondirectory
org-current-export-file)))
org-current-export-dir nil "Creating LaTeX image %s"))
(message "Exporting..."))
(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)
@ -443,7 +453,9 @@ 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))
(org-open-file buffer-file-name)
(when org-export-kill-product-buffer-when-displayed
(kill-buffer)))
;;;###autoload
(defun org-export-as-html-batch ()
@ -539,6 +551,7 @@ 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))
@ -624,7 +637,8 @@ PUB-DIR is set, use this as the publishing directory."
(author (plist-get opt-plist :author))
(title (or (and subtree-p (org-export-get-title-from-subtree))
(plist-get opt-plist :title)
(and (not
(and (not body-only)
(not
(plist-get opt-plist :skip-before-1st-heading))
(org-export-grab-title-from-buffer))
(and buffer-file-name
@ -804,7 +818,8 @@ lang=\"%s\" xml:lang=\"%s\">
(push "<ul>\n<li>" thetoc)
(setq lines
(mapcar '(lambda (line)
(if (string-match org-todo-line-regexp 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)
@ -999,7 +1014,7 @@ lang=\"%s\" xml:lang=\"%s\">
"\" 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;"
@ -1125,9 +1140,11 @@ lang=\"%s\" xml:lang=\"%s\">
(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)))))
(setq thefile
(concat thefile
(if (= (string-to-char search) ?#) "" "#")
(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)
@ -1402,7 +1419,7 @@ lang=\"%s\" xml:lang=\"%s\">
(when (and org-export-author-info author)
(insert "<p class=\"author\"> "
(nth 1 lang-words) ": " author "\n")
(when email
(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;"
@ -1469,6 +1486,12 @@ lang=\"%s\" xml:lang=\"%s\">
(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))
@ -1506,10 +1529,12 @@ lang=\"%s\" xml:lang=\"%s\">
"Create image tag with source and attributes."
(save-match-data
(if (string-match "^ltxpng/" src)
(format "<img src=\"%s\"/>" 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\">
@ -1585,16 +1610,10 @@ lang=\"%s\" xml:lang=\"%s\">
;; column and the special lines
(setq lines (org-table-clean-before-export lines)))
(let* ((caption (or (get-text-property 0 'org-caption (car lines))
(get-text-property (or (next-single-property-change
0 'org-caption (car lines))
0)
'org-caption (car lines))))
(attributes (or (get-text-property 0 'org-attributes (car lines))
(get-text-property (or (next-single-property-change
0 'org-attributes (car lines))
0)
'org-attributes (car lines))))
(let* ((caption (org-find-text-property-in-string 'org-caption (car lines)))
(label (org-find-text-property-in-string 'org-label (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
@ -1604,6 +1623,7 @@ lang=\"%s\" xml:lang=\"%s\">
(nline 0) fnum i
tbopen line fields html gr colgropen rowstart rowend)
(setq caption (and caption (org-html-do-expand caption)))
(if splice (setq head nil))
(unless splice (push (if head "<thead>" "<tbody>") html))
(setq tbopen t)
@ -1676,6 +1696,8 @@ lang=\"%s\" xml:lang=\"%s\">
;; 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))
(concat (mapconcat 'identity html "\n") "\n")))
@ -1865,14 +1887,16 @@ 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-html-do-expand s) res)
(push l res))
(push (org-html-do-expand string) res)
(apply 'concat (nreverse 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."
@ -1887,16 +1911,14 @@ If there are links in the string, don't modify these."
(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 ass)
(while (setq start (string-match "\\\\\\([a-zA-Z]+\\)\\({}\\)?"
(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 ass (assoc wd org-html-entities))
(setq s (replace-match (or (cdr ass)
(concat "&" (car ass) ";"))
t t s))
(if (setq rep (org-entity-get-representation wd 'html))
(setq s (replace-match rep t t s))
(setq start (+ start (length wd))))))))
s)
@ -1994,8 +2016,11 @@ If there are links in the string, don't modify these."
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 (assoc target org-export-target-aliases))
(preferred (cdr (assoc target org-export-preferred-target-alist)))
(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))))
(remove (or preferred target))
(l org-level-max)
snumber href suffix)
@ -2058,8 +2083,9 @@ When TITLE is nil, just close all open levels."
(setq href (cdr (assoc (concat "sec-" snumber) org-export-preferred-target-alist)))
(setq suffix (or href snumber))
(setq href (or href (concat "sec-" snumber)))
(insert (format "\n<div id=\"outline-container-%s\" class=\"outline-%d\">\n<h%d id=\"%s\">%s%s</h%d>\n<div class=\"outline-text-%d\" id=\"text-%s\">\n"
suffix level level href
(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)))))

View file

@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -48,7 +48,7 @@ The file name should be absolute, the file will be overwritten without warning."
:type 'string)
(defcustom org-icalendar-use-plain-timestamp t
"Non-nil means, make an event from every plain time stamp."
"Non-nil means make an event from every plain time stamp."
:group 'org-export-icalendar
:type 'boolean)
@ -104,7 +104,7 @@ all-tags All tags, including inherited ones."
(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.
"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
@ -129,13 +129,13 @@ 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.
"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.
"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)
@ -152,7 +152,7 @@ The text will be inserted into the DESCRIPTION field."
(integer :tag "Max characters")))
(defcustom org-icalendar-store-UID nil
"Non-nil means, store any created UIDs in properties.
"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

View file

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -123,7 +123,7 @@ to have no space characters in them."
(string :tag "Prefix")))
(defcustom org-id-include-domain nil
"Non-nil means, add the domain name to new IDs.
"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
@ -135,7 +135,7 @@ people to make this necessary."
:type 'boolean)
(defcustom org-id-track-globally t
"Non-nil means, track IDs through files, so that links work globally.
"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.
@ -178,7 +178,7 @@ This variable is only relevant when `org-id-track-globally' is set."
(file))))
(defcustom org-id-search-archives t
"Non-nil means, search also the archive files of agenda files for entries.
"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."
@ -466,7 +466,7 @@ When CHECK is given, prepare detailed information about duplicate IDs."
(defun org-id-locations-save ()
"Save `org-id-locations' in `org-id-locations-file'."
(when org-id-track-globally
(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)))
@ -545,7 +545,9 @@ When CHECK is given, prepare detailed information about duplicate IDs."
(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 (gethash id org-id-locations)
(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)))))
@ -576,6 +578,7 @@ optional argument MARKERP, return the position as a new marker."
"Store a link to the current entry, using its ID."
(interactive)
(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)

View file

@ -4,7 +4,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -38,7 +38,7 @@
(defgroup org-indent nil
"Options concerning dynamic virtual outline indentation."
:tag "Org Structure"
:tag "Org Indent"
:group 'org)
(defconst org-indent-max 40
@ -67,13 +67,13 @@ it may be prettier to customize the org-indent face."
:type 'character)
(defcustom org-indent-mode-turns-off-org-adapt-indentation t
"Non-nil means, turning on org-indent-mode turns off indentation adaptation.
"Non-nil means turning on `org-indent-mode' turns 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, turning on org-indent-mode turns on `org-hide-leading-stars'."
"Non-nil means turning on `org-indent-mode' turns on `org-hide-leading-stars'."
:group 'org-indent
:type 'boolean)
@ -227,7 +227,7 @@ Assumes that BEG is at the beginning of a line."
b e (list 'line-prefix (aref org-indent-strings n)
'wrap-prefix (aref org-indent-strings n))))
(setq b (1+ (point-at-eol))
n (* level org-indent-indentation-per-level))))))))
n (* (or level 0) org-indent-indentation-per-level))))))))
(defun org-indent-refresh-section ()
"Refresh indentation properties in the current outline section.

View file

@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;

View file

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;; This file is part of GNU Emacs.
@ -94,7 +94,7 @@ the value of this variable."
:type 'boolean)
(defcustom org-inlinetask-export t
"Non-nil means, export inline tasks.
"Non-nil means export inline tasks.
When nil, they will not be exported."
:group 'org-inlinetask
:type 'boolean)
@ -149,7 +149,17 @@ Either remove headline and meta data, or do special formatting."
(when (string-match org-complex-heading-regexp headline)
(setq headline (concat
(if (match-end 2)
(concat (match-string 2 headline) " ") "")
(concat
(org-add-props
(format
"@<span class=\"%s %s\"> %s@</span>"
(if (member (match-string 2 headline)
org-done-keywords)
"done" "todo")
(match-string 2 headline)
(match-string 2 headline))
nil 'org-protected t)
" ") "")
(match-string 4 headline)))
(when content
(if (not (string-match "\\S-" content))
@ -232,5 +242,4 @@ Either remove headline and meta data, or do special formatting."
(provide 'org-inlinetask)
;; arch-tag: 59fdac51-8bcc-469e-a21e-6897dd6697bb
;;; org-inlinetask.el ends here

View file

@ -4,7 +4,7 @@
;;
;; Author: Philip Jackson <emacs@shellarchive.co.uk>
;; Keywords: erc, irc, link, org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;

View file

@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;

File diff suppressed because it is too large Load diff

View file

@ -7,7 +7,7 @@
;; Bastien Guerry <bzg AT altern DOT org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -125,13 +125,15 @@ the bullet in each item of he list."
(regexp)))
(defcustom org-empty-line-terminates-plain-lists nil
"Non-nil means, an empty line ends all plain list levels.
"Non-nil means an empty line ends all plain list levels.
This is currently effective only during export. It should also have
an effect for indentation and plain list folding, but it does not.
When nil, empty lines are part of the preceding item."
:group 'org-plain-lists
:type 'boolean)
(defcustom org-auto-renumber-ordered-lists t
"Non-nil means, automatically renumber ordered plain lists.
"Non-nil means automatically renumber ordered plain lists.
Renumbering happens when the sequence have been changed with
\\[org-shiftmetaup] or \\[org-shiftmetadown]. After other editing commands,
use \\[org-ctrl-c-ctrl-c] to trigger renumbering."
@ -139,7 +141,7 @@ use \\[org-ctrl-c-ctrl-c] to trigger renumbering."
:type 'boolean)
(defcustom org-provide-checkbox-statistics t
"Non-nil means, update checkbox statistics after insert and toggle.
"Non-nil means update checkbox statistics after insert and toggle.
When this is set, checkbox statistics is updated each time you
either insert a new checkbox with \\[org-insert-todo-heading] or
toggle a checkbox with \\[org-ctrl-c-ctrl-c]."
@ -147,7 +149,7 @@ toggle a checkbox with \\[org-ctrl-c-ctrl-c]."
:type 'boolean)
(defcustom org-hierarchical-checkbox-statistics t
"Non-nil means, checkbox statistics counts only the state of direct children.
"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."
@ -432,7 +434,9 @@ the whole buffer."
(recursive
(or (not org-hierarchical-checkbox-statistics)
(string-match "\\<recursive\\>"
(or (org-entry-get nil "COOKIE_DATA") ""))))
(or (ignore-errors
(org-entry-get nil "COOKIE_DATA"))
""))))
(cstat 0)
)
(when all
@ -614,7 +618,8 @@ Error if not at a plain list, or if this is the first item in the list."
(if (looking-at "[ \t]*$")
nil
(if (<= (setq ind1 (org-get-indentation)) ind)
(throw 'exit t)))))
(throw 'exit t)))
(if (bobp) (throw 'exit t))))
(condition-case nil
(if (or (not (org-at-item-p))
(< ind1 (1- ind)))
@ -847,7 +852,7 @@ Also, fix the indentation."
(interactive)
(unless (org-at-item-p) (error "This is not a list"))
(let ((line (org-current-line))
(col (current-column))
(chars-from-eol (- (point-at-eol) (point)))
(ind (current-indentation))
ind1 bullet oldbullet)
;; find where this list begins
@ -878,7 +883,7 @@ Also, fix the indentation."
(org-shift-item-indentation (- (length bullet)
(length oldbullet))))))
(org-goto-line line)
(org-move-to-column col)
(goto-char (max (point-at-bol) (- (point-at-eol) chars-from-eol)))
(if (string-match "[0-9]" bullet)
(org-renumber-ordered-list 1))))
@ -1049,7 +1054,7 @@ Assumes cursor in item line."
(org-adapt-indentation nil))
(cond
((and (looking-at "[ \t]*$")
(looking-back "^\\([ \t]*\\)\\([-+*]\\|[0-9]+[).]\\)[ \t]+"))
(org-looking-back "^\\([ \t]*\\)\\([-+*]\\|[0-9]+[).]\\)[ \t]+"))
(setq this-command 'org-cycle-item-indentation)
(if (eq last-command 'org-cycle-item-indentation)
(condition-case nil
@ -1081,7 +1086,10 @@ Return a list containing first level items as strings and
sublevels as a list of strings."
(let* ((item-beginning (org-list-item-beginning))
(start (car item-beginning))
(end (org-list-end (cdr item-beginning)))
(end (save-excursion
(goto-char (org-list-end (cdr item-beginning)))
(org-back-over-empty-lines)
(point)))
output itemsep ltype)
(while (re-search-forward org-list-beginning-re end t)
(goto-char (match-beginning 3))

View file

@ -5,7 +5,7 @@
;; Author: John Wiegley <johnw@gnu.org>
;; Christopher Suckling <suckling at gmail dot com>
;; Version: 6.33x
;; Version: 6.35i
;; Keywords: outlines, hypermedia, calendar, wp
;; This file is part of GNU Emacs.
@ -209,7 +209,7 @@ list of message:// links to flagged mail after heading."
(insert "\n" (org-mac-message-get-links "f")))
(goto-char (point-max))
(insert "\n")
(org-insert-heading)
(org-insert-heading nil t)
(insert org-heading "\n" (org-mac-message-get-links "f"))))))
(provide 'org-mac-message)

View file

@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -63,6 +63,8 @@ Also, do not record undo information."
(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))
@ -123,6 +125,14 @@ We use a macro so that the test can happen at compilation time."
,@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."

View file

@ -5,7 +5,7 @@
;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;; This file is part of GNU Emacs.

View file

@ -6,7 +6,7 @@
;; Author: Thomas Baumann <thomas dot baumann at ch dot tum dot de>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;

View file

@ -4,7 +4,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -47,7 +47,7 @@ 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
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
@ -65,6 +65,34 @@ org-agenda-text-search-extra-files
: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."
: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.
Note that, whe Org runs the encryption commands, the password could
be visible 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."
:group 'org-mobile
:type '(string :tag "Password"))
(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
@ -85,13 +113,29 @@ 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 and ID."
:group 'org-mobile
:type 'boolean)
(defcustom org-mobile-force-mobile-change nil
"Non-nil means, force the change made on the mobile device.
"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.
@ -247,15 +291,14 @@ create all custom agenda views, for upload to the mobile phone."
(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 in the current buffer, and the buffer is arrowed to the
new captured data.")
The inbox file is visited by the current buffer, and the buffer is
narrowed to the newly captured data.")
;;;###autoload
(defun org-mobile-pull ()
@ -305,7 +348,16 @@ agenda view showing the flagged items."
(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")))
"Variable `org-mobile-inbox-for-pull' must point to a file in an existing directory"))
(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 entryption 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."
@ -314,7 +366,7 @@ agenda view showing the flagged items."
(def-todo (default-value 'org-todo-keywords))
(def-tags (default-value 'org-tag-alist))
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
@ -385,7 +437,9 @@ agenda view showing the flagged items."
target-dir (file-name-directory target-path))
(unless (file-directory-p target-dir)
(make-directory target-dir 'parents))
(copy-file file target-path 'ok-if-exists)
(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)))))
@ -426,8 +480,22 @@ The table of checksums is written to the file mobile-checksums."
((not (nth 1 x)) (cons (car x) (cons "" (cddr x))))
(t (cons (car x) (cons "" (cdr x))))))
org-agenda-custom-commands)))
new e key desc type match settings cmds gkey gdesc gsettings cnt)
(while (setq e (pop custom-list))
(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
@ -438,7 +506,12 @@ The table of checksums is written to the file mobile-checksums."
((memq (nth 2 e) '(todo-tree tags-tree occur-tree))
;; These are trees, not really agenda commands
)
((memq (nth 2 e) '(agenda todo tags))
((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))
@ -541,26 +614,66 @@ The table of checksums is written to the file mobile-checksums."
(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 file)))))
(list (append sumo (list (list file1)))))
(org-mobile-creating-agendas t))
(unless (file-writable-p file)
(error "Cannot write to file %s" file))
(unless (file-writable-p file1)
(error "Cannot write to file %s" file1))
(when sumo
(org-store-agenda-views))))
(org-store-agenda-views))
(when org-mobile-use-encryption
(org-mobile-encrypt-file file1 file)
(delete-file file1))))
(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-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 ((inbox-buffer (find-file-noselect org-mobile-inbox-for-pull))
(capture-buffer (find-file-noselect
(expand-file-name org-mobile-capture-file
org-mobile-directory)))
(insertion-point (make-marker))
not-empty content)
(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)
(delete-file org-mobile-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))
@ -577,9 +690,13 @@ If nothing new has been added, return nil."
(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))
(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
@ -856,7 +973,7 @@ be returned that indicates what went wrong."
(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 ":+"))
@ -869,7 +986,7 @@ be returned that indicates what went wrong."
(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)))
@ -895,7 +1012,7 @@ be returned that indicates what went wrong."
(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)
@ -915,7 +1032,7 @@ be returned that indicates what went wrong."
(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?"

View file

@ -4,7 +4,7 @@
;;
;; Author: Piotr Zielinski <piotr dot zielinski at gmail dot com>
;; Maintainer: Carsten Dominik <carsten at orgmode dot org>
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -189,7 +189,7 @@ Changing this variable requires a restart of Emacs to get activated."
(interactive)
(end-of-line)
(skip-chars-backward "\t ")
(when (looking-back ":[A-Za-z]+:")
(when (org-looking-back ":[A-Za-z]+:")
(skip-chars-backward ":A-Za-z")
(skip-chars-backward "\t ")))
@ -607,7 +607,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
(:end ; insert text here
(skip-chars-backward " \t")
(kill-region (point) (point-at-eol))
(unless (looking-back org-mouse-punctuation)
(unless (org-looking-back org-mouse-punctuation)
(insert (concat org-mouse-punctuation " ")))))
(insert text)
@ -674,7 +674,7 @@ SCHEDULED: or DEADLINE: or ANYTHINGLIKETHIS:"
'org-mode-restart))))
((or (eolp)
(and (looking-at "\\( \\|\t\\)\\(+:[0-9a-zA-Z_:]+\\)?\\( \\|\t\\)+$")
(looking-back " \\|\t")))
(org-looking-back " \\|\t")))
(org-mouse-popup-global-menu))
((get-context :checkbox)
(popup-menu

View file

@ -5,7 +5,7 @@
;; Author: Eric Schulte <schulte dot eric at gmail dot com>
;; Keywords: tables, plotting
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -134,7 +134,7 @@ Pass PARAMS through to `orgtbl-to-generic' when exporting TABLE."
(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.
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)
@ -250,8 +250,9 @@ manner suitable for prepending to a user-specified script."
(setf plot-lines
(cons
(format plot-str data-file
(or (and (not text-ind) ind
(> ind 0) (format "%d:" ind)) "")
(or (and ind (> ind 0)
(not text-ind)
(format "%d:" ind)) "")
(+ 1 col)
(if text-ind (format ":xticlabel(%d)" ind) "")
with
@ -300,7 +301,7 @@ line directly before or after the table."
(setf table (delq 'hline (cdr table)))) ;; clean non-data from table
;; collect options
(save-excursion (while (and (equal 0 (forward-line -1))
(looking-at "#\\+"))
(looking-at "[[:space:]]*#\\+"))
(setf params (org-plot/collect-options params))))
;; dump table to datafile (very different for grid)
(case (plist-get params :plot-type)
@ -320,7 +321,6 @@ line directly before or after the table."
(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

View file

@ -9,7 +9,7 @@
;; Author: Ross Patterson <me AT rpatterson DOT net>
;; Maintainer: Sebastian Rose <sebastian_rose AT gmx DOT de>
;; Keywords: org, emacsclient, wp
;; Version: 6.33x
;; Version: 6.35i
;; This file is part of GNU Emacs.
;;
@ -470,9 +470,10 @@ Now template ?b will be used."
(url (org-protocol-sanitize-uri (car parts)))
(type (if (string-match "^\\([a-z]+\\):" url)
(match-string 1 url)))
(title (cadr parts))
(region (caddr parts))
(orglink (org-make-link-string url title))
(title (or (cadr parts) ""))
(region (or (caddr parts) ""))
(orglink (org-make-link-string
url (if (string-match "[^[:space:]]" title) title url)))
remember-annotation-functions)
(setq org-stored-links
(cons (list url title) org-stored-links))

View file

@ -1,10 +1,11 @@
;;; org-publish.el --- publish related org-mode files as a website
;; Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
;; 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: 6.33x
;; Version: 6.35i
;; This file is part of GNU Emacs.
;;
@ -31,7 +32,7 @@
;; + 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 index of pages
;; + Publish a clickable sitemap of pages
;; + Manage local timestamps for publishing only changed files
;; + Accept plugin functions to extend range of publishable content
;;
@ -39,6 +40,17 @@
;;; 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)
@ -112,9 +124,11 @@ 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 project. This may also be a list
of functions.
:completion-function Function to be called after publishing
this project.
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
@ -144,22 +158,22 @@ learn more about their use and default values.
:author `user-full-name'
:email `user-mail-address'
The following properties may be used to control publishing of an
index of files or summary page for a given project.
The following properties may be used to control publishing of a
sitemap of files or summary page for a given project.
:auto-index Whether to publish an index during
:auto-sitemap Whether to publish a sitemap during
`org-publish-current-project' or `org-publish-all'.
:index-filename Filename for output of index. Defaults
:sitemap-filename Filename for output of sitemap. Defaults
to 'sitemap.org' (which becomes 'sitemap.html').
:index-title Title of index page. Defaults to name of file.
:index-function Plugin function to use for generation of index.
Defaults to `org-publish-org-index', which
: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.
:index-style Can be `list' (index is just an itemized list
: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 index). Defaults to
files is reflected in the sitemap). Defaults to
`tree'."
:group 'org-publish
:type 'alist)
@ -177,7 +191,7 @@ When nil, do no timestamp checking and always publish all files."
:type 'directory)
(defcustom org-publish-list-skipped-files t
"Non-nil means, show message about files *not* published."
"Non-nil means show message about files *not* published."
:group 'org-publish
:type 'boolean)
@ -306,6 +320,7 @@ This is a compatibility function for Emacsen without `delete-dups'."
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
@ -426,8 +441,8 @@ PUB-DIR is the publishing directory."
(buffer-live-p export-buf-or-file))
(set-buffer export-buf-or-file)
;; run hooks after export and save export
(and (run-hooks 'org-publish-after-export-hook)
(if (buffer-modified-p) (save-buffer)))
(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)
@ -439,20 +454,33 @@ PUB-DIR is the publishing directory."
(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-org-to "latex" plist filename pub-dir))
(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-org-to "pdf" plist filename pub-dir))
(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-org-to "html" plist filename pub-dir))
(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.
@ -518,31 +546,39 @@ See `org-publish-org-to' to the list of arguments."
(defun org-publish-projects (projects)
"Publish all files belonging to the PROJECTS alist.
If :auto-index is set, publish the index too."
If :auto-sitemap is set, publish the sitemap too.
If :makeindex is set, also produce a file theindex.org."
(mapc
(lambda (project)
(let*
((project-plist (cdr project))
(exclude-regexp (plist-get project-plist :exclude))
(index-p (plist-get project-plist :auto-index))
(index-filename (or (plist-get project-plist :index-filename)
"sitemap.org"))
(index-function (or (plist-get project-plist :index-function)
'org-publish-org-index))
(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 (funcall preparation-function))
(if index-p (funcall index-function project index-filename))
(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))
(when completion-function (funcall completion-function))))
(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))
(when completion-function (run-hooks 'completion-function))))
(org-publish-expand-projects projects)))
(defun org-publish-org-index (project &optional index-filename)
"Create an index of pages in set defined by PROJECT.
Optionally set the filename of the index with INDEX-FILENAME.
Default for INDEX-FILENAME is 'sitemap.org'."
(defun org-publish-org-sitemap (project &optional sitemap-filename)
"Create an 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)))
@ -550,28 +586,28 @@ Default for INDEX-FILENAME is 'sitemap.org'."
(indent-str (make-string 2 ?\ ))
(exclude-regexp (plist-get project-plist :exclude))
(files (nreverse (org-publish-get-base-files project exclude-regexp)))
(index-filename (concat dir (or index-filename "sitemap.org")))
(index-title (or (plist-get project-plist :index-title)
(concat "Index for project " (car project))))
(index-style (or (plist-get project-plist :index-style)
(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 index-filename))
(ifn (file-name-nondirectory index-filename))
file index-buffer)
(with-current-buffer (setq index-buffer
(or visiting (find-file index-filename)))
(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: " index-title "\n\n"))
(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))
;; index shouldn't index itself
(unless (equal (file-truename index-filename)
;; sitemap shouldn't list itself
(unless (equal (file-truename sitemap-filename)
(file-truename file))
(if (eq index-style 'list)
(message "Generating list-style index for %s" index-title)
(message "Generating tree-style index for %s" index-title)
(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)
@ -600,7 +636,7 @@ Default for INDEX-FILENAME is 'sitemap.org'."
(org-publish-find-title file)
"]]\n")))))
(save-buffer))
(or visiting (kill-buffer index-buffer))))
(or visiting (kill-buffer sitemap-buffer))))
(defun org-publish-find-title (file)
"Find the title of file in project."
@ -650,18 +686,19 @@ directory and force publishing all files."
(interactive "P")
(when force
(org-publish-remove-all-timestamps))
(org-publish-initialize-files-alist)
(org-publish-initialize-files-alist force)
(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")
(org-publish-initialize-files-alist)
(org-publish-initialize-files-alist force)
(save-window-excursion
(let ((org-publish-use-timestamps-flag
(if force nil org-publish-use-timestamps-flag)))
@ -673,7 +710,7 @@ With prefix argument, force publish the file."
With a prefix argument, force publishing of all files in
the project."
(interactive "P")
(org-publish-initialize-files-alist)
(org-publish-initialize-files-alist force)
(save-window-excursion
(let ((project (org-publish-get-project-from-filename (buffer-file-name) 'up))
(org-publish-use-timestamps-flag
@ -682,6 +719,96 @@ the project."
(error "File %s is not part of any known project" (buffer-file-name)))
(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
(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)
;; `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))
(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 "::#" target "]"
"[" (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)))))
(provide 'org-publish)

View file

@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -54,7 +54,7 @@
:group 'org)
(defcustom org-remember-store-without-prompt t
"Non-nil means, `C-c C-c' stores remember note without further prompts.
"Non-nil means `C-c C-c' stores 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
@ -131,7 +131,7 @@ Furthermore, the following %-escapes will be replaced with content:
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
%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
@ -225,7 +225,7 @@ for a Remember buffer.")
(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.
"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
@ -248,7 +248,7 @@ See also `org-remember-auto-remove-backup-files'."
(directory :tag "Directory")))
(defcustom org-remember-auto-remove-backup-files t
"Non-nil means, remove remember backup files after successfully storage.
"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
@ -351,7 +351,7 @@ RET at beg-of-buf -> Append to file as level 2 headline
org-force-remember-template-char))
(t
(setq msg (format
"Select template: %s"
"Select template: %s%s"
(mapconcat
(lambda (x)
(cond
@ -362,13 +362,17 @@ RET at beg-of-buf -> Append to file as level 2 headline
(format "[%c]%s" (car x)
(substring (nth 1 x) 1)))
(t (format "[%c]%s" (car x) (nth 1 x)))))
templates " ")))
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-g))
(not (equal char0 ?C)))
(message "No such template \"%c\"" char0)
(ding) (sit-for 1)
(setq char0 nil)))
@ -376,6 +380,11 @@ RET at beg-of-buf -> Append to file as level 2 headline
(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)))))
@ -470,7 +479,7 @@ to be run from that hook to function properly."
## 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 of the currently clocked item
## 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))
@ -479,21 +488,6 @@ to be run from that hook to function properly."
(or (cdr org-remember-previous-location) "???")
(if org-remember-store-without-prompt "C-1 C-c C-c" " C-c C-c"))))
(insert tpl)
(goto-char (point-min))
;; Simple %-escapes
(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)))
;; %[] Insert contents of a file.
(goto-char (point-min))
@ -508,6 +502,21 @@ to be run from that hook to function properly."
(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)
@ -860,6 +869,7 @@ See also the variable `org-reverse-note-order'."
(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
@ -882,7 +892,7 @@ See also the variable `org-reverse-note-order'."
visiting (and file (org-find-base-buffer-visiting file))
heading (cdr org-remember-previous-location)
fastp t))
(when clockp
(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
@ -1015,7 +1025,9 @@ See also the variable `org-reverse-note-order'."
(beginning-of-line 2)
(end-of-line 1)
(insert "\n"))))
(org-paste-subtree (org-get-valid-level level 1) txt)
(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)))

View file

@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;

View file

@ -8,7 +8,7 @@
;; Dan Davison <davison at stats dot ox dot ac dot uk>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -38,6 +38,7 @@
(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))
@ -113,7 +114,6 @@ 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:
@ -192,7 +192,7 @@ There is a mode hook, and keybindings for `org-edit-src-exit' and
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
the edited version. Optional argument CONTEXT is used by
\\[org-edit-src-save] when calling this function."
(interactive)
(unless (eq context 'save)
@ -221,6 +221,13 @@ the edited version. Optional argument CONTEXT is used by
block-nindent (nth 5 info)
lang-f (intern (concat lang "-mode"))
begline (save-excursion (goto-char beg) (org-current-line)))
(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))
(org-goto-line line)
@ -452,6 +459,15 @@ the language, a switch telling if the content should be in a single line."
(pos (point))
re1 re2 single beg end lang lfmt match-re1 ind entry)
(catch 'exit
(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)))
(while (setq entry (pop re-list))
(setq re1 (car entry) re2 (nth 1 entry) lang (nth 2 entry)
single (nth 3 entry))
@ -515,6 +531,7 @@ the language, a switch telling if the content should be in a single line."
(interactive)
(unless 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)
@ -525,7 +542,7 @@ the language, a switch telling if the content should be in a single line."
org-edit-src-content-indentation))
(preserve-indentation org-src-preserve-indentation)
(delta 0) code line col indent)
(untabify (point-min) (point-max))
(unless preserve-indentation (untabify (point-min) (point-max)))
(save-excursion
(goto-char (point-min))
(if (looking-at "[ \t\n]*\n") (replace-match ""))
@ -575,8 +592,15 @@ the language, a switch telling if the content should be in a single line."
(insert code)
(goto-char beg)
(if single (just-one-space))
(org-goto-line (1- (+ (org-current-line) line)))
(org-move-to-column (if preserve-indentation col (+ col total-nindent delta)))
(if (memq t (mapcar (lambda (overlay)
(eq (org-overlay-get overlay 'invisible)
'org-hide-block))
(org-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)

View file

@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -49,7 +49,7 @@
(defvar constants-unit-system)
(defcustom orgtbl-optimized (eq org-enable-table-editor 'optimized)
"Non-nil means, use the optimized table editor version for `orgtbl-mode'.
"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
@ -142,14 +142,14 @@ alignment to the right border applies."
:group 'org-table)
(defcustom org-table-automatic-realign t
"Non-nil means, automatically re-align table when pressing TAB or RETURN.
"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.
"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'."
@ -157,7 +157,7 @@ Only relevant when `org-enable-table-editor' is equal to `optimized'."
: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.
"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
@ -183,7 +183,7 @@ t: accept as input and present for editing"
(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]."
"Non-nil means increment when copying current field with \\[org-table-copy-down]."
:group 'org-table-calculation
:type 'boolean)
@ -204,7 +204,7 @@ relies on the variables to be present in the list."
:type 'plist)
(defcustom org-table-formula-evaluate-inline t
"Non-nil means, TAB and RET evaluate a formula in current table field.
"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
@ -215,7 +215,7 @@ the command \\[org-table-eval-formula]."
:type 'boolean)
(defcustom org-table-formula-use-constants t
"Non-nil means, interpret constants in formulas in tables.
"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."
@ -241,8 +241,8 @@ Constants can also be defined on a per-file basis using a line like
(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."
"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)
@ -252,7 +252,7 @@ Automatically means, when TAB or RET or C-c C-c are pressed in the line."
:type 'boolean)
(defcustom org-table-relative-ref-may-cross-hline t
"Non-nil means, relative formula references may cross hlines.
"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
@ -567,7 +567,7 @@ This is being used to correctly align a single field after TAB or RET.")
"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.
"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
@ -575,6 +575,7 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
(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.")
@ -621,7 +622,8 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
;; Check if we are narrowing any columns
(goto-char beg)
(setq narrow (and org-format-transports-properties-p
(setq narrow (and org-table-do-narrow
org-format-transports-properties-p
(re-search-forward "<[rl]?[0-9]+>" end t)))
(goto-char beg)
(setq falign (re-search-forward "<[rl][0-9]*>" end t))
@ -660,13 +662,14 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
(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 "^<\\([rl]\\)?\\([0-9]+\\)?>$" e))
(if (match-end 1) (setq falign1 (match-string 1 e)))
(if (match-end 2)
(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
@ -685,7 +688,8 @@ When nil, simply write \"#ERROR\" in corrupted fields.")
(list 'display org-narrow-column-arrow)
xx)))))
;; Get the maximum width for each column
(push (apply 'max 1 (mapcar 'org-string-width column)) lengths)
(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)
@ -1003,6 +1007,47 @@ This actually throws an error, so it aborts the current command."
(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, als 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)
@ -1102,22 +1147,20 @@ 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")
(let ((pos (point-at-eol)))
(beginning-of-line 1)
(when (> n 0)
(while (and (> (setq n (1- n)) -1)
(or (search-forward "|" pos t)
(and force
(progn (end-of-line 1)
(skip-chars-backward "^|")
(insert " | "))))))
; (backward-char 2) 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))))))
(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."
@ -2243,6 +2286,20 @@ not overwrite the stored one."
(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
@ -2340,7 +2397,7 @@ $1-> %s\n" orig formula form0 form))
"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."
HIGHLIGHT means just highlight the range."
(if (not (equal (string-to-char desc) ?@))
(setq desc (concat "@" desc)))
(save-excursion
@ -2797,6 +2854,12 @@ full TBLFM line."
(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

View file

@ -5,7 +5,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -48,6 +48,24 @@ the value of the relative timer."
:group 'org-time
:type 'string)
(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.
@ -82,7 +100,8 @@ the region 0:00:00."
(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))))))
(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 it entirely."
@ -103,6 +122,7 @@ the region 0:00:00."
(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)))))
@ -110,6 +130,7 @@ the region 0:00:00."
(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))
@ -254,37 +275,28 @@ VALUE can be `on', `off', or `pause'."
(concat " <" (substring (org-timer-value-string) 0 -1) ">"))
(force-mode-line-update)))
(defvar org-timer-timer1 nil)
(defvar org-timer-timer2 nil)
(defvar org-timer-timer3 nil)
(defvar org-timer-last-timer nil)
(defun org-timer-cancel-timers ()
"Reset all timers."
(defvar org-timer-current-timer nil)
(defun org-timer-cancel-timer ()
"Cancel the current timer."
(interactive)
(mapc (lambda(timer)
(when (eval timer)
(cancel-timer timer)
(setq timer nil)))
'(org-timer-timer1
org-timer-timer2
org-timer-timer3))
(message "All timers reset"))
(when (eval org-timer-current-timer)
(run-hooks 'org-timer-cancel-hook)
(cancel-timer org-timer-current-timer)
(setq org-timer-current-timer nil))
(message "Last timer canceled"))
(defun org-timer-show-remaining-time ()
"Display the remaining time before the timer ends."
(interactive)
(require 'time)
(if (and (not org-timer-timer1)
(not org-timer-timer2)
(not org-timer-timer3))
(if (not org-timer-current-timer)
(message "No timer set")
(let* ((rtime (decode-time
(time-subtract (timer--time org-timer-last-timer)
(time-subtract (timer--time org-timer-current-timer)
(current-time))))
(rsecs (nth 0 rtime))
(rmins (nth 1 rtime)))
(message "%d minutes %d seconds left before next time out"
(message "%d minute(s) %d seconds left before next time out"
rmins rsecs))))
;;;###autoload
@ -311,16 +323,15 @@ VALUE can be `on', `off', or `pause'."
(org-get-heading))
(t (error "Not in an Org buffer"))))
timer-set)
(mapcar (lambda(timer)
(when (not (or (eval timer) timer-set))
(setq timer-set t)
(setq org-timer-last-timer
(run-with-timer
secs nil 'org-notify (format "%s: time out" hl) t))
(set timer org-timer-last-timer)))
'(org-timer-timer1
org-timer-timer2
org-timer-timer3)))))
(if org-timer-current-timer
(error "You cannot run several timers at the same time")
(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)
(run-hooks 'org-timer-done-hook))))
(run-hooks 'org-timer-set-hook)))))
(provide 'org-timer)

View file

@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;

View file

@ -5,7 +5,7 @@
;; Author: Andy Stewart <lazycat dot manatee at gmail dot com>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;

View file

@ -6,7 +6,7 @@
;; Author: Tokuya Kameshima <kames at fa2 dot so-net dot ne dot jp>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -104,6 +104,10 @@
(subject (let (wl-thr-indent-string wl-parent-message-entity)
(wl-summary-line-subject)))
desc link)
;; remove text properties of subject string to avoid possible bug
;; when formatting the subject
(set-text-properties 0 (length subject) nil subject)
(org-store-link-props :type "wl" :from from :to to
:subject subject :message-id message-id)
(setq message-id (org-remove-angle-brackets message-id))

View file

@ -6,7 +6,7 @@
;; Author: Carsten Dominik <carsten at orgmode dot org>
;; Keywords: outlines, hypermedia, calendar, wp
;; Homepage: http://orgmode.org
;; Version: 6.33x
;; Version: 6.35i
;;
;; This file is part of GNU Emacs.
;;
@ -43,6 +43,7 @@
"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

File diff suppressed because it is too large Load diff