Commit Graph

3263 Commits

Author SHA1 Message Date
Bastien Guerry ccc4f6b96e Fix d035a9af6
Thanks to Nicolas for providing the correct fix.
2014-02-01 01:08:42 +01:00
Bastien Guerry c89827dc37 Revert "org.el (org-ctrl-c-ctrl-c): Bugfix"
This reverts commit d035a9af6c.

See http://article.gmane.org/gmane.emacs.orgmode/81752
2014-02-01 01:06:25 +01:00
Bastien Guerry bdeac998c8 Merge branch 'maint' 2014-01-31 15:53:54 +01:00
Bastien Guerry d035a9af6c org.el (org-ctrl-c-ctrl-c): Bugfix
* org.el (org-ctrl-c-ctrl-c): Fix behavior when hitting C-c
C-c on LaTeX formulas in tables.
2014-01-31 15:53:42 +01:00
Bastien Guerry 21ce3296b7 Merge branch 'maint' 2014-01-31 10:39:06 +01:00
Bastien Guerry 7ddebe5c7b Revert "org.el (org-map-entries): Use `save-window-excursion'"
This reverts commit 3ec38f5c06.
2014-01-31 10:38:50 +01:00
Bastien Guerry 4068a829a1 org.el: Fix compiler warnings 2014-01-31 09:45:25 +01:00
Bastien Guerry 99a23ba436 Merge branch 'maint' 2014-01-30 12:43:02 +01:00
Bastien Guerry 53c664c4ec org.el (org-refile--get-location): New internal function
* org.el (org-refile--get-location): New internal function
using a wider set of possible refile locations.
(org-refile-get-location): Use it.
2014-01-30 12:42:13 +01:00
Bastien Guerry 98de33a9ac Merge branch 'maint' 2014-01-30 12:21:51 +01:00
Bastien Guerry f3ed0f7c6c org.el (org-refile): Fix bug when refiling the last subtree
* org.el (org-refile): Fix bug when refiling the last subtree
of the buffer: don't leave out the last character.
2014-01-30 12:21:39 +01:00
Bastien Guerry cf2c7e9f18 Merge branch 'maint' 2014-01-30 11:59:57 +01:00
Bastien Guerry 3c71ab34dd org.el (org-sort-entries): Restore the point location when there is nothing to sort
* org.el (org-sort-entries): Restore the point location when
there is nothing to sort.
2014-01-30 11:59:25 +01:00
Bastien Guerry 72ad5257fc Merge branch 'maint' 2014-01-29 14:58:14 +01:00
Benjamin Drieu 33a0a198e3 org.el (org-store-link): Fix selection of the function to store the link
* org.el (org-store-link): Fix selection of the function to
store the link.
2014-01-29 14:57:45 +01:00
Bastien Guerry 524242fc4d Fix 80fc5ad again 2014-01-29 10:31:37 +01:00
Bastien Guerry 9f6c5897b3 Merge branch 'master' of orgmode.org:org-mode 2014-01-29 10:18:22 +01:00
Bastien Guerry 2c7ffbe4b2 Fix 80fc5ad
Thanks to Yasushi SHOJI for reporting this.
2014-01-29 09:19:08 +01:00
Nicolas Goaziou 6a00c96541 Remove left over references to QUOTE blocks
* lisp/org.el (org-quote-string): Remove variable.
(org-enable-fixed-width-editor, org-context): Update docstring.
(org-toggle-fixed-width-section): Remove function and binding.
(org-set-font-lock-defaults): Remove reference to `org-quote-string'.

* lisp/org-element.el (org-element-headline-parser,
  org-element-headline-interpreter): Remove references to
  `org-quote-string'.

* testing/lisp/test-org-element.el (test-org-element/headline-quote-keyword):
  Remove test.
(test-org-element/headline-interpreter): Remove a test.
2014-01-28 21:36:54 +01:00
Bastien Guerry 92c696cf8d Revert "Improve message when file to include is missing"
This reverts commit 8ad7b3888f.
2014-01-24 12:19:25 +01:00
Bastien Guerry da8daf50a7 Merge branch 'maint' 2014-01-24 12:17:21 +01:00
Bastien Guerry e8bfc5336c Fix 77458b 2014-01-24 12:17:08 +01:00
Sebastien Vauban 8ad7b3888f Improve message when file to include is missing
* org.el (org-file-contents): Improve message when linked file does not exist.
2014-01-24 12:15:08 +01:00
Bastien Guerry ac7fb4dd79 org.el (org-priority): Don't use `org-preserve-lc'
* org.el (org-priority): Don't use `org-preserve-lc' as it is
not necessary here.
2014-01-20 22:40:37 +01:00
Bastien Guerry 80fc5adb58 org.el (org-provide-todo-statistics): Allow to set to a list of two lists, for TODO and DONE keywords
* org.el (org-provide-todo-statistics): Allow to set to a list
of two lists, one with TODO keywords, the other one with DONE
keywords.
(org-update-parent-todo-statistics): Correctly handle
`org-provide-todo-statistics' when it is set as a list of two
lists, for TODO and DONE keywords.

Thanks to Fletcher Charest for reporting this and requesting
this feature.
2014-01-20 16:06:19 +01:00
Bastien Guerry ea0d35674f org.el: New command org-insert-last-stored-link bound to `C-c M-l'
* org.el (org-insert-all-links): New parameters `pre' and
`post' to specify a string to preprend and append.
(org-insert-last-stored-link): New command.
(org-mode-map): Bind the new command to `C-c M-l'.

Thanks to Sébastien Vauban for requesting this and to Nick
Dokos for testing and fixing the patch.
2014-01-20 15:37:25 +01:00
Sylvain Chouleur 5a2d47e1ba Fix `org-outline-overlay-data' marker insertion-type
* org.el (org-outline-overlay-data): Set the insertion-type of end
bound marker of the function to t (means marker advances when you
insert text at it)

This is to conserve outline visibility property when changes are made
at the end bound of the data.
For example: try `org-babel-execute-subtree' on a folded outline:
The new result will be shown after the folded part of the outline
whereas the outline body should not be visible.

TINYCHANGE
2014-01-19 22:00:02 +01:00
Nicolas Goaziou 5f04b3815f Fix ae0f1c56a7
* lisp/org.el (org-toggle-item): Fix ae0f1c56a7.
2014-01-19 18:15:56 +01:00
Bastien Guerry 848d1926ec Merge branch 'maint' 2014-01-19 16:45:37 +01:00
Bastien Guerry 25e4e5b6f0 org.el (org-format-latex-options): Fix docstring
* org.el (org-format-latex-options): Fix docstring.

Thanks to Mirko Vukovic for reporting this.
2014-01-19 16:44:21 +01:00
Bastien Guerry 81dad90342 Merge branch 'maint' 2014-01-16 12:07:37 +01:00
Bastien Guerry d16477913d Fix ff902c 2014-01-16 12:07:27 +01:00
Bastien Guerry c7408a2bd7 Merge branch 'maint' 2014-01-16 01:19:49 +01:00
Nicolas Goaziou d4b653656e org.el (org-mode-restart): Fix turning off `org-indent-mode' when necessary
* org.el (org-mode-restart): Fix turning off `org-indent-mode'
when necessary.
2014-01-16 01:18:30 +01:00
Bastien Guerry a4a2935c3f org.el (customize-package-emacs-version-alist): Fix Org version for Emacs 24.4
* org.el (customize-package-emacs-version-alist): Fix Org
version for Emacs 24.4.
2014-01-16 01:13:15 +01:00
Bastien Guerry 73a6aba4b7 org.el (customize-package-emacs-version-alist): Fix Org version for Emacs 24.4
* org.el (customize-package-emacs-version-alist): Fix Org
version for Emacs 24.4.
2014-01-16 01:12:51 +01:00
Bastien Guerry c31782d903 org.el (org-src-fontify-natively): Default to `t'
* org.el (org-src-fontify-natively): Default to `t'.

Thanks to Sébastien Vauban for pushing this.
2014-01-16 01:11:33 +01:00
Bastien Guerry a5a7231304 Merge branch 'maint' 2014-01-16 00:55:46 +01:00
Bastien Guerry ff902c4429 Remove spurious defvar
Thanks to Nicolas Goaziou for reporting this.
2014-01-16 00:52:46 +01:00
Bastien Guerry 27ab61acd0 Fix 4a9820 2014-01-16 00:35:12 +01:00
Bastien Guerry 8898c380ab Merge branch 'maint'
Conflicts:
	lisp/org.el
2014-01-15 09:22:59 +01:00
Bastien Guerry 0a8fe04a9d Merge branch 'maint' of orgmode.org:org-mode into maint 2014-01-15 09:21:59 +01:00
Bastien Guerry 947c3f5c2a Fix 035087777 2014-01-15 09:21:44 +01:00
Bastien Guerry d9797ca17e Revert "org.el (org-store-link): When a link has been stored, always returns it"
This reverts commit 035087777d.
2014-01-15 09:19:30 +01:00
Carsten Dominik 723306d6e7 Fix mode reset 2014-01-14 20:45:54 +01:00
Bastien Guerry 5cd6b30182 Merge branch 'maint' 2014-01-14 12:39:01 +01:00
Bastien Guerry 4a9820067a Fix bug when demoting invisible headlines
* org.el (org-demote): Ignore invisible text when aligning
tags.
(org-set-tags): When JUST-ALIGN is 'ignore-column, ignore
invisible text when restoring the cursor to the correct
column.

This fixes a bug about demoting hidden headlines.
If org-move-to-column temporarily ignore visibility
specs, this will prevent org-demote to work correctly
in hidden regions.

Thanks to Susan Cragin for reporting this bug.
2014-01-14 12:38:50 +01:00
Nicolas Goaziou ae0f1c56a7 Small refactoring
* lisp/org.el (org-toggle-item): Do not call `org-list-struct' twice
  and fix checkboxes after modifying one of them.

This patch is relative to 213c2a6aa0.
2014-01-13 17:58:16 +01:00
Bastien Guerry 6ea3dee45d org.el (org-edit-special): Use `find-file-other-window'
* org.el (org-edit-special): Use `find-file-other-window' when
visiting included files.
2014-01-13 01:11:53 +01:00
Bastien Guerry 213c2a6aa0 org.el (org-toggle-item): Handle TODO and DONE keywords
* org.el (org-toggle-item): When an entry has a TODO or a DONE
keyword, add an empty or a checked checkbox.
2014-01-13 00:02:42 +01:00
Bastien Guerry 90884b9748 Merge branch 'master' of orgmode.org:org-mode 2014-01-12 10:03:38 +01:00
Bastien Guerry 72b8a86d9c Merge branch 'maint' 2014-01-12 10:03:17 +01:00
Bastien Guerry 035087777d org.el (org-store-link): When a link has been stored, always returns it
* org.el (org-store-link): When a link has been stored, always
returns it.

(Storing links from the agenda are broken otherwise.)
2014-01-12 09:56:41 +01:00
Nicolas Goaziou cad81696b8 Change no brace sub/superscript syntax
* lisp/org.el (org-match-substring-regexp): Simplify syntax when not
using braces.  Also make the variable a defconst.
(org-match-substring-with-braces-regexp): Make the variable a defconst
and remove a useless group in regexp.
* lisp/org-element.el (org-element-subscript-parser,
  org-element-superscript-parser): Adapt to group changes.
2014-01-11 23:54:22 +01:00
Bastien Guerry 525304cbda Merge branch 'maint' 2014-01-11 01:35:18 +01:00
Bastien Guerry 21472107fa org.el (org-ellipsis): Small docstring enhancement
* org.el (org-ellipsis): Small docstring enhancement.
2014-01-11 01:34:44 +01:00
Nicolas Goaziou f5380d1221 Merge branch 'maint' 2014-01-10 11:25:15 +01:00
Nicolas Goaziou 8720c49807 Speed improvement
* lisp/org.el (org-get-previous-line-level): Do not call
  `org-current-level' twice unless necessary.  Also, avoid using
  `line-number-at-pos' when the information needed is to know if point
  is in the first line of the visible part of the buffer.
2014-01-10 11:22:49 +01:00
Bastien Guerry ccbe3965b1 Merge branch 'maint' 2014-01-07 13:26:12 +01:00
Bastien Guerry 152712a7c8 Backport change from Chong on 2013-12-23 2014-01-07 13:25:30 +01:00
Bastien Guerry e4a013fcf3 Merge branch 'maint' 2014-01-05 14:21:51 +01:00
Bastien Guerry 66fd521264 org.el (org-set-tags): Ignore invisible text when restoring cursor position
* org.el (org-set-tags): Ignore invisible text when restoring
cursor position.
2014-01-05 14:21:38 +01:00
Bastien Guerry 3737676632 Update copyright year for files changed since 2013 2014-01-05 06:35:21 +01:00
Bastien Guerry 0beda99171 Revert "Update copyright years."
This reverts commit 21105594fc.
2014-01-05 06:28:07 +01:00
Bastien Guerry 096ff7e078 Merge branch 'maint'
Conflicts:
	contrib/lisp/org-favtable.el
2014-01-04 18:58:12 +01:00
Bastien Guerry 21105594fc Update copyright years. 2014-01-04 18:56:11 +01:00
Bastien Guerry d09088ca17 Merge branch 'maint' 2014-01-04 15:05:13 +01:00
Bastien Guerry 45b0d23b0c Fix creation of parent nodes when refiling.
* org.el (org-refile-get-location): Check for a refile
position when the position is not nil, otherwise allow to
create the parent node if the user requests it.

Thanks to Li Zhuo for reporting this bug and for providing
a preliminary patch.
2014-01-04 15:05:01 +01:00
Bastien Guerry c36ab62b11 Merge branch 'maint' 2014-01-04 14:53:10 +01:00
Bastien Guerry 857cf28a90 org.el (org-refile-allow-creating-parent-nodes): Fix typo in docstring
* org.el (org-refile-allow-creating-parent-nodes): Fix typo in
docstring.
2014-01-04 14:53:00 +01:00
Bastien Guerry 31c5e3dc8c Merge branch 'maint' 2014-01-04 14:49:07 +01:00
Bastien Guerry 597a7e65f0 org.el (org-entry-get): Minor docstring enhancement
* org.el (org-entry-get): Minor docstring enhancement.
2014-01-04 14:48:39 +01:00
Bastien Guerry 02078833e0 Merge branch 'maint' 2014-01-04 12:23:27 +01:00
Bastien Guerry 44acd00049 org.el (org-set-startup-visibility): Bugfix
* org.el (org-set-startup-visibility): Bugfix.

See http://article.gmane.org/gmane.emacs.orgmode/79905
2014-01-04 12:22:50 +01:00
Bastien Guerry 914f3f88a7 Merge branch 'maint' 2014-01-03 17:38:19 +01:00
Bastien Guerry bee871762c org.el (org-shiftcontrolup, org-shiftcontroldown): Ignore `org-support-shift-select' when point is on a clock log
* org.el (org-shiftcontrolup, org-shiftcontroldown): When
`org-support-shift-select' is not `nil', let-bind it to nil
if point is on a clock log.  Otherwise throw an error.
2014-01-03 17:38:02 +01:00
Bastien Guerry f531d06f80 Merge branch 'maint' 2014-01-03 11:16:30 +01:00
Bastien Guerry f21150f185 org.el (org-do-emphasis-faces): Fix false positives handling
* org.el (org-do-emphasis-faces): Handle false positives by
restarting the re-search one char after the beginning of the
match, not one char before its ending.

Before this fix, consider this buffer

** Headline
  - *Bold* non-bold
  - *Bold* non-bold

The first false positive is "** Headline\n  - *Bold*"

Starting the search again from the last "*" will skip
the "*Bold*" string.  Starting again at "* Headline" will
find it.
2014-01-03 11:16:14 +01:00
Bastien Guerry af97893516 Merge branch 'maint' 2014-01-03 10:07:31 +01:00
Bastien Guerry 9758f203fb org.el (org-entry-put): Check that the value provided is a string
* org.el (org-entry-put): Check that the value provided is a
string.  If it is nil, convert it to the empty string.
2014-01-03 10:07:09 +01:00
Bastien Guerry c8bb89faca Merge branch 'maint' 2013-12-30 10:32:24 +01:00
Bastien Guerry 8bb519d934 Fix defcustoms: don't quote const values.
* ob-latex.el (org-babel-latex-htlatex-packages): Use repeat
instead of list as the defcustom type.

* ox.el (org-export-with-creator):
* org.el (org-loop-over-headlines-in-active-region)
(org-mouse-1-follows-link, org-provide-todo-statistics):
* org-agenda.el (org-agenda-custom-commands-local-options)
(org-agenda-start-with-log-mode)
(org-agenda-show-inherited-tags): Don't quote const values.

Thanks to Glenn Morris for reporting this.
2013-12-30 10:30:44 +01:00
Eric Schulte be70c688b2 fix typo
* lisp/org.el (org-babel-load-languages): Forgot to capitalize "j".
2013-12-20 10:11:29 -07:00
Eric Schulte 44f6bde0cf add J to babel languages
* lisp/org.el (org-babel-load-languages): Add J to babel languages.
2013-12-20 10:05:10 -07:00
Aaron Ecay 5b9e79c8b8 org.el: use a shy regex for fontifying macros
* lisp/org.el (org-set-font-lock-defaults): use a shy regex for
identifying macros to fontify

Before this change, the xxx in the following text would be erroneously
fontified with the macro face:

{{{macro1()}}} xxx {{{macro2()}}}
2013-12-15 23:31:47 -05:00
Bastien Guerry 0eb020a377 Merge branch 'maint' 2013-12-07 08:17:46 +01:00
Bastien Guerry 7fe99af695 Fix bug when using both electric-pair-mode and delete-selection-mode
* org.el (org-self-insert-command)
(orgtbl-self-insert-command): Change the value of the
`delete-selection' property to allow other commands like
`electric-pair-will-use-region' to be run before deletion.

Thanks to Harald Hanche-Olsen for reporting this.
2013-12-07 08:17:33 +01:00
Nicolas Goaziou 37eb0df867 Move `org-comment-dwim' in an appropriate section
* lisp/org.el (org-comment-dwim): Move function into "comment" related
  part of the library.
2013-12-06 16:37:57 +01:00
Bastien Guerry 487c74580c Fix bug when commenting source code.
* org.el (org-babel-do-in-edit-buffer): Declare.
(org-babel-load-file, org-insert-comment)
(org-comment-or-uncomment-region): Don't require 'ob-core.
(org-mode-map): Remap `comment-dwim' to `org-comment-dwim'.
(org-comment-dwim): New command.

* ob-core.el (org-babel-do-in-edit-buffer): Make an autoload.

See http://lists.gnu.org/archive/html/emacs-devel/2013-12/msg00154.html
for a discussion about this bug.
2013-12-06 10:45:35 +01:00
Nicolas Goaziou 3a317abc23 Merge branch 'maint' 2013-12-03 21:50:45 +01:00
Nicolas Goaziou af6f14d907 Fix C-c C-c behaviour on some objects
* lisp/org.el (org-ctrl-c-ctrl-c): When point is on an unsupported
  object, look for something to do at a higher level instead of
  bailing out.

For example, C-c C-c should toggle checkbox in the following example
even though X point is technically on a subscript.

  - [ ] a_Xb
2013-12-03 21:41:48 +01:00
Bastien Guerry c811bb0ea5 org.el (org-cycle-hide-drawers): Fix bug about re-searching at the wrong side of point
* org.el (org-cycle-hide-drawers): Fix bug about re-searching
at the wrong side of point.

The bug was introduced by this commit:
http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=e8bafd

And reported here:
http://article.gmane.org/gmane.emacs.orgmode/79282
2013-11-28 06:27:57 +01:00
Achim Gratz e655e664bf org: check for derived-mode-p instead of "org-mode" exactly
* lisp/org.el (org-mode-restart): Check for derived-mode-p instead of
  "org-mode" exactly.  This covers a situation normal-mode already
  instantiates a derived mode (e.g. via file local variables).
2013-11-27 20:52:03 +01:00
Achim Gratz f2483ec4bb org: fix commit 0911edfac8
* lisp/org.el (org-mode-restart): After `normal-mode´ the mode may not
  be "org-mode".  Explicitly switch to org-mode in that case.
2013-11-27 19:56:38 +01:00
Nick Dokos 0911edfac8 Second try: Ensure that file local variables are set
* lisp/org.el (org-mode-restart): Call normal-mode,
  instead of org-mode. This will set the mode but it
  will also set file local variables properly.

Reported by Tom Dye: C-c C-c on e.g an #+OPTIONS line
would lose file local variable settings.

The original fix (commit 5ea0228) was incorrect: if the
local variable was a mode setting, then we ended up in an
"infinite" recursion. Problem found, reported and a reproducer
provided by York Zhao.
2013-11-27 09:19:56 -05:00
Nick Dokos a82a5206f3 Revert "Ensure that file local variables are set"
This reverts commit 5ea02285ba.

York Zhao ran into an infinite recursion with this "fix".
2013-11-27 09:19:55 -05:00
Nicolas Goaziou 2b22886005 org-element: Prepare signature change
* lisp/ob-exp.el: Declare signature change.
* lisp/org-macro.el: Declare signature change.
* lisp/org.el (org-backward-element, org-drag-element-backward): Avoid
  using optional argument from `org-element-at-point'.
* testing/lisp/test-org-element.el: Update test.
2013-11-26 18:08:19 +01:00
Nicolas Goaziou 4a27c2b4b6 Improved Flyspell checks
* lisp/org.el (org-mode-flyspell-verify): Rewrite function using
  Org parser.  As a consequence, Org is more cautious about areas
  where checks are allowed.
(org-fontify-meta-lines-and-blocks-1, org-activate-footnote-links): Be
subtler when removing flyspell overlays.
(org-unfontify-region): Remove reference to unused `org-no-flyspell'
property.
(org-fontify-drawers): New function.
(org-set-font-lock-defaults): Use new function to fontify drawers.
* contrib/lisp/org-wikinodes.el (org-wikinodes-activate-links): Remove
reference to unused `org-no-flyspell' property.
2013-11-24 16:14:09 +01:00
Nicolas Goaziou e8bafdd04f Optimize hiding all drawers in a buffer
* lisp/org.el (org-cycle-hide-drawers): Make sure each drawer is only
  flagged once.
2013-11-23 09:34:48 +01:00
Nicolas Goaziou 402c310f00 Fix some defconst and docstrings
* lisp/org.el (org-drawer-regexp, org-clock-drawer-start-re,
  org-clock-drawer-end-re): Fix docstring.
(org-clock-drawer-re): Fix value
2013-11-23 09:34:48 +01:00
Bastien Guerry b6a1584fa6 Merge branch 'maint' 2013-11-22 22:33:05 +01:00
Nicolas Richard a598e9c163 Remove old comment
The comment was introduced (in git) at commit
4be4c56239 ; it refers to a
FIXME located ~40 lines above it. The FIXME was removed in
dc8bc8e392.
2013-11-22 22:32:45 +01:00
Nicolas Goaziou 72a81dd06a Fix export of links to attachements (part 2)
* lisp/org.el (org-entry-get): Widen buffer in order to retrieve
  properties, as `org-entry-properties' and
  `org-entry-get-with-inheritance' already do.
2013-11-22 12:42:41 +01:00
Nicolas Goaziou 5ae3a25755 Fix export of links to attachments (part 2)
* lisp/org.el (org-entry-get): Widen buffer in order to retrieve
  a property, as both `org-entry-properties' and
  `org-entry-get-with-inheritance' already do.
2013-11-22 12:39:15 +01:00
Nick Dokos 5ea02285ba Ensure that file local variables are set
* lisp/org.el (org-mode): Call `hack-local-variables'
  at the end of `org-mode' to set file local variables.
  Cribbed from `normal-mode'.

Reported by Tom Dye: C-c C-c on e.g an #+OPTIONS line
would lose file local variable settings.
2013-11-21 00:30:05 -05:00
Nicolas Goaziou d35233f84a Merge branch 'maint' 2013-11-18 20:49:43 +01:00
Nicolas Goaziou c5aad89f5a Fix export of links to attachements
* lisp/org.el (org-entry-properties): Ignore narrowing when retrieving
  current headline properties.
2013-11-18 19:11:17 +01:00
Michael Brand 971a3a4e48 Hyperlink: Use url-encode-url for browse-url
* lisp/org.el (org-open-at-point): When available (Emacs 24.3.1) use
`url-encode-url' instead of `org-link-escape-browser'.
2013-11-17 12:00:18 +01:00
Bastien Guerry 9214000c21 Merge branch 'maint'
Conflicts:
	doc/org.texi
2013-11-17 09:17:39 +01:00
Bastien Guerry 4e798549fe Backport Paul's fixes from Emacs trunk (2/2)
See http://article.gmane.org/gmane.emacs.diffs/123123
2013-11-17 09:15:25 +01:00
Bastien Guerry f8661f7e3d Merge branch 'maint' 2013-11-17 08:47:48 +01:00
Bastien Guerry a3d7cdcd9e Fix version for org-(export-with|use)-sub-superscript
* ox.el (org-export-with-sub-superscripts):
* org.el (org-use-sub-superscripts): Fix version and enhance
docstring again.
2013-11-17 08:46:50 +01:00
Nicolas Goaziou 19d7481665 Change some defcustoms into defconsts
* lisp/org.el (org-clock-string, org-closed-string)
  (org-deadline-string, org-scheduled-string)
  (org-archive-tag, org-comment-string, org-quote-string)
  (org-effort-property, org-latex-regexps): Turn variables into
  constants.
* testing/lisp/test-org-element.el: Update tests.
* testing/lisp/test-ox.el: Update tests.

Also collect all syntax related constants in the same part of the
file.
2013-11-16 21:22:21 +01:00
Achim Gratz 54a64f50b5 ob-C, ob-clojure, ob-tangle, org-agenda, org, ox: fix byte-compiler warnings
* lisp/ob-C.el, lisp/ob-clojure.e: Require 'cl at compile-time.
* lisp/ob-tangle.el: Do not require 'cl at compile time.
* lisp/org-agenda.el: Declare function `org-columns-remove-overlays´.
* lisp/org.el: Declare functions `org-clocktable-shift´,
  `org-clock-update-time-maybe´, `org-clock-remove-overlays´,
  `org-babel-tangle-file´, `org-table-blank-field´,
  `org-table-insert-row´, `org-add-archive-files´, `org-table-begin´,
  `org-table-end´.  Move defsubst `org-uniquify´ before its many uses.
* lisp/ox.el: Move defsubst `org-export-get-parent´ before its many
  uses.
2013-11-15 20:18:58 +01:00
Bastien Guerry 0a6b6bf735 Enhance docstrings
* ox.el (org-export-with-sub-superscripts):
* org.el (org-use-sub-superscripts): Enhance docstrings.

Thansk to Dieter and Nick for raising this.
2013-11-15 10:08:25 +01:00
Bastien Guerry 668ba5de0e Merge branch 'maint' 2013-11-15 06:56:10 +01:00
Achim Gratz 97e99614d8 org.el: Fix a variable name error
* lisp/org.el (org-version): Fix an error imported with merge in
  f95641c443, replace `_version´ by `version1´.
2013-11-15 06:55:59 +01:00
Bastien Guerry bf012136bd Remove org-autoload.
* org-macs.el (org-autoload): Delete.

* org-docview.el ("docview"): Fix declarations and require
doc-view directly.

* org-id.el (org-id-copy)
(org-id-get-with-outline-path-completion)
(org-id-get-with-outline-drilling, org-id-new):
* org-colview.el:
(org-colview-initial-truncate-line-value)
(org-columns-open-link, org-string-to-number):
* org-clock.el:
(org-clock-put-overlay, org-count-quarter, org-clock-loaded):
* org-archive.el (org-get-local-archive-location):
* org-agenda.el (org-agenda-todo-custom-ignore-p):
Autoload.

Those functions were autoloaded from within calls to `org-autoload'
in org.el, we now autoload them from where they live.
2013-11-15 06:55:28 +01:00
Bastien Guerry f327d42734 Merge branch 'maint'
Conflicts:
	lisp/ox.el
2013-11-15 06:24:07 +01:00
Bastien Guerry 22a061f575 Partially revert commit adcebf
* ox.el (org-export-async-init-file):
* ox-odt.el (org-odt-with-latex):
* ox-html.el (org-html-with-latex):
* org.el (org-return-follows-link):
* ob-python.el (org-babel-python-command): Don't use :set.

Thanks to Glenn Morris for pointing at this.
2013-11-15 06:22:36 +01:00
Bastien Guerry 19dd1e1cc3 Fix commit 1eb03c8c87
Thanks to Michael Brand for reporting this.
2013-11-14 23:39:54 +01:00
Achim Gratz 920e726758 org.el: Fix a variable name error
* lisp/org.el (org-version): Fix an error imported with merge in
  f95641c443, replace `_version´ by `version1´.
2013-11-14 21:21:58 +01:00
Bastien Guerry 786ebde303 Merge branch 'maint'
Conflicts:
	lisp/ox.el
2013-11-14 14:09:25 +01:00
Bastien Guerry adcebf38f8 Fix errors reported by cus-test.el
* ox.el (org-export-async-init-file): Use :set to set the
default value.

* ox-texinfo.el (org-texinfo-filename): Fix default value.
(org-texinfo-format-headline-function): Use 'ignore as the
default value.
(org-texinfo-format-drawer-function): Use a function as the
default value.  Update docstring.
(org-texinfo-drawer): Always use
`org-texinfo-format-drawer-function' as it is now a function
by default.
(org-texinfo-headline): Compare
`org-texinfo-format-headline-function' against 'ignore.
(org-texinfo-inlinetask): Compare
`org-texinfo-format-inlinetask-function' against 'ignore.

* ox-odt.el (org-odt-format-drawer-function): Use a function
as the default value.  Update docstring.
(org-odt-format-headline-function)
(org-odt-format-inlinetask-function): Fix default value.
(org-odt-with-latex): Use :set to set the default value.
(org-odt-drawer): Always use `org-odt-format-drawer-function'
as it is now a function by default.
(org-odt-format-headline--wrap): Compare
`org-odt-format-headline-function' against 'ignore.

* ox-latex.el (org-latex-format-drawer-function): Use a
function as the default value.  Update docstring.
(org-latex-format-inlinetask-function): Fix default value.
(org-latex-drawer): Always use
`org-latex-format-drawer-function' as it is now a function by
default.
(org-latex-inlinetask): Compare
`org-latex-format-inlinetask-function' against 'ignore.

* ox-html.el (org-html-format-drawer-function): Use a
function as the default value.  Update docstring.
(org-html-format-headline-function)
(org-html-format-inlinetask-function): Fix default value.
(org-html-with-latex): Use :set to set the default value.
(org-html--format-toc-headline)
(org-html-format-headline--wrap): Compare
`org-html-format-headline-function' against 'ignore.
(org-html-inlinetask): Compare
`org-html-format-inlinetask-function' against 'ignore.

* ox-ascii.el (org-ascii-format-drawer-function): Use a
function as the default value.  Update docstring.
(org-ascii-drawer): Always use
`org-ascii-format-drawer-function' as it is now a function by
default.
(org-ascii-format-inlinetask-default): New function.
(org-ascii-format-inlinetask-function): Use
`org-ascii-format-inlinetask-default' as the default.

* org.el (org-mouse-1-follows-link): Use :set to set the
default value.  Update custom type.
(org-log-note-headings): Fix order or list items in the custom
type.
(orgstruct-heading-prefix-regexp): Use an empty string as the
default value.  Use 'regexp as the custom type.
(orgstruct-make-binding): Tiny docstring enhancement.  Assume
`orgstruct-heading-prefix-regexp' is a string.

* org-agenda.el (org-agenda-search-view-max-outline-level):
Set default value to 0.  Update docstring.
(org-agenda-deadline-leaders): Fix custom type.
(org-search-view): Assume
`org-agenda-search-view-max-outline-level' is a number.

* ob-ruby.el (org-babel-ruby-nil-to): Fix custom type.

* ob-python.el (org-babel-python-mode): Use :set to set the
default value.
(org-babel-python-None-to): Fix custom type.

* ob-plantuml.el (org-plantuml-jar-path): Fix default value.
(org-babel-execute:plantuml): Assume `org-plantuml-jar-path'
is a string.

* ob-latex.el (org-babel-latex-htlatex): Fix default value.
(org-babel-latex-htlatex-packages): Fix custom type.
(org-babel-execute:latex): Assume `org-babel-latex-htlatex' is
a string.

Thanks to Glenn Morris for reporting this.
2013-11-14 14:05:18 +01:00
Bastien Guerry 6f6d90a363 org.el (org-refile-check-position): Enhance error message
* org.el (org-refile-check-position): Enhance error message.
2013-11-14 00:53:43 +01:00
Bastien Guerry 6a39355eee org.el: Name indirect buffer after the subtree's heading
* org.el (org-get-indirect-buffer): New optional argument
`heading'.  Use it to name the indirect buffer after the
heading the subtree, if any.
(org-tree-to-indirect-buffer): Use the new argument.

Thanks to Karl Voit for suggesting this.
2013-11-13 14:03:21 +01:00
Bastien Guerry 1eb03c8c87 org.el: Allow C--1 C-c C-t to set repeated tasks to a done state
* org.el (org-cancel-repeater): New function.
(org-todo): Use the new function to cancel a repeater when
called with a numeric arg of -1.

Thanks to Kenneth Jacker for requesting a similar feature.
2013-11-13 13:56:12 +01:00
Bastien Guerry 71884cc039 Merge branch 'maint'
Conflicts:
	lisp/ob-C.el
	lisp/ob-clojure.el
	lisp/ob-core.el
	lisp/ob-lisp.el
	lisp/org-clock.el
2013-11-12 21:00:49 +01:00
Bastien Guerry f95641c443 Backport changes from Emacs revs 115081 and 115082
2013-11-12  Stefan Monnier  <monnier@iro.umontreal.ca>

	Address some byte-compiler warnings.
	* ob-abc.el (org-babel-expand-body:abc): Use dolist.
	(org-babel-execute:abc): Fix regexp quoting.
	* ob-calc.el (org--var-syms): Rename from `var-syms'.
	* ob-lilypond.el (ly-compile-lilyfile): Remove redundant let-binding.
	* ob-table.el (sbe): Move debug declaration.
	* org-clock.el (org--msg-extra): Rename from `msg-extra'.
	* org.el (org-version): Avoid var name starting with _.
	(org-inhibit-startup, org-called-with-limited-levels)
	(org-link-search-inhibit-query, org-time-was-given)
	(org-end-time-was-given, org-def, org-defdecode, org-with-time):
	* org-colview.el (org-agenda-overriding-columns-format):
	* org-agenda.el (org-agenda-multi, org-depend-tag-blocked)
	(org-agenda-show-log-scoped):
	* ob-python.el (py-which-bufname, python-shell-buffer-name):
	* ob-haskell.el (org-export-copy-to-kill-ring):
	* ob-exp.el (org-link-search-inhibit-query):
	* ob-R.el (ess-eval-visibly-p):
	* ob-core.el (org-src-window-setup): Declare before use.
	(org-babel-expand-noweb-references): Remove unused `blocks-in-buffer'.
	* ox-odt.el (org-odt-hfy-face-to-css):
	* org-src.el (org-src-associate-babel-session, org-src-get-lang-mode):
	* org-bibtex.el (org-bibtex-get, org-bibtex-ask, org-bibtex)
	(org-bibtex-check):
	* ob-tangle.el (org-babel-tangle, org-babel-spec-to-string)
	(org-babel-tangle-single-block, org-babel-tangle-comment-links):
	* ob-table.el (sbe):
	* ob-sqlite.el (org-babel-sqlite-expand-vars):
	* ob-sql.el (org-babel-sql-expand-vars):
	* ob-shen.el (org-babel-execute:shen):
	* ob-sh.el (org-babel-execute:sh, org-babel-sh-evaluate):
	* ob-scala.el (org-babel-scala-evaluate):
	* ob-ruby.el (org-babel-ruby-table-or-string)
	(org-babel-ruby-evaluate):
	* ob-python.el (org-babel-python-table-or-string)
	(org-babel-python-evaluate-external-process)
	(org-babel-python-evaluate-session):
	* ob-picolisp.el (org-babel-execute:picolisp):
	* ob-perl.el (org-babel-perl-evaluate):
	* ob-maxima.el (org-babel-execute:maxima):
	* ob-lisp.el (org-babel-execute:lisp):
	* ob-java.el (org-babel-execute:java):
	* ob-io.el (org-babel-io-evaluate):
	* ob-haskell.el (org-babel-execute:haskell):
	* ob-fortran.el (org-babel-execute:fortran):
	* ob-exp.el (org-babel-exp-code):
	* ob-emacs-lisp.el (org-babel-execute:emacs-lisp):
	* ob-ditaa.el (org-babel-execute:ditaa):
	* ob-core.el (org-babel-execute-src-block, org-babel-sha1-hash)
	(org-babel-parse-header-arguments, org-babel-reassemble-table)
	(org-babel-goto-src-block-head, org-babel-mark-block)
	(org-babel-expand-noweb-references, org-babel-script-escape)
	(org-babel-process-file-name):
	* ob-clojure.el (org-babel-execute:clojure):
	* ob-calc.el (org-babel-execute:calc):
	* ob-awk.el (org-babel-execute:awk):
	* ob-abc.el (org-babel-execute:abc):
	* ob-R.el (org-babel-expand-body:R):
	* ob-C.el (org-babel-C-execute): Avoid deprecated ((lambda) ...).

2013-11-12  Glenn Morris  <rgm@gnu.org>

	* ox-html.el (org-html-scripts): Add 2013 to copyright years.
	(org-html-infojs-template): Copyright holder to FSF.
2013-11-12 20:57:31 +01:00
Bastien Guerry 7ca6817495 Merge branch 'maint' 2013-11-11 18:14:24 +01:00
Bastien Guerry 6a577a2b5a org.el (org-deadline, org-schedule): Fix bug
* org.el (org-deadline, org-schedule): Fix bug: allow to
update scheduled/deadline information anywhere in the subtree.
2013-11-11 18:14:11 +01:00
Bastien Guerry 086d502c91 org.el (org-todo): Tiny docstring enhancement
* org.el (org-todo): Tiny docstring enhancement.
2013-11-11 17:01:21 +01:00
Bastien Guerry d94c53b440 Merge branch 'maint' 2013-11-09 17:48:44 +01:00
Bastien Guerry 132994911b org.el (org-align-tags-here): Fix bug: move to the correct position
* org.el (org-align-tags-here): Fix bug: move to the correct
position.

Thanks to Reuben Garrett for reporting this bug.
2013-11-09 17:47:59 +01:00
Nicolas Goaziou 7ffc460c7f Merge branch 'maint' 2013-11-06 16:52:49 +01:00
Jonas Hoersch 4c04c13a18 org-inlinetask: Hide inline tasks in 'children visibility state
* lisp/org.el (org-cycle-hide-inline-tasks): Re-hide inline tasks when
  switching to 'children visibility state.

TINYCHANGE
2013-11-06 16:51:56 +01:00
Bastien Guerry 39d22406e4 Merge branch 'maint' 2013-11-06 16:16:07 +01:00
Bastien Guerry fe3379bda6 org.el (org-agenda-prepare-buffers): Restore the point position
* org.el (org-agenda-prepare-buffers): Restore the point
position.

Thanks to Samuel Wales for spotting this.
2013-11-06 16:15:45 +01:00
Bastien Guerry 28ccbed523 Merge branch 'maint' 2013-11-05 21:54:37 +01:00
Bastien Guerry 06ae4f07a1 org.el (org-insert-link): Don't remove brackets when they belong to a timestamp in a headline
* org.el (org-insert-link): Don't remove brackets when they
belong to a timestamp in a headline.

Thanks to David Belohrad for spotting this.
2013-11-05 21:54:12 +01:00
Oleh 15d1709b19 org.el (org-use-speed-commands): Enhance docstring
* org.el (org-use-speed-commands): Enhance docstring.

TINYCHANGE
2013-11-05 19:14:55 +01:00
Bastien Guerry 086d5ffe62 Merge branch 'maint' 2013-11-05 12:14:25 +01:00
Bastien Guerry 6c48056b2b Some clean-up related to org-remember being removed
* org.el (org-directory, org-default-notes-file)
(org-reverse-note-order): Don't use the `org-remember'
customization group.
(org-require-autoloaded-modules): Don't require
`org-remember'.

* org-capture.el: Update commentary section to reflect the
fact that org-remember.el is not used anymore.
2013-11-05 12:13:46 +01:00
Bastien Guerry e63b87a46f org.el (org-open-file): Reveal context around point
* org.el (org-open-file): Reveal context around point when
opening a link to an Org file with a line number.

Thanks to François Pinard for suggesting this.
2013-11-05 00:05:33 +01:00
Nicolas Goaziou 28f4b89830 Small refactoring in comment functions
* lisp/org.el (org-insert-comment, org-comment-or-uncomment-region):
  Use `org-element-at-point' instead of `org-in-src-block-p' to check
  if we're within a source block.
* testing/lisp/test-org.el: Add test.
2013-11-04 18:13:55 +01:00
Yasushi SHOJI 228ea6881b lisp/org.el (org-set-tags): Calculate width of tags with string-width
* lisp/org.el (org-set-tags): Width of strings presenting on a buffer
should be calculated with `string-width' instead of `length'.

This fixes unaligned tags for the languages with multi-width
characters.

TINYCHANGE
2013-11-04 13:11:12 +01:00
Bastien Guerry ae1e22b64d org.el (org-sort-entries): Enhance the docstring
* org.el (org-sort-entries): Mention the
`org-after-sorting-entries-or-items-hook' hook in the
docstring.

Thanks to Andreas Röhler for suggesting this.
2013-11-04 12:52:01 +01:00
Aaron Ecay 2d444c1647 make comment-dwim in source code blocks more DWIM-ish
* lisp/org.el (org-insert-comment, org-comment-or-uncomment-region):
use the relevant language’s major mode comment function if called from
within a source block.

This patch makes it easier to (un)comment lines of babel source.  Now
M-; in a soucre code block should Just Work.

The modification to ‘org-insert-comment’ also fixes a bug, whereby the
function would eat blank lines after it.  The first block, where ! is
the point, would lead to the second instead of the third:

 #+name: orig
 #+begin_src org
 xxxxxxx
 !

 yyyyyy
 #+end_src

 #+name: bad
 #+begin_src org
 xxxxxxx
 #
 yyyyyy
 #+end_src

 #+name: desired
 #+begin_src org
 xxxxxxx
 #

 yyyyyy
 #+end_src

Also, the ‘org-comment-or-uncomment-region’ change results in an
undesirably move of the point after the comment is created.  This is
because ‘comment-region’ wraps the call to ‘comment-region-function’
in a ‘save-excursion’.  The org mode code deletes and reinserts the
whole babel block, which confuses save-excursion.  Org carefully puts
the point back in the proper place, but comment-region’s
save-excursion then substitutes its own erroneous placement.
2013-11-04 12:28:35 +01:00
Bastien Guerry 2ac57db0a3 Merge branch 'maint' 2013-11-04 12:20:20 +01:00
Bastien Guerry 56d405a41c org.el (org-babel-load-file): Set `exported-file' correctly
* org.el (org-babel-load-file): Set `exported-file' correctly,
in case the file as been tangled using a buffer-local value.

* ob-tangle.el (org-babel-tangle-file): Return the list of
tangled files.

Thanks to Sam Flint for reporting this.
2013-11-04 12:19:45 +01:00
Nicolas Goaziou 08bebd70ed Merge branch 'maint' 2013-11-03 14:19:54 +01:00
Nicolas Goaziou d61ce8edd1 Fix flyspell behaviour on verbatim objects
* lisp/org.el (org-do-emphasis-faces): Look for verbatim status at
  correct location.
2013-11-03 14:18:19 +01:00
Nicolas Goaziou 0cecf32a0a org-element: Implement caching for dynamic parser
* lisp/org-element.el (org-element-use-cache, org-element--cache,
org-element--cache-sync-idle-time,
org-element--cache-merge-changes-threshold, org-element--cache-status,
org-element--cache-opening-line, org-element--cache-closing-line): New
variables.
(org-element-cache-reset, org-element--cache-pending-changes-p,
org-element--cache-push-change, org-element--cache-cancel-changes,
org-element--cache-get-key, org-element-cache-get,
org-element-cache-put, org-element--shift-positions,
org-element--cache-before-change, org-element--cache-record-change,
org-element--cache-sync): New functions.
(org-element-at-point, org-element-context): Use cache when possible.
* lisp/org.el (org-mode, org-set-modules): Reset cache.
* lisp/org-footnote.el (org-footnote-section): Reset cache.
* testing/lisp/test-org-element.el: Update tests.

This patch gives a boost to `org-element-at-point' and, to a lesser
extent, to `org-element-context'.
2013-11-03 13:09:54 +01:00
Nicolas Goaziou 1bf67e2903 Merge branch 'maint' 2013-11-03 13:08:44 +01:00
Nicolas Goaziou e186cc804b Fix wrong-type-argument error when opening id link
* lisp/org.el (org-open-at-point): Check if link is non-nil before
  matching it.

Reported-by: Daniel Clemente <n142857@gmail.com>
2013-11-03 13:06:14 +01:00
Nicolas Goaziou e7397d3d97 Fix small bug
* lisp/org.el (org-display-inline-images): Fix bug introduced in
  cab0d40593.
2013-11-02 17:41:30 +01:00
Nicolas Goaziou b392750108 Prevent flagging drawers in example blocks
* lisp/org.el (org-flag-drawer): Rewrite function using Elements.
  Also prevents flagging drawers within example blocks.
* testing/lisp/test-org.el (test-org/flag-drawer): Add test.
2013-11-02 15:50:29 +01:00
Nicolas Goaziou cab0d40593 Fix inline images display
* lisp/org.el (org-display-inline-images): Rewrite function.
2013-11-02 14:23:41 +01:00
Rick Frankel cebf7d012d org.el: Display images in link descriptions.
* lisp/org.el (org-display-inline-images): Modify link regular
  expression to match images in description part. Update doc string to
  explain link behavior.
2013-10-31 17:34:54 -04:00
Nicolas Goaziou 6202ec7b3b Remove need to declare drawers before using them
* lisp/org-agenda.el (org-agenda-prepare): Remove reference to
  `org-drawers-for-agenda'.
(org-agenda-show-1): Remove reference to `org-drawers'.
* lisp/org-clock.el (org-clock-remove-empty-clock-drawer,
  org-clock-cancel): Apply signature change to
  `org-remove-empty-drawer-at'.
* lisp/org-element.el (org-element--list-struct): Use
  `org-drawer-regexp' instead of `org-drawers'.
* lisp/org-feed.el (org-feed-drawer): Update docstring according to
  change.
* lisp/org-list.el (org-in-item-p, org-list-context): Use
  `org-drawer-regexp' instead of `org-drawers'.
* lisp/org-mobile.el (org-mobile-create-index-file): Remove reference
  to `org-drawers-for-agenda'.
* lisp/org-pcomplete.el (pcomplete/org-mode/drawer): Remove function.
* lisp/org.el (org-drawer-regexp): Make variable global.
(org-drawers): Remove variable.
(org-set-regexps-and-options): Ignore DRAWER keyword.
(org-cycle): Use `org-drawer-regexp' instead of `org-drawers'.
(org-cycle-hide-drawers): Add an optional argument to ignore some
drawers.
(org-remove-empty-drawer-at): Remove second argument.  Rewrite
function.
(org-clone-subtree-with-time-shift): Apply signature change to
`org-remove-empty-drawer-at'.
(org-toggle-ordered-property): Apply `org-delete-property' signature
change.
(org-map-entries): Remove reference to `org-drawers-for-agenda'.
(org-entry-delete): Remove optional argument.  Small refactoring.
(org-insert-drawer): Remove reference to `org-drawers'.
(org-delete-property): Apply `org-entry-delete' signature change.
(org-in-drawer-p): Rewrite function.
* testing/lisp/test-org-element.el: Update tests.
* testing/lisp/test-org.el: Update tests.
* testing/lisp/test-ox.el: Update tests.
2013-10-31 21:19:40 +01:00
Nicolas Goaziou 0be044736c Merge branch 'maint' 2013-10-29 09:57:48 +01:00
Nicolas Goaziou a7e5a74e2c Fix `org-insert-heading' at buffer boundaries
* lisp/org.el (org-insert-heading): Do not error out when inserting is
  to be done at one of the buffer's boundaries.
* testing/lisp/test-org.el: Add tests.
2013-10-29 09:55:01 +01:00
Ingo Lohmar 8eadca98a6 Fix org-insert-todo-heading-respect-content in plain list item
* lisp/org.el (org-insert-todo-heading-respect-content): Pass correct
prefix arg to always insert heading.

TINYCHANGE

This function used a second argument t, which is eventually passed to
org-insert-heading, adding a list item when inside a plain list.  Use
the proper argument '(4) now, to always create a heading, just like
the function's name and documentation imply.
2013-10-29 09:37:53 +01:00
Nicolas Goaziou dca85fec62 Merge branch 'maint' 2013-10-28 09:53:42 +01:00
Joost Diepenmaat da232c9711 Correctly indent BEGIN_SRC and END_SRC lines
* lisp/org.el (org-indent-region): BEGIN_SRC and END_SRC lines should
  not be considered part of the source block for the purposes of
  indentation.

TINYCHANGE
2013-10-28 09:52:00 +01:00
Michael Gauland 416f5ee423 Add ebnf support to babel. 2013-10-26 11:37:46 -06:00
Nicolas Goaziou fe27ca9906 org-element: Remove folding status in parsed data
* lisp/org-element.el (org-element-center-block-parser,
  org-element-drawer-parser, org-element-dynamic-block-parser,
  org-element-item-parser, org-element-quote-block-parser,
  org-element-comment-block-parser, org-element-export-block-parser,
  org-element-verse-block-parser, org-element-special-block-parser,
  org-element-example-block-parser, org-element-headline-parser,
  org-element-inlinetask-parser): Remove :hiddenp property.
* lisp/org.el (org-end-of-line, org-down-element): Use an equivalent
  of :hiddenp property.
* testing/lisp/test-org-element.el: Remove tests.

The property is removed because it is buggy (e.g., when there's a link
just after a block opening line) and not really useful.
2013-10-17 22:45:00 +02:00
Michael Brand e04a22ed2d Small improvement of maintainability of link escaping
* lisp/org.el (org-link-escape-chars): Add comment with escape numbers
alphabetically ordered.
(org-link-escape-chars-browser): Add comment with escape numbers.
(org-link-escape): Use better readable char constant instead of number
constant for percent char.
(org-link-escape-browser): New function to substitute duplicate source
code.
(org-open-at-point): Substitute duplicate source code.
* testing/README: Make comment in source code example clearer.
* testing/lisp/test-org.el (test-org/org-link-escape-chars-browser):
Change URL to real use case and use the new function
`org-link-escape-browser'.
2013-10-17 06:59:00 +02:00
Nicolas Goaziou 2020009cc9 Merge branch 'maint' 2013-10-03 13:44:20 +02:00
Nicolas Goaziou 79ee98d755 Fix check-box toggling when point is on a link at an item
* lisp/org.el (org-ctrl-c-ctrl-c): When using C-c C-c at an item with
  point on a link, make sure checkbox, if any, is toggled.

Reported-by: Christoph LANGE <math.semantic.web@gmail.com>
2013-10-03 13:41:09 +02:00
Carsten Dominik 08d9c1b42c Fix two regular expressions
* lisp/org.el (org-property-drawer-re): Make less greedy to avoid
overreaching matches.
(org-clock-drawer-re): Make less greedy to avoid
overreaching matches.
2013-10-01 20:19:42 +02:00
Nicolas Richard 12de6223dc C-u C-u C-c ! inserts an active timestamp.
I suggest the following change so that C-u C-u C-c ! inserts an inactive
timestamp. I also document the INACTIVE argument of org-time-stamp.

--
Nicolas.

From 5cdb18297d92f2d99334d98aa2f3b8a40e44702f Mon Sep 17 00:00:00 2001
From: Nicolas Richard <theonewiththeevillook@yahoo.fr>
Date: Mon, 29 Apr 2013 09:02:21 +0200
Subject: [PATCH] Enforce the convention that C-c ! inserts inactive
 timestamps.

* lisp/org.el (org-time-stamp): When INACTIVE is non-nil, insert an
  inactive timestamp also with double universal argument.
2013-09-22 07:57:11 +02:00
Carsten Dominik cf6e54e90b Improve behvior of org-insert-heading to end of subtree
* lisp/org.el (org-insert-heading): Improve whitespace behavior at
end of subtree.

In a subtree with lots of empty space at the end, until now the new
entry would be inserted after all that whitespace.  Now, it is
inserted closer to the existing text, and the whitespace remains after
the new headline.
2013-09-19 04:59:09 +02:00
Carsten Dominik 3f177965ee Revert "Revert "Revert "Use `xdg-open' to open files where available"""
This reverts commit 0022904e83.
2013-09-17 21:51:45 +02:00
Carsten Dominik 508ac0f57a Clean up list of default LaTeX packages
* doc/org.texi (@LaTeX{} specific attributes): Document that tabu
and tabularx packages are not in the default set of packages.
* lisp/org.el (org-latex-default-packages-alist): Add the `rotating'
package to the list of default packages.  Improve docstring.
2013-09-17 07:02:14 +02:00
Carsten Dominik 68b0dba851 Fix spacing and cursor position bug caused by `org-insert-property-drawer'
* lisp/org.el (org-insert-property-drawer): Insert only after space in
current line.

This fixed a bug reported by Mathieu Boespflug, who writes:

> Hi,
>
> consider the following very simple org file:
>
> * TODO Thing1[]
>
> where "[]" marks where the point is. Now if I C-S-RET to insert a new
> TODO heading, I get
>
> * TODO Thing1
> * TODO []
>
> Note that there is a trailing space at the end of the last line, as
> expected. The problem is that if I now press C-c C-x p to set
> a property (any property), then I end up with the following situation:
>
> * TODO Thing1
> * TODO
>  :PROPERTIES:
>  :PROP:     val
>  :END: []
>
> The point is now at the end of the property drawer, rather than where it
> was before. Notice how the trailing whitespace in the heading has
> moreover been moved to after the property drawer.
>
> Expected behaviour:
>
> After C-c C-x p, I expect to get:
>
> * TODO Thing1
> * TODO []
>  :PROPERTIES:
>  :PROP:     val
>  :END:
>
> This is exactly what I get if there is *no trailing whitespace* in the
> TODO heading before hitting C-c C-x p. So it seems that the bug is that
> org-set-property does not deal well with trailing whitespace.
>
> This is a problem because it messes up setting properties by advising
> org-insert-todo-heading, say to set a CREATED property automatically for
> new TODO items.
2013-09-16 08:22:15 +02:00
Carsten Dominik bb331aee96 Keep paragraph motion commands from deactivating the mark
* lisp/org.el (org-forward-paragraph): Do not deactivate the mark.
(org-backward-paragraph): Do not deactivate the mark.
2013-09-14 07:58:56 +02:00
Nicolas Goaziou 43733e33b1 New functions for paragraph-like navigation
* lisp/org.el (org-forward-paragraph, org-backward-paragraph): New
  functions.
* testing/lisp/test-org.el: Add tests.
2013-09-14 00:23:54 +02:00
Carsten Dominik e7649baa3a Merge branch 'maint' 2013-09-13 21:09:49 +02:00
Carsten Dominik de72cd384d Allow to turn of special behavior of `C-o' in tables
* lisp/org.el (org-special-ctrl-o): New option.
(org-open-line): Don't do anything special unless `org-special-ctrl-o'
is non-nil.
2013-09-13 21:09:17 +02:00
Nicolas Goaziou cbbb754cae Allow M-RET to insert items within drawers
* lisp/org.el (org-meta-return): Allow M-RET to insert items within
  drawers.  Rewrite function.

This patch also allows a user to insert a headline within a drawer,
which will basically break it.  The point is to leave user responsible
for his editing actions.
2013-09-12 22:21:12 +02:00
rasmus f76e8c2eb7 Remove eucal package for LaTeX fragments
* org.el (org-format-latex-header): Remove eucal.

With amsmath loaded eucal (basically) only provides an alternative
typeface to \mathcal{.}
2013-09-12 17:05:56 +02:00
rasmus e5f72fdd93 Add amsmath as a global LaTeX dependency
* org.el (org-format-latex-header): Remove amsmath.
(org-latex-default-packages-alist): Remove amstext and add amsmath.

This increases consistency between LaTeX exports and LaTeX preview
snippets.
2013-09-12 17:05:55 +02:00
Carsten Dominik e677589e69 Stop C-a and C-e from deactivating the mark
* lisp/org.el (org-beginning-of-line):
(org-end-of-line): Bind deactivate-mark to avoid that this command
deactivates it.
2013-09-08 18:22:51 +02:00
Carsten Dominik 8ad6f534f9 Fix parenthesis bug left by earlier patch
* lisp/org.el (org-read-date-minibuffer-local-map): Fix parenthesis bug
2013-09-08 08:57:20 +02:00
Carsten Dominik 3e99e9298c Allow sparse trees with property values containing a slash
* lisp/org.el (org-make-tags-matcher): Do not interpret / in property
value as starter of TODO match.
2013-09-08 08:56:17 +02:00
Carsten Dominik b64626ecf4 Preserve point when switching to overview
* lisp/org.el (org-overview): Preserve point.

We want to preserve point when changing global visibility.  This is a
bit dangerouns, because it can leave point in an invisible location.
However, we want to make sure that pressing M-TAG three times returns
us to the same position as before.
2013-09-08 08:13:35 +02:00
Carsten Dominik 75400198ef Merge branch 'maint' 2013-09-08 07:33:34 +02:00
Carsten Dominik e8023dde58 Turn off replacing of disputed keys for the read-date keymap
* lisp/org.el (org-read-date-minibuffer-local-map): Don't replace disputed
keys when defining this keymap.
(org-read-date: Remove unnecessary binding of `org-replace-disputed-keys'.

This original fix did not work, thanks to Miro Bezjak for showing what
the proper fix should be.
2013-09-08 07:33:18 +02:00
Oleh 9a0e84fbd7 Lazy autoloading of org-id.el to follow links
* lisp/org.el (org-open-at-point): The new code is being run in the
same spot as `org-open-link-functions'.  In case they failed, check
if link matches "^id:" and if so, load the id interface and follwo the
link.

This fixes Emacs bug#14910: org-mode `org-open-at-point' doesn't
follow id links.
2013-09-07 21:16:58 +02:00
Nicolas Goaziou 2e3f5558d7 Do not handle `adaptive-fill-regexp' in comments
* lisp/org.el (org-adaptive-fill-function): Do not handle
  `adaptive-fill-regexp' in comments as the behaviour is not
  satisfying.
* testing/lisp/test-org.el: Remove test.
2013-09-06 12:32:13 +02:00
Carsten Dominik 7fdb56a861 Small adjustment to behavior of org-insert-heading
* lisp/org.el (org-insert-heading): Allow to remove blank lines if the
user does not want any.
2013-09-03 16:10:16 +02:00
Carsten Dominik 0022904e83 Revert "Revert "Use `xdg-open' to open files where available""
This reverts commit e26c55f5b5.
2013-09-03 09:54:03 +02:00
Carsten Dominik e26c55f5b5 Revert "Use `xdg-open' to open files where available"
This reverts commit 15ae89b394.
2013-09-02 22:55:30 +02:00
Carsten Dominik 7916e491c5 Fix typo in a docstring
* lisp/org.el (org-unlogged-message): Fix typo in dostring.
2013-09-02 16:15:07 +02:00
Carsten Dominik 15ae89b394 Use `xdg-open' to open files where available
* lisp/org.el (org-file-apps-defaults-gnu): Use `xdg-open' to open files
  where available.
2013-09-02 12:06:28 +02:00
Carsten Dominik ed499997e9 Don't overpopulate the message buffer
* lisp/org.el (org-unlogged-message): New function.
(org-cycle): Use `org-unlogged-message'.
(org-cycle-internal-global): Use `org-unlogged-message'.
(org-cycle-internal-local): Use `org-unlogged-message'.
(org-global-cycle): Use `org-unlogged-message'.
(org-display-outline-path): Use `org-unlogged-message'.
2013-09-02 08:50:00 +02:00
Carsten Dominik a6986494a0 Turn off replacing disputed keys for rog-read-date
* lisp/org.el (org-read-date): Turn off replacing disputed keys when defining
the minibuffer keys during date selection.
2013-09-02 07:51:08 +02:00
Carsten Dominik 2dc1f8d19e Merge branch 'master' of orgmode.org:org-mode 2013-09-01 15:00:07 +02:00
rasmus 8a05053ce4 Remove dependency on latexsym LaTeX package
* ox-latex.el (org-latex-item): Use square as unchecked symbol.
* org.el (org-latex-default-packages-alist): Remove latexsym.

Use amssymb symbols to reduce required packages.
2013-09-01 14:30:36 +02:00