* org.el (org-ellipsis, org-remove-highlights-with-change):
Enhance docstring.
(org-preview-latex-fragment): Make obsolete. Alias to the new
name `org-toggle-latex-fragment'.
(org-mode, org-mode-map): Use `org-toggle-latex-fragment'.
* lisp/org.el (org-hide-block-toggle): Correctly find boundaries of
the block at point. Fix `off' argument behavior. Allow to hide
a block when at any affiliated keyword.
* testing/lisp/test-org.el (test-org/hide-block-toggle): New test.
Thanks to Andrea Rossetti for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/89324
* org-faces.el (org-block-background): Delete.
* org.el (org-fontify-meta-lines-and-blocks-1): Don't use an
overlay for the block background.
(org-in-src-block-p): Check against the `src-block' text
property, not against an overlay.
The overlay was introduced here:
http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=27d98d879
and fixed here
http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=69811ff44
But (1) it makes fontification slowler, (2) it makes
`org-in-src-block-p' slower and it prevents correct ps-printing
of Org buffers.
If we want to use a different background color, we need another
solution than using overlays.
* org.el (org-paste-subtree): New parameter `remove', to
remove the pasted subtree from the `kill-ring'.
(org-refile): Use the new parameter of `org-paste-subtree'.
Thanks to Samuel Wales for suggesting this.
* org.el (org-activate-plain-links): Don't activate :elisp:
and 🐚 tags as links. Enhance the docstring.
(org-activate-angle-links, org-activate-footnote-links)
(org-activate-bracket-links, org-activate-dates)
(org-activate-target-links): Minor docstrings enhancement.
Thanks to Andrea Rossetti for reporting this.
specifically in the second 'post' element
* lisp/org.el (org-emphasis-regexp-components): Remove extra escape
org-emphasis-regexp-components, specifically in the second 'post'
element.
* lisp/org.el (org-drag-element-backward): Correcly drag elements in
a drawer or a block.
* testing/lisp/test-org.el (test-org/drag-element-backward): Add test.
* lisp/org.el (org-speed-commands-default): Bind "U" and "D" to
`org-metaup' and `org-metadown'.
Org speed keys were not updated to reflect the recent changes to
org-shiftmetaup and org-shiftmetadown. As a result the default
bindings for speedkeys "U" and "D" were destructive, since they moved
only single lines. Binding them to org-metaup and org-metadown fixes
the problem.
Thanks to Marco Wahl for reporting the problem:
http://permalink.gmane.org/gmane.emacs.orgmode/87873
* lisp/org.el (org-adaptive-fill-function): Do not compute fill prefix
if point is at a heading or an inlinetask. Also change "? " into
"?\s" for better code readability.
* org.el (org-insert-heading): With one universal prefix
argument or `org-insert-heading-respect-content' set to `t',
always respect the content, i.e. don't insert a list item and
don't convert normal lines into headings. Update docstring.
(org-insert-heading-respect-content): Remove unused arg.
(org-insert-todo-heading-respect-content): Don't use
`org-insert-todo-heading-respect-content', use the second
argument of `org-insert-todo-heading' instead.
* org-mobile.el (org-mobile-edit): Use only one arg.
Thanks to Bernt Hansen for reporting this.
* lisp/org.el (org-insert-heading): Fix error when inserting
a headline before first headline, with point not at bol. Remove
source block check for consistency with behavior after first
headline. Tiny fix to docstring.
* testing/lisp/test-org.el (test-org/meta-return): Remove unnecessary
test (not testing specifications).
(test-org/insert-heading): New test.
* org.el (org-property-re): Also match null properties by
default.
(org-entry-delete): Also delete null properties.
(org-read-property-value): Allow the empty string as a new
value.
(org-delete-property): Throw a message when there is not
property to delete.
Thanks to Andrea Rossetti for reporting this.
* lisp/org.el: Forward declare `org-clock-sum',
`org-table-end-of-field', `org-element-cache-refresh'.
These have been introduced with b5554077cb, b76071f2b6 and 6eb940a8dc.
* org.el (org-re-property): New parameter `allow-null' to
match property with a null value.
(org-entry-put): Correctly update a property with a null
value.
Thanks to Andrea Rossetti for reporting this and suggesting a fix.
* org.el: Send a warning when org-loaddefs.el could not be
found in the directory where this org.el file is loaded from.
* ox-org.el (org-org-publish-to-org):
* ox-odt.el (org-odt-do-format-code):
* ox-html.el (org-html-fontify-code):
* org.el (org-fontify-like-in-org-mode):
* org-src.el (org-src-font-lock-fontify-block):
* org-clock.el (org-clock-get-clocktable): Use
`font-lock-ensure' instead of `font-lock-fontify-buffer'.
* org.el (org-outline-level, org-copy-subtree)
(org-sort-entries, orgstruct-setup, org-show-context)
(org-create-formula-image-with-dvipng)
(org-create-formula-image-with-imagemagick)
(org-goto-sibling, org-goto-first-child, org-show-entry): Use
`ignore-errors' instead of (condition-case nil ... (error nil)).
People trying to load org.el when org-loaddefs.el is not available
has been a major cause of trouble when installing Org. The warning
tells them what they need to do.
* org.el (org-shiftmetaup, org-shiftmetadown): Don't move the
subtree or list item at point up or down, as this feature is
already accessible through `org-metaup' and `org-metadown'.
Update the docstrings to reflect the new behavior.
* lisp/ox.el (org-export-get-parent): Move definition of
'org-export-get-parent' before first use. Leave comment at original
place of definition.
* lisp/org.el (org-uniquify): Move definition of 'org-uniquify' before
first use. Leave comment at original place of definition.
* org.el (org-refresh-property): New function.
(org-refresh-properties, org-set-effort)
(org-property-next-allowed-value): Use it.
* org-timer.el (org-timer-set-timer): Get the correct number
of minutes from text properties, both in an `org-mode' and
`org-agenda-mode' buffer.
* org.el (org-open-link-in-comment-or-property): New function.
(org-open-at-point): Use it.
See http://thread.gmane.org/gmane.emacs.orgmode/84300/focus=84300 for
the follow-up of a discussion on whether links should be supported in
comments and properties.
* org.el (org-fontify-entities): Use `org-at-comment-p'.
(org-in-commented-line): Delete.
(org-in-indented-comment-line): Delete.
(org-at-comment-p): Also match indented comments and save
match data.
* org-footnote.el (org-footnote-in-valid-context-p): Use
`org-at-comment-p'.
* org.el (org-sort-entries): When sorting by TODO keywords,
put TODO entries first, then entries without a TODO keyword,
then DONE entries.
Thanks to Eric Abrahamsen for triggering this.
* org-agenda.el (org-agenda-format-item): Don't add the
'effort and 'effort-minutes text properties as they are
already accessible through the 'txt property of agenda lines.
* org-clock.el (org-clock-in): Refresh both the 'effort and
'effort-minutes text properties.
* org-rmail.el (rmail, rmail-file-name): Silent byte-compiler.
* org.el (org-refresh-properties): Allow to set several text
properties by passing an alist to the TPROP argument.
(org-set-effort, org-property-next-allowed-value): Use 'effort
instead of 'org-effort.
(org-agenda-prepare-buffers): Update both 'effort and
'effort-minutes.
(org-mark-jump-unhide): Move up to silent the byte-compiler.
* org.el (org-refresh-category-properties): Don't put the
'org-category-position property.
(org-refresh-stats-properties): New function.
(org-agenda-ignore-properties): Rename from
`org-agenda-ignore-drawer-properties', which is now obsolete.
Allow to use 'stats.
(org-agenda-prepare-buffers): Check stats properties.
(org-get-at-bol): Make a defsubst.
(org-get-at-eol): New function.
* org-agenda.el (org-entries-lessp): Sort by statistic
cookies.
(org-search-view, org-agenda-get-todos)
(org-agenda-get-timestamps, org-agenda-get-sexps)
(org-agenda-get-progress, org-agenda-get-deadlines)
(org-agenda-get-scheduled, org-agenda-get-blocks): Don't set
the 'org-category and 'org-category-pos text properties.
'org-category-pos is useless and 'org-category is set through
`org-agenda-format-item'.
(org-agenda-format-item): Remove useless code.
(org-cmp-priority): Delete.
(org-cmp-values): New function to compare text properties
values.
(org-cmp-effort, org-agenda-to-appt): Check against the end of
the line.
(org-agenda-filter-by-category, org-agenda-filter-apply)
(org-agenda-change-all-lines): Use `org-get-at-eol'.
* org.el (org-move-subtree-down): Use `org-end-of-subtree'
instead of `outline-end-of-subtree'.
(outline-end-of-subtree): Remove advice.
* org-mouse.el (org-mouse-move-tree, org-mouse-do-remotely):
Use `org-end-of-subtree' instead of `outline-end-of-subtree'.
* org.el (org-cycle-internal-local): Don't show a trailing
character when cycling a subtree that ends with a non-newline
character at the end of the buffer or the narrowed region.
* org.el (org-entry-properties): Ensure the special property
is not commented out when matched.
Other an agenda view like (tags "DEADLINE<\"<+0d>\"" ...) will
wrongly list an entry with a commented out DEADLINE line, because
org-agenda-skip only skip commented out stuff on the current line,
with is the headline itself when using "tags" agenda.
Thanks to Sébastien for reporting this.
* org.el (org-offer-links-in-entry): Use global variable
`org-any-link-re' instead of defining a string-equal local variable.
The `re' variable defined in function `org-offer-links-in-entry' is
string-equal to `org-any-link-re' and is hence replaced by the latter.
TINYCHANGE
* org.el (org-set-regexps-and-options): Allow
`org-complex-heading-regexp-format' to match [/] and [%]
cookies when they are both before and after the heading.
Thanks to Nicolas Bercher for reporting this.
* lisp/org.el (org-indent-line): Indent source block contents
according to line above when `org-src-tab-acts-natively' is nil.
* testing/lisp/test-org.el (test-org/indent-line): Update test.
* lisp/org.el (org-indent-region): Update function according to recent
`org-indent-line' change. Optimize it.
* testing/lisp/test-org.el (test-org/indent-region): New test.
* lisp/org.el (org--get-expected-indentation,
org--align-node-property): New functions.
(org-indent-line): Use new function. Also merge functionalities with
`org-src-native-tab-command-maybe'.
* lisp/org-src.el (org-src-native-tab-command-maybe): Remove function.
* testing/lisp/test-org.el (test-org/indent-line): New test.
* lisp/org.el (org-find-exact-heading-in-directory): Use full path for
files.
When the path is not included, `org-find-exact-heading-in-directory'
will fail when the current value of `default-directory' is different
from the argument DIR.
TINYCHANGE
* lisp/org.el (org-flag-drawer): Do not flag drawer when point is on
an empty line after it. When hiding the drawer away, make sure
point always stays in a visible part of the buffer.
* testing/lisp/test-org.el (test-org/flag-drawer): Add tests.
* org.el (org-insert-heading): Fix behavior when point is at
the beginning of a heading or a list item. Enhance docstring.
Thanks to York Zhao for reporting this.
* org.el (org-mode): Use `org-back-to-heading' and
`org-end-of-subtree' for C-M-a and C-M-e.
This partially reverts commit 76fa97922.
Thanks to Leo Liu for reporting this.
* org.el (org-check-before-invisible-edit): Don't just cycle,
show the subtree, as cycling may leave the current heading
folded.
Thanks to Paul Stansell for reporting this.
* lisp/org-element.el (org-element-cache-refresh): New function.
* lisp/org.el (org-update-radio-target-regexp): Make it standalone.
Also refresh fontification only when necessary.
(org-all-targets, org-make-target-link-regexp): Remove functions.
* testing/lisp/test-org.el (test-org/update-radio-target-regexp): New
test
(test-org/all-targets): Remove test.
We need to manually reset cache on radio links as re-fontification
doesn't trigger a buffer change, and, as a consequence, a cache reset.
* org.el (org-trim): Rewrite and make a defsubst.
* org-bibtex.el (org-bibtex-get): Use `org-trim' instead of
`org-babel-trim'.
* ob-core.el (org-babel-trim): Delete and alias to `org-trim'.
(org-babel-chomp): Delete and alias to `org-trim-trailing'.
(org-trim-trailing): New defsubst.
(org-babel-examplize-region): Fix version.
* lisp/org.el (org-link-mailto-program): Remove variable.
(org-open-at-point): Delegate "mailto" links handling to `browse-url'
and `browse-url-mailto-function'.
This patch allows to use regular URI syntax and deprecates old Org
specific syntax: mailto:user@domain::Title.
http://permalink.gmane.org/gmane.emacs.orgmode/85007
* org.el (org-update-dblock): Use `save-excursion' instead of
`save-window-excursion' so that blocks can edit other windows and
change the window layout.
Thanks to Martin for reporting this.
* org-clock.el (org-clocktable-write-default): New parameter
":sort" to sort a column by a sorting type. E.g., a value of
:sort (1 . ?a) will sort the first column alphabetically. The
sorting line is the third one, table-wise, which is usually
the first line that contains user data.
* org.texi (The clock table): Document the new :sort
parameter.
* org.el (org-do-sort): Recognize [H]H:MM strings as time
values and allow sort-by-time to process them.
* org-table.el (org-table-sort-lines): Mention that sorting by
time also recognize [H]H:MM time values.
* lisp/org.el (org-make-target-link-regexp): Change regexp so
alphanumeric characters cannot be found next to a radio link.
(org-activate-target-links): Apply changes to radio link regexp.
* lisp/org-element.el (org-element--object-lex,
org-element-link-parser): Apply changes to radio link regexp.
* testing/lisp/test-org-element.el (test-org-element/link-parser):
Update test.
Patch suggested by Daniel Clemente.
http://permalink.gmane.org/gmane.emacs.orgmode/84461
* lisp/org-agenda.el (org-refile): Flip logic to allow instead of
prohibit the use of `org-refile' with the goto flat from non
org-mode buffers.
In commit 49da67d the condition was changed from only
`(unless goto ...)` to `(unless (and goto (listp arg)) ...)`
where the `and` condition is only true for non-empty lists, so that
calling `(org-refile t)` complains about not being inside an org-mode
buffer.
With this patch org-refile can be used (again) from anywhere when
passed the goto flag to jump to the chosen task.
TINYCHANGE
* lisp/org.el (org-make-link-regexps): Allow optional double slashes
after type. Small refactoring.
* testing/lisp/test-org-element.el (test-org-element/link-parser):
Update test.
This patch allows to write both [[file:/file.org]] and [[file:///file.org]].
See bug#16751.
* lisp/org.el (org-set-font-lock-defaults): Fix headline fontification
when keywords are stacked.
(org-toggle-comment): Properly toggle COMMENT keyword when a regular
keyword is already present.
(org-todo, org-agenda-prepare-buffers): Correctly match a commented
heading.
* lisp/org-colview.el (org-columns-capture-view): Correctly match
a commented heading.
* testing/lisp/test-org.el (test-org/toggle-comment): New test.
* lisp/org.el (org-radio-target-regexp): Radio targets cannot begin or
end with whitespace.
(org-target-regexp): Update syntax according to previous rule.
(org-any-target-regexp): Fix fontification bug.
* testing/lisp/test-org-element.el (test-org-element/radio-target-parser):
Add test.
Variables are turned into defconst to emphasize the fact that they are
not subject to change.
Thanks to Daniel Clemente for reporting it.
http://permalink.gmane.org/gmane.emacs.orgmode/84461
* lisp/org.el (org-make-target-link-regexp): Allow radio links after
an apostrophe and mid-word. Small refactoring.
* testing/lisp/test-ox.el (test-org-export/resolve-radio-link): Add
test.
See http://permalink.gmane.org/gmane.emacs.orgmode/84108.
* lisp/org.el (org-in-commented-heading-p): New function.
* lisp/ob-tangle.el (org-babel-under-commented-heading-p): Remove
function.
(org-babel-tangle-collect-blocks): Use new function.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Use new function.
* testing/lisp/test-org.el (test-org/in-commented-heading-p): New
test.
* lisp/org-element.el (org-element-all-successors,
org-element-object-restrictions): Prioritize `link' over other
successors in order to find radio links starting with another syntax
object (e.g., an entity). Also allow text markup within radio
targets.
(org-element-link-parser): Add contents to radio targets.
* lisp/org.el (org-make-target-link-regexp): Fix regexp so it can
match targets starting with an Org object (e.g., an entity).
(org-ctrl-c-ctrl-c): Fix function when applied on an object contained
within a radio target.
* testing/lisp/test-org-element.el (test-org-element/radio-target-parser): Add test.
* testing/lisp/test-ox.el (test-org-export/resolve-radio-link): Add test.
* lisp/org.el (org-mode): Change "\" and "~" characters syntax from
`punctuation' to `symbol' so they are on par with other characters used
in Org syntax (e.g., "/", "*"...).
This change is needed to correctly find radio links starting with an
entity:
<<<\alpha-test>>> \alpha-test
* ox-latex.el (org-latex-text-markup-alist): Use \ul{...} for
underlining instead of \uline{...} as requiring the hyperref
package makes \uline{...} unusable on headline.
* org.el (org-latex-default-packages-alist): Add the "soul"
package.
Thanks to Konstantin Kliakhandler for reporting this.
* lisp/org.el (org-open-at-point): Correctly open fuzzy links when
path is hexified.
* testing/lisp/test-org.el (test-org/coderef): New test.
(test-org/fuzzy-links): Add test.
* org.el (org-refresh-properties): Don't add the property to
the whole subtree, only to the part between the beginning of
the headline and the end of the "content", before any other
headline. This fix a bug about properties displayed as
inherited in the agenda, where Org properties are checked
against text properties.
Thanks to Sébastien Vauban for reporting this.
* org-compat.el (org-move-to-column): Always ignore invisible
text in agenda buffer, and when there is both a bracket link
and '(org-link) as a member of `buffer-invisibility-spec'.
Add a docstring.
* org.el (org-align-tags-here): Add docstring and remove
useless arguments when calling `org-move-to-column'.
* org-table.el (org-table-copy-down)
(org-table-find-dataline, org-table-move-row)
(org-table-insert-hline, org-table-kill-row):
* org-agenda.el (org-agenda-next-item)
(org-agenda-previous-item, org-agenda-todo)
(org-agenda-priority, org-agenda-show-new-time)
(org-agenda-clock-in, org-agenda-clock-out): Remove useless
arguments when calling `org-move-to-column'.
This fixes the issue about S-RET not placing the cursor in the right
table field when M-x org-toggle-link-display RET removed '(org-link)
from `buffer-invisibility-spec' and some other discrepancies (like
S-M-<up> not restoring point correctly when there is a bracket link
before point, or M-x org-clock-display RET not aligning overlays
correctly, etc.
Thanks to Matt Lundin and Michael Brand for tracking issues
about this.
* org.el (org-refile): Rename first argument to arg, as its
use goes beyond is now more general. Only keep bracket links
descriptions in the displayed heading. Enhance docstring.
* org.el (org-entry-get): Only try to combine file properties
with local properties when the property drawer contains such
local property, not when the property drawer exists.
Before the fix, `org-entry-get' behavior was inconsistent,
returning `nil' when looking for a property in a subtree with
no property drawer, and returning the global properties in a
subtree with a property drawer, independantly of whether this
property drawer contained a reference to the property we are checking
against or not.
As a side-effect, inheritance was broken for the case that
Ilya reported in commit 475f2f53, because `org-entry-get' returned
a value (with the global properties of the file) too early.
Thanks to Ilya for raising this bug and to Achim for pointing
out that the previous fix was wrong.
* org.el (org-store-link): Check `dired-mode' through
`derived-mode-p' to allow storing links from derived modes
like `sr-mode'.
Thanks to Thomas Holst for the idea.
* lisp/org.el (org-open-at-point): Unescape optional part in file
links.
This patch allows to handle properly links like:
[[file:somefile.org::*headline%20with%20spaces]]
Thanks to Thomas Holst for reporting it.
* lisp/org.el (org-entry-get-with-inheritance): Temporarily
let-bind `org-file-properties', `org-global-properties' and
`org-global-properties-fixed' to nil before calling `org-entry-get'
on entries up the hierarchy from the queried entry.
Problem was that when org-entry-get-with-inheritance went up the
hierarchy of entries from a given entry, checking whether the property
has been set in any of the entries, it was calling org-entry-get,
which always looks at file-scope and global-scope properties. So if
our property was set file-wide or system-wide, and somewhere up the
hierarchy there was an entry which set some properties _other_ than
the one we're looking up but did not set ours, org-entry-get would
fill in the global property value and report that our property was in
fact set in that entry. The search would stop, and if the property
was actually set further up the hierarchy (which should override
file-wide or system-wide settings), we would never get to that
up-the-hierarchy setting.
Illustration of fixed problem:
#+PROPERTY: myprop aaa
* headline A
:PROPERTIES:
:myprop: bbb
:END:
*** headline B
:PROPERTIES:
:otherprop: ccc
:END:
#+BEGIN_SRC emacs-lisp
(message (org-entry-get-with-inheritance "myprop"))
#+END_SRC
#+RESULTS:
: aaa
Result should be bbb, which it is after the fix.