Commit Graph

3182 Commits

Author SHA1 Message Date
Bastien Guerry 932b41e973 org.el (org-refile): Only keep bracket links descriptions in the displayed heading
* 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.
2014-03-19 16:22:46 +01:00
Bastien Guerry 5590531007 Merge branch 'maint' 2014-03-19 16:13:43 +01:00
Bastien Guerry 49da67d351 org.el (org-refile): Fix C-u 3 C-c C-w
* org.el (org-refile): Fix calling with a numeric prefix
argument of 3 to refile and keep.
2014-03-19 16:13:33 +01:00
Bastien Guerry 2cd15b9c7c org.el (org-refile): Minor docstring enhancement
* org.el (org-refile): Minor docstring enhancement.
2014-03-19 15:47:20 +01:00
Bastien Guerry 88d151b05b Merge branch 'maint' 2014-03-19 09:31:23 +01:00
Nikolai Weibull 2d09804e19 org.el: Only set org-hide foreground if one is available
* org.el (org-mode): Add guard around set-face-foreground.

TINYCHANGE
2014-03-19 09:31:11 +01:00
Bastien Guerry 040ec48a0d Merge branch 'maint' 2014-03-18 16:25:55 +01:00
Bastien Guerry 922135a4a6 org.el (org-entry-get-with-inheritance): Remove wrong quote
* org.el (org-entry-get-with-inheritance): Remove wrong quote.
2014-03-18 16:25:12 +01:00
Bastien Guerry cdb16718c0 Merge branch 'maint' 2014-03-18 14:50:42 +01:00
Bastien Guerry 42ee862d33 org.el (org-entry-get): Fix inheritance problem
* 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.
2014-03-18 14:47:09 +01:00
Bastien Guerry 6e0e76308c Merge branch 'maint' 2014-03-17 21:22:20 +01:00
Bastien Guerry 3074d081e7 Revert "Properties: Fix property-getting with inheritance"
This reverts commit 475f2f5388.
2014-03-17 21:22:04 +01:00
Bastien Guerry da13eea415 Merge branch 'maint' 2014-03-17 02:19:37 +01:00
Bastien Guerry 28a9e35ddb org.el (org-do-emphasis-faces): Explicitly prevent nested emphasis
* org.el (org-do-emphasis-faces): Explicitly prevent nested
emphasis.

Thanks to Sébastien Vauban for reporting this.
2014-03-17 02:19:27 +01:00
Bastien Guerry 5f2dced185 org.el (org-store-link): Allow to create links from sr-mode
* 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.
2014-03-17 01:56:59 +01:00
Bastien Guerry 5289825cb2 Merge branch 'maint' 2014-03-17 01:42:42 +01:00
Bastien Guerry afffe03dcf org.el (org-insert-heading): Don't remove whitespaces following an empty headline
* org.el (org-insert-heading): Don't remove whitespaces
following an empty headline.

Thanks to Brady Trainor for reporting this.
2014-03-17 01:41:42 +01:00
Nicolas Goaziou ee8d564479 Properly unescape optional part in file links
* 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.
2014-03-15 16:04:38 +01:00
Bastien Guerry e75d2031bc Merge branch 'maint' 2014-03-14 12:07:06 +01:00
Ilya Shlyakhter 475f2f5388 Properties: Fix property-getting with inheritance
* 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.
2014-03-14 12:02:11 +01:00
Oleh Krehel c1d5a0ae05 org.el (org-delete-property): Fix bug
* lisp/org.el (org-delete-property): `org-entry-delete' takes 2 args
  but was called with 3.
2014-03-13 21:51:50 +01:00
Bastien Guerry cec03f07b9 Merge branch 'maint' 2014-03-13 16:28:01 +01:00
Bastien Guerry 0cf58595d7 org.el (org-store-link): Fix bugs
* org.el (org-store-link): Ensure desc is not nil before
matching a regexp against it.
2014-03-13 16:27:51 +01:00
Nicolas Richard 700d58230b org.el (org-version): Obey all arguments in non-interactive uses
* org.el (org-version): Obey all arguments in non-interactive uses.
2014-03-13 16:00:45 +01:00
Bastien Guerry f4b0fb3dee Merge branch 'maint' 2014-03-13 15:50:35 +01:00
Bastien Guerry 7f65ba52ee org.el (org-store-link): Bugfix
* org.el (org-store-link): Fall back on an empty string when
no description is available.

This fixes a bug about tangling a source block outside of any
subtree when `org-id-link-to-org-use-id' is `t'.

Thanks to Sean Allred for reporting this.
2014-03-13 15:50:16 +01:00
Bastien Guerry 25f47777ef Complete commit 07158e
* org.el (org-refresh-category-properties)
(org-complete-expand-structure-template)
(org-buffer-property-keys, org-context):
* org-mouse.el (org-mouse-context-menu):
* org-list.el (org-list-send-list):
* org-element.el (org-element--list-struct):
* org-archive.el (org-all-archive-files): Allow spaces before
any option keyword.

* org.el (org-fontify-meta-lines-and-blocks-1): Fix
fontification of all option keywords.

Thanks to Alan Schmitt for raising the problem with fontification.
2014-03-13 11:28:07 +01:00
Nicolas Goaziou 07158efa53 Ignore indentation for all keywords
* lisp/org-archive.el (org-get-local-archive-location): Ignore
  identation for ARCHIVE keywords.
* lisp/org-colview.el (org-columns-store-format): Ignore indentation
  for COLUMNS keywords.
* lisp/org.el (org-mode): Keywords can start at any column.
(org-reftex-citation): Ignore indentation for BIBLIOGRAPHY keywords.
(org-make-options-regexp): Ignore indentation for all keywords.
2014-03-12 21:30:13 +01:00
Bastien Guerry 4d835d719d Merge branch 'maint'
Conflicts:
	lisp/org.el
2014-03-12 19:14:03 +01:00
Bastien Guerry b28ebdf3f1 org.el (org-delete-property): Don't suggest to delete the CATEGORY property
* org.el (org-delete-property): Don't suggest to delete the
CATEGORY property when the category is not explicitely set in
the property drawer.  Also enforce matching when completing.

Thanks to Oleh for providing a preliminary patch for this.
2014-03-12 18:41:01 +01:00
Bastien Guerry 250abf061b Bugfixes wrt inserting headings.
* org.el (org-insert-heading): Fix regression: with two
universal prefixes, insert heading at the end of the subtree.
(org-insert-todo-heading): Bugfix: only enforce the first TODO
state when arg is '(4).
2014-03-12 17:51:18 +01:00
Bastien Guerry bff69f97f3 org.el (org-contextualize-validate-key): Bugfix
* org.el (org-contextualize-validate-key): Fix bug: perform
the check even when (buffer-file-name) returns `nil'.
2014-03-12 11:57:38 +01:00
Oleh Krehel 367780d133 Enforce `org-bookmark-names-plist'
* lisp/org-capture.el (org-capture-goto-last-stored): Use
  `org-bookmark-names-plist'.
* lisp/org.el (org-refile-goto-last-stored): Use
  `org-bookmark-names-plist'.
2014-03-07 14:09:16 +01:00
Bastien Guerry 080f1dd5af Merge branch 'maint' 2014-03-05 15:47:55 +01:00
Nicolas Goaziou 51718d9674 Fix last commit
* lisp/org.el (org-link-types): Hardcode "file+emacs" and "file+sys".
2014-03-05 14:59:12 +01:00
Nicolas Goaziou 2891ef7f87 Fix `org-open-at-point' on "docview"-type links
* lisp/org.el (org-open-at-point): Open "docview"-type links
  correctly, i.e., without adding "file+" first.
(org-open-file-with-system, org-open-file-with-emacs): Change
signature.  Deprecate functions.

* lisp/org-docview.el (org-docview-open): Open file even when no file
  number is specified.

This change removes "file+emacs" and "file+sys" types from
`org-link-protocols', since they are not hard-coded in
`org-open-at-point'.
2014-03-05 11:39:48 +01:00
Bastien Guerry adbb2f7c9f Fix doc and code inconsistency: now use =verbatim= and ~code~.
* org.el (org-emphasis-alist): Use `org-verbatim' for =text=
and `org-code' for ~text~.

* org.texi (Emphasis and monospace): Document the use of
=verbatim= and ~code~ to be consistent with
`org-element-text-markup-successor'.

Thanks to Yasushi for reporting this.
2014-03-04 10:49:49 +01:00
Nicolas Goaziou 567ec8791a Unescape links before opening them
* lisp/org.el (org-open-at-point): Unescape links before opening
  them.  This bug was introduced in
  fc9ce86cfc.
2014-03-03 15:55:26 +01:00
Bastien Guerry 7097566dfb org.el (org-link-prettify): Docstring cleanup
* org.el (org-link-prettify): Docstring cleanup.
2014-03-03 13:31:24 +01:00
Nicolas Goaziou d75fa9febc `org-open-at-point' right after an object still open it
* lisp/org.el (org-open-at-point): White spaces after an object are
  usually ignored by the function.  Though, when point is right after
  the object, still activate it.
* testing/lisp/test-org.el (test-org/custom-id): Fix test.
2014-03-02 10:32:51 +01:00
Nicolas Goaziou 3917776995 Fix `org-open-at-point' in comments
* lisp/org.el (org-open-at-point): Return an error in comments, as
  there are no link to be found.
2014-03-01 22:38:46 +01:00
Bastien Guerry ce8081f7c1 Merge branch 'maint' 2014-03-01 21:48:11 +01:00
Bastien Guerry dd810b609b org.el (org-open-link-marker): Fix typo in docstring
* org.el (org-open-link-marker): Fix typo in docstring.
2014-03-01 21:47:30 +01:00
Nicolas Goaziou 971dc41ce8 Tiny fixes
* lisp/org.el (org-open-at-point): Tiny fixes.
2014-02-28 21:33:18 +01:00
Nicolas Goaziou c2f4803cbd Small docstring update
* lisp/org.el (org-open-at-point): Update documentation.
2014-02-28 18:07:38 +01:00
Nicolas Goaziou 27fd4d2141 Fix `org-open-at-point' on tags
* lisp/org.el (org-open-at-point): Fix behaviour on tags.  Small
  refactoring.
2014-02-28 18:07:38 +01:00
Nicolas Goaziou bd9e0ad63d Fix `org-open-at-point' on nested objects
* lisp/org.el (org-open-at-point): On an unsupported object nested
  within another object, try to open the parent object.

This should correctly open the following link, with point on the
verbatim object:

  [[http://orgmode.org][=verbatim=]]
2014-02-27 20:54:46 +01:00
Nicolas Goaziou 5dd8058c0c Change `org-open-at-point' behaviour in footnote definitions
* lisp/org.el (org-open-at-point): In a footnote definition, return to
  footnote reference only when point is on the footnote label.
2014-02-27 18:38:49 +01:00
Nicolas Goaziou 8b2d3645ac Ignore `org-open-at-point' when point is on white spaces
* lisp/org.el (org-open-at-point): Do not do anything when point is on
  white spaces after an object.
* testing/lisp/test-org.el (test-org/custom-id): Modify test.
2014-02-27 18:38:39 +01:00
Nicolas Goaziou dddebc26c8 Revert "Fix `org-open-at-point' on planning lines"
This reverts commit 66f3ba38c2.
2014-02-25 20:56:52 +01:00