* org-pcomplete.el (pcomplete/org-mode/file-option/x):
Resurrect. Use `org-default-options' to initialize completion
fonctions for the most important keywords.
* org-macs.el (org-default-options): Rename and adapt from
`org-get-current-options'.
This is a partial revert of e14cf780 feature-wise. The idea is
that it may be useful to get completion, even when it ends up with
the default value, because the user may want to adapt the default
values instead of re-typing them.
* lisp/org-macs.el (org-if-unprotected, org-if-unprotected-1,
org-if-unprotected-at): Removed macros.
(org-re-search-forward-unprotected): Removed function.
* lisp/org.el (org-format-latex): Remove reference to `org-protected'.
* lisp/org-list.el (org-list-struct): Remove reference to
`org-example' and `org-protected'.
* lisp/org-footnote.el (org-footnote-at-reference-p): Remove reference
to `org-protected'.
* lisp/org-capture.el (org-capture-fill-template): Remove reference to
`org-protected'.
* contrib/lisp/org-wikinodes.el (org-wikinodes-process-links-for-export):
Remove reference to `org-protected' value.
These text properties were used by the old export framework. They are
not needed anymore.
* lisp/org-macs.el: New macro to allow the 5-argument form of load to
be used where possible without breaking compatibility with XEmacs.
* lisp/org.el (org-version, org-reload): Use
`org-load-noerror-mustsuffix´ instead of adding a fifth argument to
load directly. Guard against undefined variable load-suffixes,
which doesn't exist in XEmacs.
Since load-suffixes doesn't exist in XEmacs, (org-reload 'uncompiled)
will not work. If it doesn't complicate the compatibility macro too
much this can be added later.
* org-macs.el (org-with-buffer-modified-unmodified): New
macro.
* org.el (org-entry-blocked-p): Use the new macro.
Thanks to Nick Dokos for reporting this.
The macro is a copy of `with-buffer-modified-unmodified'
which (wrongly?) lives in bookmark.el.
* org-macs.el (org-no-properties): Allow a new parameter
`restricted' to restrict the properties removal to those in
`org-rm-props'. The default is now to remove all properties.
* org-compat.el (org-substring-no-properties): Remove unused
defun.
* org-remember.el (org-remember-apply-template): Remove
redundant removal of text properties.
(org-remember-apply-template): Use `org-no-properties'.
* org-capture.el (org-capture-fill-template): Remove redundant
removal of text properties.
(org-capture-fill-template): Use `org-no-properties'.
* org-gnus.el (org-gnus-open, org-gnus-follow-link): Use
`org-no-properties'.
This patch ensure Org-mode will build on all supported versions of
Emacs, after the renaming of the cl macros behind the cl- prefix in the
recent Emacs trunk.
* lisp/org-compat.el (org-flet): Compatibility function now that flet
has been removed from cl-macs.
(org-labels): Compatibility function now that labels has been removed
from cl-macs.
* lisp/ob-R.el (org-compat): Require org-compat.
* lisp/ob-comint.el: Require org-compat.
* lisp/ob-exp.el (org-babel-exp-do-export): Switch to compatibility
function.
* lisp/ob-gnuplot.el (org-babel-expand-body:gnuplot): Switch to
compatibility function.
* lisp/ob-lob.el (org-babel-lob-get-info): Switch to compatibility
function.
(org-babel-lob-execute): Switch to compatibility function.
* lisp/ob-python.el (org-babel-python-evaluate-session): Switch to
compatibility function.
* lisp/ob-ref.el (org-babel-ref-index-list): Switch to compatibility
function.
* lisp/ob-sh.el (org-babel-sh-var-to-string): Switch to compatibility
function.
* lisp/ob-tangle.el (org-babel-load-file): Switch to compatibility
function.
(org-babel-tangle): Switch to compatibility function.
(org-babel-spec-to-string): Switch to compatibility function.
* lisp/ob.el (org-babel-view-src-block-info): Switch to compatibility
function.
(org-babel-execute-src-block): Switch to compatibility function.
(org-babel-edit-distance): Switch to compatibility function.
(org-babel-switch-to-session-with-code): Switch to compatibility
function.
(org-babel-sha1-hash): Switch to compatibility function.
(org-babel-balanced-split): Switch to compatibility function.
(org-babel-join-splits-near-ch): Switch to compatibility function.
(org-babel-get-rownames): Switch to compatibility function.
(org-babel-format-result): Switch to compatibility function.
(org-babel-insert-result): Switch to compatibility function.
(org-babel-examplize-region): Switch to compatibility function.
(org-babel-merge-params): Switch to compatibility function.
(org-babel-noweb-p): Switch to compatibility function.
(org-babel-expand-noweb-references): Switch to compatibility function.
* lisp/org-bibtex.el (org-bibtex-headline): Switch to compatibility
function.
(org-bibtex-fleshout): Switch to compatibility function.
(org-bibtex-read): Switch to compatibility function.
(org-bibtex-write): Switch to compatibility function.
* lisp/org-exp-blocks.el (org-export-blocks-preprocess): Switch to
compatibility function.
* lisp/org-exp.el (org-export-format-source-code-or-example): Switch to
compatibility function.
* lisp/org-macs.el (org-called-interactively-p): Indentation fix.
* lisp/org-mouse.el (org-mouse-timestamp-today): Switch to compatibility
function.
(org-mouse-set-priority): Switch to compatibility function.
(org-mouse-popup-global-menu): Switch to compatibility function.
(org-mouse-context-menu): Switch to compatibility function.
* lisp/org-plot.el (org-plot/gnuplot-to-grid-data): Switch to
compatibility function.
(org-plot/gnuplot-script): Switch to compatibility function.
* lisp/org.el (org-entry-get): Switch to compatibility function.
(org-fill-paragraph): Switch to compatibility function.
(org-auto-fill-function): Switch to compatibility function.
* org.el (org-allow-promoting-top-level-subtree): New option
to allow promoting a top-level subtree.
(org-called-with-limited-levels): New variable, dynamically
bound within the `org-with-limited-levels' macro.
(org-promote): Use the new option to allow promoting a
top-level subtree.
* org-macs.el (org-with-limited-levels): Let-bind
`org-called-interactively-p' to t.
Promoting a top-level subtree can be useful but should not be allowed by
default, as this restructuring is only reversible with M-x undo RET.
* org.el (org-auto-fill-fallback-function)
(org-indent-line-fallback-function)
(org-fill-paragraph-fallback-function)
(org-auto-fill-fallback-function)
(org-indent-line-fallback-function)
(org-fill-paragraph-fallback-function): Remove.
(org-fb-vars): New buffer-local variable.
(orgstruct++-mode): Use the fallback variable `org-fb-vars' to
store, use and restore variables if needed.
(org-fill-paragraph): Ignore `orgstruct++-mode' filling
variables when needed.
(org-auto-fill-function, org-indent-line-function): Ditto.
* org-macs.el (orgstruct++-ignore-org-filling): New macro.
Additionally, replace one
(or (org-mode-p) (derived-mode-p 'org-mode))
with
(derived-mode-p 'org-mode)
cause that is reflexive anyway (returns true, if the current mode is
org-mode).
Delete one check testing for org-mode or org derived mode
Also remove blank lines before the ";;; org*el ends here" declarations.
Having a "Version" header forced us to update every file when releasing a
new version of Org; it also forced us to update every file when merging Org
with Emacs trunk, thus cluttering the diffs between the previously merged
version and the new one with useless information.
Glenn Morris suggested this in emacs-devel:
http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00322.html
* org-macs.el (org-make-parameter-alist): New function. Turn flat list
of alternating symbol names and values into an alist with symbol name
in car and value in cdr.
* org-macs.el (org-with-gensyms): New macro. Wrap let-binding of
SYMBOLS to new uninterned symbols around BODY.
Use this macro to compose macros that need to bind their own symbols
in expansion. It expands into a let-binding of all symbols in SYMBOLS
to new uninterned symbols that cannot collide with symbols used in the
target macro's expansion.
* lisp/org-macs.el (org-with-limited-levels): some functions, like
`org-back-to-heading', being deeply based on outline-mode, still
refer to `outline-regexp' instead of `org-outline-regexp'.
This commit introduce `org-loop-over-siblings-within-active-region-p'
as a new defcustom that you can turn on (`non-nil') to allow commands
to loop over siblings in the active region.
The list of commands is this:
- org-archive-subtree
- org-archive-to-archive-sibling
- org-toggle-archive-tag
- org-deadline
- org-schedule
When `org-loop-over-siblings-within-active-region-p' is `non-nil' and
you run one of the command above on a region containing several headlines,
then Org will apply the command to each headline.
This can be particularily useful for archiving several headlines, or to
add a deadline or schedule several entries.
* org.el (org-loop-over-siblings-within-active-region-p): New
defcustom so that `org-loop-over-siblings-in-active-region'
can be turned on and off.
(org-deadline, org-schedule): Use the new macro.
* org-macs.el (org-loop-over-siblings-in-active-region): New
macro to let some commands act upon several siblings in the
active region.
* org-archive.el (org-archive-subtree)
(org-archive-to-archive-sibling, org-toggle-archive-tag): Use
`org-loop-over-siblings-in-active-region'.
Use `org-outline-regexp' instead or `outline-regexp'. Also use the
new defconst `org-outline-regexp-bol' to match `org-outline-regexp'
at the beginning of line.
* org.el (org-outline-regexp-bol): New defconst.
(org-outline-level, org-set-font-lock-defaults, org-cycle)
(org-overview, org-content, org-flag-drawer)
(org-first-headline-recenter, org-insert-todo-heading)
(org-map-region, org-move-subtree-down, org-paste-subtree)
(org-kill-is-subtree-p, org-context-p, org-refile)
(org-refile-new-child, org-toggle-comment, org-todo)
(org-add-planning-info, org-add-log-setup, org-scan-tags)
(org-set-tags, org-insert-property-drawer)
(org-prepare-agenda-buffers, org-preview-latex-fragment)
(org-speed-command-default-hook, org-check-for-hidden)
(org-toggle-item, org-toggle-heading)
(org-indent-line-function, org-set-autofill-regexps)
(org-fill-paragraph, org-toggle-fixed-width-section)
(org-yank-generic, org-yank-folding-would-swallow-text)
(org-first-sibling-p, org-goto-sibling)
(org-goto-first-child, org-show-entry): Use
`org-outline-regexp' and `org-outline-regexp-bol'.
* org-remember.el (org-remember-handler): Use
`org-outline-regexp-bol'.
* org-mouse.el (org-mouse-match-todo-keyword, org-mode-hook)
(org-mouse-move-tree, org-mouse-transform-to-outline): Use
`org-outline-regexp' and `org-outline-regexp-bol'.
* org-macs.el (org-with-limited-levels)
(org-get-limited-outline-regexp): Use `org-outline-regexp'.
* org-indent.el (org-indent-outline-re)
(org-indent-refresh-section, org-indent-refresh-to): Use
`org-outline-regexp' and `org-outline-regexp-bol'.
* org-html.el (org-export-as-html): Use
`org-outline-regexp-bol'.
* org-footnote.el (org-footnote-at-definition-p)
(org-footnote-normalize): Use `org-outline-regexp' and
`org-outline-regexp-bol'.
* org-exp.el (org-export-preprocess-string): Don't redefine
`outline-regexp'.
* org-docbook.el (org-export-as-docbook): Use
`org-outline-regexp-bol'.
* org-colview.el (org-columns, org-columns-compute): Use
`org-outline-regexp' and `org-outline-regexp-bol'.
* org-colview-xemacs.el (org-columns, org-columns-compute):
Use `org-outline-regexp-bol'.
* org-clock.el (org-clock-insert-selection-line)
(org-clock-in, org-clock-out, org-dblock-write:clocktable):
Use `org-outline-regexp' and `org-outline-regexp-bol'.
* org-ascii.el (org-export-as-ascii)
(org-export-ascii-push-links): Use `org-outline-regexp' and
`org-outline-regexp-bol'.
* org-archive.el (org-archive-to-archive-sibling)
(org-archive-all-done): Use `org-outline-regexp' and
`org-outline-regexp-bol'.
* org-agenda.el (org-agenda, org-search-view)
(org-agenda-list-stuck-projects, org-agenda-get-timestamps)
(org-agenda-get-progress, org-agenda-get-blocks): Use
`org-outline-regexp' and `org-outline-regexp-bol'.
This reverts commit 5a2eec3207.
The replacement of `buffer-substring-filters' by
`filter-buffer-substring-functions' requires some rewriting
of functions like `org-indent-remove-properties-from-string'.
* install/git/org-mode/lisp/org-table.el
(org-table-time-seconds-to-string): use `org-format-seconds'
instead of `format-seconds'.
* install/git/org-mode/lisp/org-macs.el (org-format-seconds):
handle case where `format-seconds' does not exist.
This uses the macro David Maus suggests. In particular, it doesn't
use the (let (pc-mode ...)) binding, which, as David states, could
cause leakage if the pc-mode variable is used within ,@body.