Commit Graph

4064 Commits

Author SHA1 Message Date
Kyle Meyer dd9be3a6ea Fix docstring typo
* lisp/org.el (org-align-all-tags): Fix typo in docstring.
2016-03-12 11:11:18 -05:00
Kyle Meyer 1376123dea Merge branch 'maint' 2016-03-01 23:32:22 -05:00
Kyle Meyer be5452b126 org-eval-in-calendar: Fix docstring
* lisp/org.el (org-eval-in-calendar): Fix docstring's description of
  KEEPDATE.
2016-03-01 23:31:49 -05:00
Nicolas Goaziou 194b754597 Merge branch 'maint' 2016-03-01 01:06:02 +01:00
Nicolas Goaziou 105a446697 Fix return value for `org-get-outline-path'
* lisp/org.el (org--get-outline-path-1): Replace links with their
description, or path, in addition to removing statistics cookies.
(org-get-outline-path): Add an optional argument to include current
headline in path.
(org-refile-get-targets): Make use of new argument.  Remove call to
`org-link-display-format', which is now handled in
`org--get-outline-path-1'.

* testing/lisp/test-org.el (test-org/get-outline-path): Add tests.

Reported-by: Tobias Getzner <tobias.getzner@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/105425>
2016-03-01 01:01:07 +01:00
Nicolas Goaziou cec775fa06 Merge branch 'maint' 2016-02-29 16:27:19 +01:00
Nicolas Goaziou 2971ab6126 Fix `org-get-outline-path'
* lisp/org.el (org--get-outline-path-1): Fix wrong type arrayp error
  when trying to get the outline path of an empty headline.
* testing/lisp/test-org.el (test-org/get-outline-path): Add test.

Reported-by: Tobias Getzner <tobias.getzner@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/105407>
2016-02-29 16:25:24 +01:00
Nicolas Goaziou 7125fa1947 Merge branch 'maint' 2016-02-25 18:16:58 +01:00
Nicolas Goaziou a0047bcd47 Fix `org-link-display-format'
* lisp/org.el (org-link-display-format): Replace all links in give
  string instead of the first one only.
2016-02-25 18:10:24 +01:00
Nicolas Goaziou 44db364c69 Merge branch 'maint' 2016-02-25 15:11:02 +01:00
Nicolas Goaziou 642c50f0cb Silence byte-compiler 2016-02-25 15:10:49 +01:00
Nicolas Goaziou 5660047846 Merge branch 'maint' 2016-02-25 14:42:22 +01:00
Nicolas Goaziou 54b42f7e59 Tiny refactoring
* lisp/org.el (org-refile-get-targets): Tiny refactoring.
2016-02-25 14:41:54 +01:00
Nicolas Goaziou 2db95a7755 Merge branch 'maint' 2016-02-25 14:41:08 +01:00
Nicolas Goaziou 66fbceb727 Fix `org-refile-get-targets'
* lisp/org.el (org-refile-get-targets): Fix bug when using
  `org-refile-target-verify-function'.  Improve speed.

(org-olpa): Remove variable.
(org-outline-path-cache): New variable.

(org--get-outline-path-1): New function.
(org-get-outline-path): Use new function.  This fixes return value when
cache is used and calls are not in the same path.

* testing/lisp/test-org.el (test-org/get-outline-path): New test.

Reported-by: Florian Adamsky <fa-org-mode@haktar.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/104829>
2016-02-25 14:32:57 +01:00
Nicolas Goaziou 41d005822e Fix indentation bug
* lisp/org.el (org--get-expected-indentation): Fix indentation bug.
* testing/lisp/test-org.el (test-org/indent-line): Add test.

In the following document, the last line would be indented to "|"

- item

  #+BEGIN_SRC emacs-lisp
    (+ 1 1)
  #+END_SRC
    |
2016-02-24 20:58:55 +01:00
Nicolas Goaziou 24033e3c67 Move `org-edit-headline'
* lisp/org-colview.el (org-edit-headline): Move from here...
* lisp/org.el (org-edit-headline): ... to here.  Also refactor code.
  Accept to set headline non-interactively.

* testing/lisp/test-org.el (test-org/edit-headline): New test.
2016-02-23 14:07:32 +01:00
Michael Brand 54b4be8208 orgstruct: Add `org-force-cycle-archived'
* lisp/org.el (orgstruct-setup): Add `org-force-cycle-archived' to the
list of the functions to be hijacked.
2016-02-22 20:53:48 +01:00
Nicolas Goaziou a311a85651 Merge branch 'maint' 2016-02-22 09:41:25 +01:00
Jason Furtney 1045e9e9c0 org.el: Fix typo in `org-previous-visible-heading'
* lisp/org.el (org-previous-visible-heading): Fix docstring.

TINYCHANGE
2016-02-22 09:40:37 +01:00
Nicolas Goaziou a16eba2a02 Fix `org-compute-property-at-point'
* lisp/org.el (org-compute-property-at-point): Properties are
  case-insensitive.
2016-02-21 15:58:11 +01:00
Nicolas Goaziou 15101fe7a6 org-colview: Remove now useless functions
* lisp/org-colview.el (org-columns-number-to-string):
(org-columns-string-to-number): Remove functions.

(org-columns--displayed-value): Apply removal.

* lisp/org.el (org-entry-properties): Ditto.

* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Ditto.
2016-02-21 00:44:17 +01:00
Nicolas Goaziou d59d96efaa org-colview: Ignore "fmt" format property
* lisp/org-colview.el (org-columns--displayed-value):
(org-columns-next-allowed-value):
(org-columns-new):
(org-columns-compute):
(org-columns-number-to-string):
(org-columns-string-to-number):
(org-columns-uncompile-format):
(org-columns-compile-format):
(org-agenda-colview-summarize):
(org-agenda-colview-compute): Ignore "fmt" property.  Use "op" instead.

* lisp/org.el (org-entry-properties): Ditto.

* testing/lisp/test-org-colview.el (test-org-colview/columns-summary):
  Ditto.
2016-02-21 00:44:17 +01:00
Nicolas Goaziou 3debe06bdd Rename `org-insert-columns-dblock' into `org-columns-insert-dblock'
* lisp/org-colview.el (org-columns-dblock-insert): Rename to...
(org-columns-insert-dblock): ... this.  Also fix a bug that would insert
"local" instead of `local' as the :id value.

* lisp/org.el (org-mode-map):
(org-org-menu): Use new name.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou 4eada95883 Move `org-columns-modify-value-for-display-function'
* lisp/org.el (org-columns-modify-value-for-display-function): Move from
  here...
* lisp/org-colview.el (org-columns-modify-value-for-display-function):
  ... to here.
2016-02-17 22:49:19 +01:00
Nicolas Goaziou d846817f9d Allow to preview LaTeX fragments in temporary buffers
* lisp/org.el (org-toggle-latex-fragment): Allow to preview fragments
  even when current buffer is not visiting a file.
2016-02-14 00:11:28 +01:00
Nicolas Goaziou 8eff64cffe Silence byte-compiler
* lisp/org-agenda.el (org-agenda-current-date): New variable.
(org-agenda-get-day-entries):
* lisp/org.el (org-calendar-holiday): Use new variable.
2016-02-11 11:32:14 +01:00
Michael Brand 96f1bd89e0 `org-file-apps' add migration hint for function signature
* lisp/org.el (org-open-file): Add a user error for when the function
signature does not match.
2016-02-07 12:36:03 +01:00
Nicolas Goaziou cb05b3a3d7 Fix (void-variable d) error
* lisp/org.el (org-check-before-date):
(org-check-after-date): Ensure D enters the lexical scope.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/104842>
2016-02-06 00:21:59 +01:00
Nicolas Goaziou aee808987d Merge branch 'maint' 2016-02-05 23:01:32 +01:00
Nicolas Goaziou cadfbbe8af Remove `org-latex-fragment-image-overlays'
* lisp/org.el (org-latex-fragment-image-overlays): Remove variable.
(org--format-latex-make-overlay): Do not register anymore created
overlays in the removed variable.
(org--list-latex-overlays): New function.
(org-remove-latex-fragment-image-overlays): Use new function.
(org-context): Work around use of `org-latex-fragment-image-overlays'.

Reported-by: Dima Kogan <dima@secretsauce.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/104822>
2016-02-05 22:54:39 +01:00
Nicolas Goaziou 422c5ca3b9 Merge branch 'maint' 2016-02-05 18:39:49 +01:00
Nicolas Goaziou 53b34e6d8c Silence byte-compiler
* lisp/org.el (org--format-latex-make-overlay): Silence byte-compiler.
2016-02-05 18:39:06 +01:00
Nicolas Goaziou 79957188e0 Merge branch 'maint' 2016-02-05 18:36:39 +01:00
Nicolas Goaziou 6418173b97 Remove LaTeX overlay when text below is modified
* lisp/org.el (org--format-latex-make-overlay): New function.
(org-format-latex): Use new function.

Reported-by: Dima Kogan <dima@secretsauce.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/104800>
2016-02-05 00:08:02 +01:00
Nicolas Goaziou 00f0c70418 Special property "ITEM" contains headline without stars
* lisp/org.el (org-entry-properties): "ITEM" contains headline without
  stars.
* lisp/org-colview.el (org-columns-display-here): Apply changes.
* doc/org.texi (Special properties): Update documentation.
* testing/lisp/test-org.el (test-org/entry-properties): Update tests.
2016-02-04 23:06:03 +01:00
Michael Brand 169dfebbff `org-file-apps' add migration hint
* lisp/org.el (org-file-apps): Add an error when still a sexp is in
use.
2016-02-04 18:41:30 +01:00
Nicolas Goaziou c8a3ab1e4c `org-file-apps' accept functions instead of sexp
* lisp/org.el (org-file-apps-defaults-macosx): Tiny re-ordering.
(org-file-apps-defaults-windowsnt): Default values provide functions
instead of sexp.
(org-file-apps): Use a function instead of a sexp.

See <http://permalink.gmane.org/gmane.emacs.orgmode/104272>.
2016-02-03 18:30:17 +01:00
Nicolas Goaziou cd9856cc76 Fix `org-make-tags-matcher'
* lisp/org.el (org-make-tags-matcher): With no filter, match everything.

Reported-by: Michael Strey <mstrey@strey.biz>
<http://permalink.gmane.org/gmane.emacs.orgmode/104729>
2016-02-02 22:57:56 +01:00
Nicolas Goaziou 67a8b4026f Resurrect `org-switchb'
* lisp/org.el (org-switchb): New function.

This was removed by mistake in commit
8eb0ef0b42.
2016-02-02 22:33:09 +01:00
Nicolas Goaziou 8eb0ef0b42 Clean up ido and iswitchb left-overs
* lisp/org.el (org-completion-use-ido):
(org-completion-use-iswitchb):
(org-completion-fallback-command): Remove variables.
(org-refile):
(org-set-effort):
(org-read-property-value): Apply variables removal.

(org-iread-file-name): Make it an obsolete alias for `read-file-name'.
(org-file-complete-link): Use `read-file-name'.

(org-switchb): Remove unused function.

Completion mechanisms are expected to be handled at a lower level,
e.g. in `read-file-name-function'.
2016-02-02 22:05:22 +01:00
Kyle Meyer 23ca3fa100 Merge branch 'maint' 2016-01-29 00:28:48 -05:00
Kyle Meyer a4edee4069 org-compat: Update font-lock-ensure alias
* lisp/org-compat.el (org-font-lock-ensure): Add new alias that accepts
  the same number of arguments as font-lock-ensure does.  Use an org-
  prefix.
* lisp/org-clock.el (org-clock-get-clocktable):
* lisp/org.el (org-fontify-like-in-org-mode):
* lisp/ox-html.el (org-html-fontify-code):
* lisp/ox-odt.el (org-odt-do-format-code):
* lisp/ox-org.el (org-org-publish-to-org): Use org-font-lock-ensure.

See Emacs's bug#22399.
2016-01-29 00:28:37 -05:00
Kyle Meyer 15d591ee44 Merge branch 'maint' 2016-01-26 01:17:43 -05:00
Rafael Laboissiere 7b9f2fba66 Fix logic when activating plain links
* lisp/org.el: Activate plain link when point is outside a tag, instead
  of the other way around.

TINYCHANGE
2016-01-25 17:12:01 +01:00
Nicolas Goaziou 61db4483f8 Merge branch 'maint' 2016-01-25 13:58:28 +01:00
Nicolas Goaziou 73c59ca4ff Tiny refactoring
* lisp/org.el (org-activate-plain-links): Tiny refactoring.
2016-01-25 13:58:05 +01:00
Nicolas Goaziou b8a67993f9 Merge branch 'maint' 2016-01-25 13:57:25 +01:00
Nicolas Goaziou 9eface25da Fix (wrong-type-argument listp org-link) error
* lisp/org.el (org-activate-plain-links): `face' property doesn't not
  necessarily is a list.

Reported-by: gongzhitaao <zhitaao.gong@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/104444>
2016-01-25 13:54:47 +01:00
Kyle Meyer 034c176995 Merge branch 'maint' 2016-01-24 16:41:20 -05:00
Alan Mackenzie 347191042a Backport commit fbce475 from Emacs
Expunge "allow" + infinitive without direct object from source and doc.
fbce4757a874cc43806eb41b8637538b101c3c69
Alan Mackenzie
Sun Jan 24 20:30:39 2016 +0000
2016-01-24 16:35:22 -05:00
Nicolas Goaziou 53472b9c44 Merge branch 'maint' 2016-01-24 18:23:58 +01:00
Nicolas Goaziou 8e74ea3d10 Fix plain links fontification in a narrowed buffer
* lisp/org.el (org-activate-plain-links): Fix fontification when buffer
  is narrowed and (point-min) is no longer 1.
2016-01-24 18:22:00 +01:00
Nicolas Goaziou c10ba5f3dc Merge branch 'maint' 2016-01-24 18:09:22 +01:00
Nicolas Goaziou 921da3290a Fix `org-format-latex' with $$...$$ snippets
* lisp/org.el (org-format-latex): Transform $$...$$ into \[...\] before
  processing with mathjax.
2016-01-24 18:08:23 +01:00
Achim Gratz a88e51dc3f Merge branch 'maint' 2016-01-24 12:09:34 +01:00
Achim Gratz 796f13177a lisp/org.el: correct filemode, changed in b3fbd31f17 2016-01-24 12:09:03 +01:00
Achim Gratz 750e0f91a2 Merge branch 'maint' 2016-01-24 11:25:30 +01:00
Rafael Laboissiere 860bcfbf93 Fix fontification of plain links at beginning of buffer
* lisp/org.el (org-activate-plain-links): Ensure that a valid buffer
  position is given as first argument to get-text-property, in
  particular when the plain link is at the very beginning of the buffer.

TINYCHANGE
2016-01-23 00:43:01 +01:00
Nicolas Goaziou 58af2e01be Merge branch 'maint' 2016-01-21 10:42:58 +01:00
Nicolas Goaziou 3dcd1a345f Use `org-back-to-heading' instead of `outline-back-to-heading'
* lisp/org-agenda.el (org-search-view):
* lisp/org-clock.el (org-with-clock):
(org-clock-jump-to-current-clock):
* lisp/org.el (org-entry-beginning-position): Use `org-back-to-heading'
  instead of `outline-back-to-heading'.

Reported-by: Derek Feichtinger <dfeich@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/104375>
2016-01-21 10:42:03 +01:00
Kyle Meyer cb7f44f1af Fix lexical variable warning
* lisp/org.el (org-fast-tag-selection): Don't use add-to-list with
  lexical variable.

Reported-by: Vicente Vera <vicentemvp@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/104363>
2016-01-21 00:50:32 -05:00
Nicolas Goaziou 2e77161519 Remove unused code related to isearch
* lisp/org.el (org-mode): Remove compatibility cruft.
(org-isearch-end, org-isearch-post-command): Remove functions.
2016-01-18 23:13:11 +01:00
Nicolas Goaziou 0f8c6b0b2e Fix last commit
* lisp/org.el (org-do-latex-and-related): Extract face from the correct
  location.
2016-01-18 00:58:34 +01:00
Nicolas Goaziou 74bb33d464 Fix fontification of properties with an underscore
* lisp/org.el (org-do-latex-and-related): Prevent properties with an
  underscore from being fontified like a subscript.
2016-01-17 23:49:28 +01:00
Nicolas Goaziou 02c9dca64c Ignore repeaters in protected areas
* lisp/org.el (org-auto-repeat-maybe): Only consider repeaters in
  regular text, not within, e.g., example blocks.

Reported-by: Karl Voit <devnull@Karl-Voit.at>
<http://permalink.gmane.org/gmane.emacs.orgmode/104260>
2016-01-17 22:21:15 +01:00
Nicolas Goaziou 457e3298de `org-font-lock-extra-keywords' is dynamically scoped
Reported-by: mc <mc@aiguphonie.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/104265>
2016-01-17 21:59:23 +01:00
Nicolas Goaziou 791e52bfdd Merge branch 'maint' 2016-01-16 15:59:05 +01:00
Nicolas Goaziou ce80a0e727 Fix memory leak in `org-agenda-prepare-buffers'
* lisp/org.el (org-agenda-prepare-buffers): Do not use
  `org-uniquify-alist' since it uses `eq' for comparison, whereas where
  are using strings as keys.

Reported-by: Vincent Emanuele <vincent.emanuele@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/104196>
2016-01-16 15:56:03 +01:00
Nicolas Goaziou 1c8ed102e9 Merge branch 'maint' 2016-01-16 14:53:48 +01:00
Nicolas Goaziou 6e57a371ff Fix tags looking like plain links
* lisp/org-element.el (org-element-context): Do not look for objects
  within TODO keyword, priority cookie, comment keyword or tags.
* lisp/org.el (org-activate-tags): Fix regexp.

* testing/lisp/test-org-element.el (test-org-element/context): Add test.

Reported-by: John Kitchin <jkitchin@andrew.cmu.edu>
2016-01-16 14:50:25 +01:00
Marco Wahl 164555b46e org: Fix declaration of variable `org-state'
* lisp/org.el: The declaration of `org-state' fixes function `org-todo'.

Without the declaration the progressing of todo-states fails in some
cases with "Debugger entered--Lisp error: (void-variable org-state)".

Cf. thread http://permalink.gmane.org/gmane.emacs.orgmode/104179.
2016-01-15 11:45:41 +01:00
Nicolas Goaziou 2520fd654a Test `org-map-entries'
* lisp/org.el (org-make-tags-matcher): Small refactoring.
* testing/lisp/test-org.el (test-org/map-entries): New test.
2016-01-13 17:03:46 +01:00
Nicolas Goaziou 23f31a9b6b Silence byte-compiler
* lisp/org-datetree.el (org-datetree-find-date-create):
(org-datetree-find-iso-week-create):
(org-datetree-file-entry-under):
* lisp/org.el (calendar-check-holidays):
(org-version):
(org--setup-process-tags):
(org-assign-fast-keys):
(org-cycle-level):
(org-clone-subtree-with-time-shift):
(orgstruct++-mode):
(orgstruct-setup):
(org-contextualize-keys):
(org-insert-all-links):
(org-offer-links-in-entry):
(org-agenda-buffer-tmp-name):
(org-agenda-start-on-weekday):
(org-get-outline-path):
(org-format-outline-path):
(org-todo-yesterday):
(org-auto-repeat-maybe):
(org-add-planning-info):
(org-sparse-tree):
(org-show-set-visibility):
(org-tags-expand):
(org-change-tag-in-region):
(org-fast-tag-selection):
(org-agenda-skip-comment-trees):
(org-agenda-skip-function):
(org-property-action):
(org-set-effort):
(org-delete-property-globally):
(org-read-date-analyze):
(org-re-timestamp):
(org-calendar-holiday):
(org-duration-string-to-minutes):
(org-cdlatex-environment-indent):
(org-format-latex):
(org-create-formula-image):
(org-create-formula-image-with-dvipng):
(org-create-formula-image-with-imagemagick):
(org-edit-special):
(org-ctrl-c-ctrl-c):
(org-get-at-eol):
(org-mark-subtree):
(org--get-expected-indentation):
(org-indent-line):
(org-indent-region):
(org-adaptive-fill-function):
(org-fill-paragraph):
(org-next-block):
(org-forward-paragraph):
(org-imenu-get-tree):
(org--flyspell-object-check-p):
(org-mode-flyspell-verify): Silence byte-compiler.
2016-01-13 11:43:54 +01:00
Kyle Meyer 3365ad596d Merge branch 'maint' 2016-01-13 00:50:50 -05:00
Kyle Meyer 6c6b94e274 org-directory: Update docstring
* lisp/org.el (org-directory): Fix docstring description of where this
  variable is used.
2016-01-13 00:49:12 -05:00
Nicolas Goaziou 8ddc7314b8 Store notes outside drawers at a correct location
* lisp/org.el (org-log-beginning): Move to an appropriate location even
  when `org-log-state-notes-insert-after-drawers' is nil and notes are
  not stored within a drawer.

Reported-by: swflint@flintfam.org (Samuel W. Flint)
<http://permalink.gmane.org/gmane.emacs.orgmode/104107>
2016-01-12 21:28:32 +01:00
Nicolas Goaziou 9db78611b4 Tweak `org-auto-repeat-maybe'
* lisp/org.el (org-auto-repeat-maybe): Only clear non-repeated SCHEDULED
  information in a repeated task.

* doc/org.texi (Repeated tasks): Document behavior.

Do not clear non-repeated DEADLINE information however, as it could be
a global deadline for all occurrences of the task.  Also, this case is
taken care of by `org-agenda-skip-scheduled-if-deadline-is-shown' with
a value set to `repeated-after-deadline'.
2016-01-11 12:11:22 +01:00
Nicolas Goaziou 157f91c31c Fix `org-auto-repeat-maybe'
* lisp/org.el (org-auto-repeat-maybe): Do not remove SCHEDULED time
  stamp when encountering a time stamp without a repeater.  Also, ensure
  "REPEAT_TO_STATE" property can be inherited.  Small refactoring.

Reported-by: "Bradley M. Kuhn" <bkuhn@ebb.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/104103>
2016-01-11 00:58:53 +01:00
Nicolas Goaziou e2e5fc2f58 Tiny fixes to docstrings
* lisp/org.el (org-execute-file-search-functions):
(org-after-todo-statistics-hook):
(org-sparse-tree): Fix docstrings.
2016-01-11 00:00:25 +01:00
Nicolas Goaziou ef01789804 org.el: Use `dolist' instead of `mapc' + `lambda'
* lisp/org.el (org-babel-do-load-languages):
(org-load-modules-maybe):
(org-mode-transpose-word-syntax-table):
(org-cycle-internal-local):
(org-remove-empty-overlays-at):
(org-reinstall-markers-in-region):
(orgstruct++-mode):
(orgstruct++-mode):
(org-offer-links-in-entry):
(org-refile-cache-clear):
(org-revert-all-org-buffers):
(org-ctrl-c-ctrl-c):
(org-in-block-p):
(org-uniquify-alist):
(org-unindent-buffer):
(org-imenu-get-tree): Use `dolist' instead of `mapc' + `lambda'.

(org-show-block-all):
(org-remove-occur-highlights):
(org-remove-inline-images):
(org-speed-command-help):
(org-require-autoloaded-modules): Use #'fun instead of 'fun for clarity.
2016-01-10 21:16:29 +01:00
Nicolas Goaziou 1f49e9fdfd org.el: Switch to lexical binding
* lisp/org.el (org-version):
(org-extract-log-state-settings):
(org-before-change-function):
(org-mode):
(org-emphasize):
(org-fontify-meta-lines-and-blocks-1):
(org-update-radio-target-regexp):
(org-unfontify-region):
(org-set-visibility-according-to-property):
(org-set-outline-overlay-data):
(org-goto-ret):
(org-insert-heading):
(org-contextualize-validate-key):
(org--links-history):
(org-insert-link):
(ido-enter-matching-directory):
(org-offer-links-in-entry):
(org-link-search):
(org-open-file):
(org-refile):
(org-add-log-note):
(org-occur-next-match):
(org-remove-occur-highlights):
(org-priority):
(org-tags-completion-function):
(org-map-entries):
(org-entry-properties):
(org-buffer-property-keys):
(org-property-values):
(org-property-previous-allowed-value):
(org-find-olp):
(calendar-setup):
(org-read-date):
(org-read-date-analyze):
(org-check-before-date):
(org-check-after-date):
(org-calendar-holiday):
(org-diary-sexp-entry):
(org-closest-date):
(org-date-to-gregorian):
(org-recenter-calendar):
(org-agenda-prepare-buffers):
(org-cdlatex-underscore-caret):
(org-cdlatex-math-modify):
(org-create-math-formula):
(org-display-inline-remove-overlay):
(org-shiftmetaup):
(org-shiftmetadown):
(org-metaleft):
(org-metaright):
(org-metaup):
(org-metadown):
(org-in-src-block-p):
(org-replace-escapes):
(org-indent-region):
(org-comment-dwim):
(org-drag-line-forward): Silence byte-compiler
2016-01-10 21:16:29 +01:00
Nicolas Goaziou a02a83793b Make `org-make-tags-matcher' lexical binding friendly
* lisp/org.el (org-make-tags-matcher): Return a function instead of
  a sexp.  Refactor code.
(org--matcher-tags-todo-only): New variable.  Replace `todo-only'
dynamic binding.
(org-scan-tags): Apply changes to `org-make-tags-matcher'.
(org-match-sparse-tree):
(org-map-entries): Use new variable.

* lisp/org-crypt.el (org-encrypt-entries):
(org-decrypt-entries): Use new variable.

* lisp/org-clock.el (org-clock-get-table-data): Apply changes to
  `org-make-tags-matcher'.

* lisp/org-agenda.el (org-tags-view): Use new variable.
2016-01-10 21:16:29 +01:00
Nicolas Goaziou fdbf441560 Obsolete `org-icompleting-read' and `org-completing-read-no-i'
* lisp/org.el (org-icompleting-read, org-completing-read-no-i): Obsolete
  aliases for `completing-read'
(org-iswitchb-completing-read): Remove function.
(org-sort-entries):
(org-refile-get-location):
(org-todo):
(org-deadline):
(org-occur-parameters):
(org-change-tag-in-region):
(org-fast-tag-selection):
(org-delete-property-globally):
(org-compute-property-at-point):
(org-buffer-list): Use genuine function.

* contrib/lisp/org-colview-xemacs.el (org-columns-edit-value):
(org-columns-new):
(org-insert-columns-dblock):
* contrib/lisp/org-index.el (org-index):
* contrib/lisp/ox-bibtex.el (org-bibtex-goto-citation):
* lisp/ob-core.el (org-babel-insert-header-arg):
(org-babel-goto-named-src-block):
(org-babel-goto-named-result):
(org-babel-demarcate-block):
* lisp/org-agenda.el (org-todo-list):
(org-agenda-filter-by-tag):
(org-agenda-bulk-action):
* lisp/org-attach.el (org-attach-delete-one):
(org-attach-open):
* lisp/org-bibtex.el (org-bibtex-fleshout):
(org-bibtex-create):
* lisp/org-capture.el (org-capture-fill-template):
* lisp/org-colview.el (org-columns-edit-value):
(org-columns-new):
(org-insert-columns-dblock):
* lisp/org-footnote.el (org-footnote-new):
* lisp/org-list.el (org-sort-list):
* lisp/ox-publish.el (org-publish):
* lisp/ox.el (org-export-dispatch): Use genuine function.
2016-01-10 21:16:29 +01:00
Kyle Meyer 6bc48c5f41 Update copyright years 2016-01-09 17:12:03 -05:00
Nicolas Goaziou da10c6ace6 Fix copyright years 2016-01-07 23:39:50 +01:00
Nicolas Goaziou 910418282a Resurrect `org-log-note-marker'
* lisp/org.el (org-log-note-buffer): Remove variable.
(org-log-note-marker): New variable.
(org-log-note-effective-time): Fix docstring.
(org-add-log-setup):
(org-add-log-note):
(org-store-log-note): Use new variable.

Unlike to previous variable, this one stores the location of the entry
where the note is going to be inserted, not necessarily the location of
the note, which is computed later.
2016-01-07 23:33:27 +01:00
Nicolas Goaziou f56caace8a Fix `org-log-beginning'
* lisp/org.el (org-log-beginning): Properly locate notes when no drawer
  is used.
(org-store-log-note): Function above already moves point to the correct
location.
2016-01-07 23:13:37 +01:00
Stefan-W. Hahn a902c830e7 Name org-tree indirect buffer just with title
* lisp/org.el (org-tree-to-indirect-buffer): Remove tags from name.

Just use org-tree title for naming an indirect org-tree buffer.  If tags
are appended the name clutters mode-line.

TINYCHANGE

Signed-off-by: Stefan-W. Hahn <stefan.hahn@s-hahn.de>
2016-01-06 22:59:54 +01:00
Nicolas Goaziou aab46486f7 Fix removal of shared drawers between clocks and notes
* lisp/org.el (org-log-note-marker): Remove variable.
(org-log-note-buffer): New variable.
(org-add-log-setup): Remove one argument.  Also use new variable.
(org-refile):
(org-todo):
(org-auto-repeat-maybe):
(org-deadline):
(org-schedule):
(org-add-note): Apply argument removal.
(org-store-log-note): Use new variable.  Compute the insertion's location
at the time the note is really inserted in the buffer.

* lisp/org-clock.el (org-clock-out): Apply argument removal.  Remove hack
  around shared drawers.

Reported-by: Olli P <kotkis@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/103958>
2016-01-06 15:50:50 +01:00
Nicolas Goaziou 5792667bde Merge branch 'maint' 2016-01-06 14:51:04 +01:00
Nicolas Goaziou 005f8b2fd1 Add missing argument
* lisp/org.el (org-set-property): Add missing argument.
2016-01-06 14:50:37 +01:00
Nicolas Goaziou 93c52908b6 Merge branch 'maint' 2016-01-06 14:46:36 +01:00
Nicolas Goaziou 22cf1bf7ed Throw an error when trying to set invalid properties
* lisp/org.el (org--valid-property-p): New function.
(org-entry-put):
(org-set-property): Use new function.

Suggested-by: Julien Cubizolles <j.cubizolles@free.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/104044>
2016-01-06 14:45:52 +01:00
Nicolas Goaziou 8bc5d40264 Fix `org-toggle-heading'
* lisp/org.el (org-toggle-heading): Ensure partial list conversion to
  headlines do not get broken by missing newline characters.
2016-01-02 14:25:58 +01:00
Alexey Lebedeff aca68e64bc Fix property name completion
* lisp/org-pcomplete.el (pcomplete/org-mode/prop): Add
  `ignore-malformed' argument in call to `org-buffer-property-keys'

* lisp/org.el (org-buffer-property-keys): Add support for new argument
  `ignore-malformed'.

* testing/lisp/test-org-pcomplete.el: Add new file for testing
  `pcomplete' integration.

* testing/lisp/test-org.el (test-org/buffer-property-keys): Test
  behaviour of `org-buffer-property-keys' with new `ignore-malformed'
  argument.

When property name completion is being performed, it means that we are
inside malformed property drawer that will become valid only after
successful completion. In this case in makes no sense to perform
interactive drawer repair.
2015-12-29 21:53:56 +01:00
Nicolas Goaziou 02443b34b3 Fix code typo
* lisp/org.el (org-store-link-props): Fix code typo.
2015-12-29 21:28:21 +01:00
Jan Malakhovski d1f42e7f32 Factor out date-timestamp* calculations to org-store-link-props
* lisp/org.el (org-store-link-props): Rewrite function to get
  date-timestamp* calculations.
* lisp/org-gnus.el:
* lisp/org-mhe.el:
* lisp/org-rmail.el:
* contrib/lisp/org-mew.el:
* contrib/lisp/org-vm.el:
* contrib/lisp/org-wl.el: Remove date-timestamp* copy-paste.
* doc/org.texi: Fix `org-capture-templates' documentation.
2015-12-29 21:17:00 +01:00
Nicolas Goaziou 54318add34 Change export block syntax
* lisp/org-element.el (org-element-export-block-parser):
(org-element--current-element): Use new syntax for export blocks.
(org-element-block-name-alist): Remove.

* lisp/ox.el (org-export-register-backend):
(org-export-define-derived-backend): Remove :export-block keyword from
back-end's definition.
(org-export-expand-include-keyword): Use new syntax for include
keywords.

* lisp/ox-ascii.el (ascii):
* lisp/ox-beamer.el (beamer):
* lisp/ox-html.el (html):
* lisp/ox-latex.el (latex):
(org-latex-prefer-user-labels):
* lisp/ox-man.el (man):
* lisp/ox-md.el (md):
* lisp/ox-odt.el (odt):
* lisp/ox-texinfo.el (texinfo): Propagate changes to "ox.el".

* lisp/ob-core.el (org-babel-insert-result):
* lisp/ob-haskell.el (org-babel-haskell-export-to-lhs): Use new syntax.

* lisp/org.el (org-structure-template-alist): Use new syntax.
(org-protecting-blocks): Add "export" to protected blocks.  Remove
  back-ends blocks, which are now special blocks.
(org-fontify-meta-lines-and-blocks-1): Fontify correctly new blocks.

* lisp/org-footnote.el (org-footnote-forbidden-blocks):
* lisp/org-list.el (org-list-forbidden-blocks): Add "export" to
  forbidden blocks.  Remove back-ends blocks, which are now special
  blocks.

* contrib/lisp/ox-extra.el: Update comments.

* testing/lisp/test-org-element.el (test-org-element/export-block-parser):
(test-org-element/export-block-interpreter):
* testing/lisp/test-ob.el (test-ob/org-babel-remove-result--results-html):
(test-ob/org-babel-remove-result--results-latex):
* testing/lisp/test-ox.el (test-org-export/expand-include): Update tests.

Export blocks are explicitly marked as such at the syntax level to
disambiguate their parsing from special blocks.  The new syntax is

  #+BEGIN_EXPORT backend
  ...
  #+END_EXPORT

instead of

  #+BEGIN_backend
  ...
  #+END_backend

As a consequence, =INCLUDE= keywords syntax is modified, e.g.,

  #+INCLUDE: "file.org" HTML

becomes

  #+INCLUDE: "file.org" export html
2015-12-20 21:56:27 +01:00
Nicolas Goaziou 38fd09e29b Fix code typo
* lisp/org.el (org-get-local-variables): Fix code typo.
2015-12-06 18:35:09 +01:00
Nicolas Goaziou d02f9d41af Ignore some local variables upon cloning
* lisp/org.el (org-unique-local-variables): New variable.
(org-get-local-variables):
(org-clone-local-variables): Use variable above.  Do not rely on an
obscure naming convention to determine if a local variable is meant to
be cloned or read.
2015-12-05 13:44:12 +01:00
Nicolas Goaziou dbaab40bda Obey to `org-inhibit-startup'
* lisp/org.el (org-mode): `org-startup-truncated' and
  `org-startup-indented' are expected to have an effect only when
  `org-inhibit-startup' is non-nil.
2015-12-05 13:36:41 +01:00
Nicolas Goaziou d6a169a82c org-capture: Fix cache in capture buffers
* lisp/org-capture.el (org-capture-steal-local-variables): Remove function.
(org-capture-fill-template): Apply removal.  Use
`org-clone-local-variables' instead.  Focus on Org specific variables.

* lisp/org.el (org-get-local-variables):
(org-clone-local-variables): Ignore internal local variables, whose
value is probably tied to their respective buffer.  In particular, this
prevents cache related variables from being copied.

* lisp/org-indent.el (org-indent--initial-marker): Renamed from
  `org-indent-initial-marker'.  Marking it as internal prevents it from
  being copied by `org-clone-local-variables' and alike.
(org-indent-mode):
(org-indent-initialize-buffer): Apply renaming.
2015-12-05 11:55:02 +01:00
Nicolas Goaziou a682b20a46 org-capture: Use lexical binding
* lisp/org-capture.el (org-capture-is-refiling): New variable.
(org-capture-place-template): Silence byte-compiler.

* lisp/org.el (org-refile): Use new variable.
2015-12-05 09:30:17 +01:00
Nicolas Goaziou 11291ffcd0 org-list: Radio lists use Org Export library
* lisp/org-list.el (org-list-to-lisp): New function.
(org-list-parse-list): Mark function obsolete.

(org-list-send-list):
(org-list-to-generic):
(org-list-make-subtree): Use new function.

(org-list-item-trim-br): Remove function.

(org-list-to-generic): Use Org Export library.
(org-list--depth):
(org-list--trailing-newlines):
(org-list--generic-eval):
(org-list--to-generic-plain-list):
(org-list--to-generic-item): New functions.

(org-list-to-latex):
(org-list-to-html):
(org-list-to-texinfo): Apply changes.  Allow parameters.
(org-list-to-subtree): Apply changes.

* lisp/org.el (org-toggle-heading):
* lisp/ob-core.el (org-babel-insert-result): Apply changes.

* doc/org.texi (Radio lists): Update documentation.

* testing/lisp/test-org-list.el (test-org-list/to-generic): New test.
2015-12-03 09:54:49 +01:00
Kyle Meyer 1aaa0817b6 Merge branch 'maint' 2015-11-17 21:33:53 -05:00
Paul Eggert 31459201ae Backport commit ac16149 from Emacs
Fix docstring quoting problems with ‘ '’
ac16149ba470ae8a625d42a61adbb6e84254c675
Paul Eggert
Tue Nov 17 15:29:35 2015 -0800
2015-11-17 21:30:57 -05:00
Nicolas Goaziou 37810b7177 Remove outdated compatibility code 2015-11-13 23:25:57 +01:00
Nicolas Goaziou 7f937b3cea Silence byte-compiler 2015-11-13 23:13:41 +01:00
Nicolas Goaziou 6c1f63b6a6 org-src: Allow to edit remotely inline src blocks
* lisp/org-src.el (org-edit-inline-src-code): New function.
(org-src--contents-area): Handle inline src blocks.

* lisp/org.el (org-edit-special): When on an inline src block, edit it.
2015-11-08 20:55:31 +01:00
Nicolas Goaziou b8f100c14a Fix `org-cycle' within `orgstruct-mode'
* lisp/org.el (org-show-children): Fallback to `outline-show-children'
  when `orgstruct-mode' is active.

Reported-by: Jonas Bernoulli <jonas@bernoul.li>
<http://permalink.gmane.org/gmane.emacs.orgmode/102709>
2015-11-08 16:16:17 +01:00
Nicolas Goaziou 49d3d06cb4 Silence byte-compiler 2015-11-07 23:36:02 +01:00
Aaron Ecay fa1a9aad8e org.el: Don’t special-case ‘define-obsolete-function-alias’ for emacs <= 23 2015-11-06 12:50:42 +00:00
Aaron Ecay 861b6b1bd0 org.el: Obsolete ‘org-image-file-name-regexp’
* lisp/org.el (org-image-file-name-regexp): Make obsolete.  Change
callers.
2015-11-06 12:50:42 +00:00
Aaron Ecay d29d9a029c org.el: Refactor ‘org-previous-line-empty-p’
* lisp/org.el (org--line-empty-p):
(org-next-line-empty-p): New functions.
(org-previous-line-empty-p): Remove `next' argument.  Call
`org--line-empty-p'.
2015-11-06 12:50:41 +00:00
Aaron Ecay a6768538d6 org.el: mark `org-on-heading-p' obsolete.
* lisp/org.el (org-on-heading-p): Mark obsolete.
2015-11-06 12:50:41 +00:00
Aaron Ecay 8b4672bdd0 org.el: Minor refactorings.
* lisp/org.el (org-force-cycle-archived):
(org-do-emphasis-faces):
(org-entry-end-position):
(org-check-and-save-marker):
(org-cancel-repeater):
(org-update-parent-todo-statistics):
(org-scan-tags):
(org-yank-folding-would-swallow-text): Refactor.
2015-11-06 12:50:41 +00:00
Aaron Ecay e4cd3dd22b Remove some home-grown copies of cl-lib functions.
* lisp/org.el (org-count, org-remove-if, org-remove-if-not):
(org-reduce, org-every, org-some): Obsolete, use cl-lib versions
everywhere.
(org-sublist): Reimplement in terms of `cl-subseq'; make obsolete.
2015-11-06 12:50:40 +00:00
Aaron Ecay 2e26751b4c org.el: use ‘when’ and ‘unless’ instead of single-branch ‘if’
* lisp/org.el: Refactor single-branch `if' to `when' or `unless' as
appropriate.  Also apply other misc. refactorings of conditionals.
2015-11-06 12:47:04 +00:00
Aaron Ecay c7f1b55995 Mark `org-table-recognize-table.el' obsolete
* lisp/org.el (org-at-table-hline-p): Mark obsolete.

No org code has called this function since 2010.
2015-11-06 12:47:04 +00:00
Aaron Ecay 48096562ba Make `org-table-p' obsolete.
* lisp/org.el: Make `org-table-p' obsolete.  Change all callers.
2015-11-06 12:47:04 +00:00
Nicolas Goaziou 0edad6725a Merge branch 'maint' 2015-11-05 23:24:10 +01:00
Nicolas Goaziou 73a5c27cc1 Fix table editing with an active region
* lisp/org.el (org-self-insert-command): Do not call
  `backward-delete-char' since it possibly deletes active region.
  Simplify code.

This fixes bug#21838.
2015-11-05 23:18:13 +01:00
Aaron Ecay 07e16c2fc5 Use setq-local and defvar-local.
* lisp/org-macs.el (org-set-local): Remove.  All callers changed.
* lisp/org-clock.el:
* lisp/org-colview.el:
* lisp/org-macro.el:
* lisp/org-mouse.el:
* lisp/org-table.el:
* lisp/org.el: Use defvar-local.
* lisp/org-agenda.el:
* lisp/org-capture.el:
* lisp/org-crypt.el:
* lisp/org-ctags.el:
* lisp/org-plot.el:
* lisp/org.el:
* lisp/ox-odt.el:
* lisp/ox.el: Use setq-local instead of set + make-local-variable.

Changes in contrib:

* contrib/lisp/org-colview-xemacs.el (org-colview-xemacs-set-local): New
macro. Adjust old callers of `org-set-local'.
2015-11-05 16:47:38 +00:00
Nicolas Goaziou 5e22dcd622 Fix bug#21818
* lisp/org.el (org-insert-link): Redisplay after inserting link.

Reported-by: Emanuel Evans <mail@emanuel.industries>
<http://permalink.gmane.org/gmane.emacs.orgmode/102591>
2015-11-05 13:45:12 +01:00
Nicolas Goaziou d5767ad31f Fix bug#21818
* lisp/org.el (org-insert-link): Redisplay after inserting link.

Reported-by: Emanuel Evans <mail@emanuel.industries>
<http://permalink.gmane.org/gmane.emacs.orgmode/102591>
2015-11-05 12:26:01 +01:00
Nicolas Goaziou a87c34cb8d Refuse to follow link right after the link
* lisp/org.el (org-open-at-point):
(org-return): Refuse to follow link right after the link.

* testing/lisp/test-org.el (test-org/return): Add tests.
(test-org/coderef):
(test-org/custom-id):
(test-org/fuzzy-links): Update tests.

Reported-by: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/102054>
2015-10-31 23:32:47 +01:00
Nicolas Goaziou 11a451ff98 Fix `org-in-regexp'
* lisp/org.el (org-in-regexp): Fix VISUALLY optional argument.  Also
  prevent useless searches past the point.  Improve docstring.

* testing/lisp/test-org.el (test-org/in-regexp): New test.
2015-10-31 23:19:51 +01:00
Nicolas Goaziou e6ac458988 org-agenda: Fix diary sexp timestamps
* lisp/org-agenda.el (org-agenda--timestamp-to-absolute): New function.
(org-agenda-get-timestamps):
(org-agenda-get-deadlines):
(org-agenda-get-scheduled): Use new function.

* lisp/org.el (org-diary-sexp-no-match): New error.
(org-time-string-to-absolute): Raise an error when a diary sexp cannot
match instead of returning a nonsensical value.

Reported-by: "Stefan-W. Hahn" <stefan.hahn@s-hahn.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/102417>
2015-10-31 22:26:13 +01:00
Kyle Meyer 59468ab2d8 Merge branch 'maint' 2015-10-31 12:49:59 -04:00
Kyle Meyer 59d706219b org-format-outline-path: Ignore nil path elements
* lisp/org.el (org-format-outline-path): Ignore nil path elements.
* testing/lisp/test-org.el (test-org/format-outline-path): Add test.

The PATH argument shouldn't contain a nil item.  However, this didn't
fail before 1c74002, and helm-get-org-candidates-in-file relies on this
behavior, so prevent it from failing now.

Reported-by: Simon Thum <simon.thum@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/102411>
2015-10-31 12:47:17 -04:00
Kyle Meyer 1ec47568f4 org-format-outline-path: Cosmetic fix
* lisp/org.el (org-format-outline-path): Change loop counter.

The old version gives the same result when combined with the other for
clause, but it reads as though the intention is to reach
(length path) rather than (1- (length path)).
2015-10-31 12:35:13 -04:00
Kyle Meyer b9676a2575 Merge branch 'maint' 2015-10-28 01:47:43 -04:00
Kyle Meyer 1c740023f7 Rewrite org-format-outline-path
* lisp/org.el (org-format-outline-path): Avoid out-of-range error when
  the length of PREFIX is greater than the value given for WIDTH.
  Prevent result from extending beyond WIDTH.  Simplify code.
* testing/lisp/test-org.el (test-org/format-outline-path): Add tests.

Reported-by: Simon Thum <simon.thum@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/102241>
2015-10-28 01:26:16 -04:00
Nicolas Goaziou b4af3f0852 Allow more characters in emphasis
* lisp/org.el (org-emphasis-regexp-components): Allow singe quote,
  double quote and comma as the last character in an emphasis string.

Reported-by: Marcin Borkowski <mbork@mbork.pl>
<http://permalink.gmane.org/gmane.emacs.orgmode/102191>
2015-10-25 19:20:25 +01:00
Nicolas Goaziou ebe2d83eea Partly revert "Change `org-agenda-repeating-timestamp-show-all' targets"
* lisp/org.el (org-closest-date): Handle every type of repeater.

Reported-by: Matt Lundin <mdl@imapmail.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/102021>
2015-10-25 16:48:50 +01:00
Kyle Meyer 666fd99175 Merge branch 'maint' 2015-10-23 11:19:16 -04:00
Kyle Meyer 8c763ab08c Restore behavior of '.' in org-read-date
* lisp/org.el (org-read-date-minibuffer-local-map): Fix period behavior
  broken by e802936.

Reported-by: Matt Lundin <mdl@imapmail.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/102071>
2015-10-23 11:15:44 -04:00
Oleh Krehel 481719fbd5 Clear non-repeated SCHEDULED when marking a repeated DEADLINE done
* lisp/org.el (org-auto-repeat-maybe): When a TODO has a DEADLINE
  that's repeatable, but SCHEDULED that isn't repeatable, clear the
  SCHEDULED after setting the current repeat to DONE.
  The repeatable SCHEDULED will be re-scheduled as before.

Reference:
http://stackoverflow.com/questions/18123972/emacs-org-mode-clear-non-repeated-scheduled-time-when-deadline-is-repeated
2015-10-19 14:03:58 +02:00
Nicolas Goaziou af4e118870 Merge branch 'maint' 2015-10-18 09:49:15 +02:00
Nicolas Goaziou 4e864643bd Fix `org-return-follows-link' on links with emphasis
* lisp/org.el (org-return): Properly follow links when description is
  emphasized.  Also tolerate links and timestamps in otherwise forbidden
  areas (e.g., comments, node properties...), much like
  `org-open-at-point'.

* testing/lisp/test-org.el (test-org/return): Add tests.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101977>
2015-10-18 09:48:54 +02:00
Nicolas Goaziou a427098b57 Change `org-agenda-repeating-timestamp-show-all' targets
* lisp/org.el (org-closest-date): Rewrite function with less arguments.
  Improve readability.
(org-time-string-to-absolute): Apply changes to `org-closest-date'.
Improve docstring.

* testing/lisp/test-org.el (test-org/closest-date): New test.

This change implies specific repeaters (i.e., ".+" and "++") are no
longer treated the same as regular one (i.e. "+") wrt
`org-agenda-repeating-timestamp-show-all'.  Indeed, only the latter
represents multiple dates.  The former represent another date only when
TODO state changes, which could then skip some occurrences.

This fixes issue raised at
<http://permalink.gmane.org/gmane.emacs.orgmode/101884> and
<http://article.gmane.org/gmane.emacs.orgmode/26154>.
2015-10-16 18:18:49 +02:00
Nicolas Goaziou 44cb8b1656 Remove maximum indentation without untabifying
* lisp/org.el (org-remove-indentation):
(org-do-remove-indentation): Change algorithm so as not to untabify
string or buffer.

Only <tab> characters used for indentation may be removed.

Reported-by: "Charles C. Berry" <ccberry@ucsd.edu>
<http://permalink.gmane.org/gmane.emacs.orgmode/101768>
2015-10-08 16:15:17 +02:00
Rasmus 45b01819e0 Improve docstrings regarding latex_compiler
* org.el (org-latex-default-packages-alist):
* ox-latex.el (org-latex-compiler, org-latex-compilers)
  (org-latex-compiler-file-string, org-latex-bib-compiler)
  (org-latex--remove-packages): Improve docstring wrt. latex_compiler.
2015-10-04 15:54:21 +02:00
Kyle Meyer 984b1ff0ab Merge branch 'maint' 2015-10-04 02:46:23 -04:00
Kyle Meyer 00dacdcc50 Clean up spacing to pass Emacs's pre-commit check
This is in preparation for syncing with the Emacs repo.
2015-10-04 02:31:29 -04:00
Kyle Meyer e802936f4b Pass LIMIT argument to org-looking-back
* lisp/org-mouse.el (org-mouse-insert-item):
(org-mouse-context-menu):
* lisp/org-pcomplete.el (org-thing-at-point):
* lisp/org.el (org-read-date-minibuffer-local-map):
(org-timestamp-change): Provide LIMIT argument to org-looking-back.
* lisp/org.el (org-read-date-minibuffer-local-map):
(org-insert-heading): Replace looking-back with org-looking-back.

As of Emacs 25, the LIMIT argument to looking-back is advertised as a
required argument.
2015-10-04 02:31:29 -04:00
Kyle Meyer ef3ea9d02d Use prefix for outline functions
* lisp/ob-lilypond.el (org-babel-lilypond-mark-error-line):
* lisp/org-agenda.el (org-agenda-goto):
(org-agenda-show-and-scroll-up):
(org-agenda-show-1):
* lisp/org-archive.el (org-archive-subtree):
(org-archive-to-archive-sibling):
(org-toggle-archive-tag):
* lisp/org-capture.el:
(org-capture-place-template):
* lisp/org-colview.el:
(org-columns-eval):
* lisp/org-crypt.el (org-encrypt-entry):
* lisp/org-feed.el (org-feed-update):
* lisp/org-mouse.el (org-mouse-popup-global-menu):
* lisp/org.el (org-cycle):
(org-cycle-internal-global):
(org-cycle-internal-local):
(org-global-cycle):
(org-set-startup-visibility):
(org-set-visibility-according-to-property):
(org-overview):
(org-content):
(org-clean-visibility-after-subtree-move):
(org-set-outline-overlay-data):
(org-tree-to-indirect-buffer):
(org-move-subtree-down):
(org-paste-subtree):
(org-sort-entries):
(orgstruct-setup):
(org-show-set-visibility):
(org-mode-map):
(org-check-before-invisible-edit):
(org-kill-note-or-show-branches):
(org-org-menu):
(org-yank-generic):
* lisp/ox-org.el (org-org-publish-to-org): Use prefix for outline
  functions.
* lisp/org-compat.el: Add compatibility functions for outline functions
  that are under the "outline-" prefix as of Emacs 25.
2015-10-04 02:31:16 -04:00
Nicolas Goaziou a6350c4245 Merge branch 'maint' 2015-10-01 21:43:54 +02:00
Nicolas Goaziou 919d0cdb76 Fix "org-remove-if: Wrong type argument: number-or-marker-p, nil"
* lisp/org.el (org-remove-latex-fragment-image-overlays): Remove
  overlays not associated to a buffer.

Reported-by: Rainer M Krug <Rainer@krugs.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/101645>
2015-10-01 21:42:15 +02:00
Rasmus 1e4b7e4bec ox-latex: Support changable TeX compilers
* org.el (org-latex-default-packages-alist): Only use inputenc
and fontenc in pdftex.
* ox-latex.el (latex): Add :latex-compiler.
(org-latex-compiler): New defcustom.
(org-latex-compilers): New defconst.
(org-latex--remove-packages): New function.
(org-latex-template): Use new function and variables.
(org-latex-pdf-process): Update to use %latex shorthand.
(org-latex-compile): Check and use intended compiler.
* org.texi (@LaTeX{} and PDF export): Document changes.
* ORG-NEWS: Add entry.

Adds #+latex_compiler: keyword.

Note, rubber is dropped from `org-latex-pdf-process' since it does not
allow arbitrary latex commands.

Suggested-by: Suvayu Ali <fatkasuvayu+linux@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/98921>
2015-09-27 23:49:32 +02:00
Nicolas Goaziou d4aa7692bd Merge branch 'maint' 2015-09-24 10:19:38 +02:00
Richard Hansen 11bba63dc3 fix SETUPFILE pathname expansion with subdirectories
* lisp/org-macro.el (org-macro--collect-macros): cd to the directory
containing the SETUPFILE before recursing so that relative pathnames
in the SETUPFILE are expanded properly.

* lisp/org.el (org--setup-collect-keywords): cd to the directory
containing the SETUPFILE before recursing so that relative pathnames
in the SETUPFILE are expanded properly.

* lisp/ox.el (org-export--get-inbuffer-options,
org-export--list-bound-variables): cd to the directory containing the
SETUPFILE before recursing so that relative pathnames in the SETUPFILE
are expanded properly.

If /path/to/foo.org contains:

    #+SETUPFILE: settings/beamer.org

and /path/to/settings/beamer.org contains:

    #+SETUPFILE: common.org

then we want to read /path/to/settings/common.org, not
/path/to/common.org.

TINYCHANGE
2015-09-24 10:16:04 +02:00
Nicolas Goaziou e553ef2248 Make `org-show-children' interactive
* lisp/org.el (org-show-children): Make it a command.

Reported-by: Tokuya Kameshima <kametoku@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/101347>
2015-09-24 00:01:39 +02:00
Nicolas Goaziou 85035e4ce2 Revert "Fix a docstring"
This reverts commit e57a9ff926.
2015-09-24 00:00:57 +02:00
Nicolas Goaziou e57a9ff926 Fix a docstring
* lisp/org.el (org-show-children): Fix docstring.
2015-09-22 21:25:58 +02:00
Nicolas Goaziou b8c2102c09 Merge branch 'maint' 2015-09-22 21:23:41 +02:00
Nicolas Goaziou 304e5d33f5 Fix end time shifting past midnight
* lisp/org.el (org-modify-ts-extra): Properly wrap time after 23:59.

This can still generate wrong timestamps, e.g.

  <2015-09-21 Mo 23:00-23:55> => <2015-09-21 Mo 23:05-00:00>

but at least, the error is predictable.

Reported-by: Detlef Steuer <detlef.steuer@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/101350>
2015-09-22 21:15:09 +02:00
Kyle Meyer 5362f63fad Merge branch 'maint' 2015-09-21 18:46:41 -04:00
Kyle Meyer fbf4fa8cc7 Partially revert backport of commit 284c470
Revert cases in the last backport that converted "\[" in strings to "[",
which results in an error when eval-defun is called on them.
2015-09-21 18:38:39 -04:00
Paul Eggert c86a10b0bc Backport commit 284c470 from Emacs master branch
Backslash cleanup in Elisp source files
284c470ef752967fcd8bae6a450dc138462b1e49
Paul Eggert
Thu Sep 17 16:09:39 2015 -0700
2015-09-21 18:38:39 -04:00
Kyle Meyer 0839dc4322 Protect remaining apostrophes in docstrings
Protect apostrophes not covered by the last backport.  Convert
expressions like '(...)  to \\='(...)  and symbols written as 'name to
`name'.  (In addition to ensuring the correct display, the latter also
improves consistency with many Org docstrings.)

If these aren't protected, Emacs 25 may display them as curved quotes in
the help buffer, depending on the value of text-quoting-style.
2015-09-21 18:38:39 -04:00
Kyle Meyer d77a52a502 Backport quote-related commits from Emacs
These changes are the combination of the commits below (in order
applied).  Unlike other backports, these are applied in one commit
because they are closely related and because some of the later commits
reverse changes in earlier commits.  Changes to message and help quote
display for Emacs 25 seem to be here to stay.  The quote protections are
required to ensure grave accents and apostrophes are displayed as
intended in Emacs 25, and they should not affect earlier versions.

  Quoting fixes in lisp/org
  6cd2629bd1b3ce77d29ac28e29237c94a4197116
  Paul Eggert
  Mon Aug 31 00:29:40 2015 -0700

  More-conservative ‘format’ quote restyling
  fbb5531fa11d13854b274d28ccd329c9b6652cfc
  Paul Eggert
  Sun Aug 23 22:39:06 2015 -0700

  Prefer directed to neutral quotes
  875a5d0ead827d3da32ecbd30e739a29f07bbc87
  Paul Eggert
  Mon Aug 24 23:57:25 2015 -0700

  Escape ` and ' in doc
  19532d147b431a4fe34f088d6de07891c48e2c5c
  Paul Eggert
  Tue Sep 1 18:23:21 2015 -0700

  Fix some more docstring etc. quoting problems
  26bd978d87dfbf9baa115cd961a67d42b416c4bf
  Paul Eggert
  Thu Sep 3 15:32:54 2015 -0700

  Go back to grave quoting in source-code docstrings etc.
  6afef3f6ca2f3009c722b84e249903b7f807b044
  Paul Eggert
  Mon Sep 7 16:09:27 2015 -0700
2015-09-21 18:38:18 -04:00
Kyle Meyer 0cf9f17c55 Use substitute-command-keys more
* lisp/ob-core.el (org-confirm-babel-evaluate):
(org-babel-no-eval-on-ctrl-c-ctrl-c):
(org-babel-hash-at-point):
* lisp/org-agenda.el (org-agenda-log-mode-items):
(org-agenda-auto-exclude-function):
(org-search-view):
(org-todo-list):
(org-tags-view):
(org-agenda-log-mode):
(org-agenda-show-the-flagging-note):
* lisp/org-clock.el (org-clock-out-when-done):
* lisp/org-id.el (org-id-link-to-org-use-id):
* lisp/org-table.el (org-table-allow-automatic-line-recalculation):
(org-table-edit-formulas):
* lisp/org.el (org-support-shift-select):
(org-remove-highlights-with-change):
(org-refile-use-cache):
(org-use-fast-todo-selection):
(org-time-stamp-rounding-minutes):
(org-agenda-text-search-extra-files):
(org-cycle):
(org-ctrl-c-ctrl-c): Use substitute-command-keys.
2015-09-21 18:33:45 -04:00
Rasmus 204ac9fd67 org.el: Remove fixltx2e LaTeX dependency
* org.el (org-latex-default-packages-alist): Remove fixltx2e.

fixltx2e is obsolete.  See LaTeX News 22 for details:
<http://latex-project.org/ltnews/ltnews22.pdf>
2015-09-13 18:12:59 +02:00
Bastien daea0c7ce4 Merge branch 'maint' 2015-09-07 16:59:58 +02:00
Bastien aff6142b81 org.el: Enhance docstrings
* org.el (org-demote-subtree, org-do-demote)
(org-fix-position-after-promote): Enhance docstrings.
2015-09-07 16:59:13 +02:00
Nicolas Goaziou d854c18c4e Merge branch 'maint' 2015-09-04 21:31:28 +02:00
Nicolas Goaziou a2662dc365 Fix property drawer regexp
* lisp/org.el (org-property-drawer-re): Make sure regexp doesn't expand
  past other drawers.
2015-09-04 21:29:55 +02:00
Nicolas Goaziou b5fe5b88db Merge branch 'maint' 2015-09-03 23:08:44 +02:00
Nicolas Goaziou b0f6c3c251 Fix indentation when altering planning info
* lisp/org.el (org-add-planning-info): Do not remove too much
  indentation when removing a planning line.
* testing/lisp/test-org.el: Add tests.

Reported-by: George McNinch <gmcninch@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/100819>
2015-09-03 23:03:28 +02:00
Kyle Meyer 7ab1874a93 Add Babel support for Stan
* lisp/ob-stan.el: New file.
* lisp/org.el (org-babel-load-languages): Add Stan.
2015-09-03 00:30:09 -04:00
Nicolas Goaziou 2e13d33baa Merge branch 'maint' 2015-08-26 22:23:23 +02:00
Nicolas Goaziou af0704b4d5 Fix column view display when editing a property
* lisp/org.el (org-insert-property-drawer): Ensure insertion of new
  property drawer happens in current entry so as to not mess with next's
  overlays.

Reported-by: Dale <dale@codefu.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/100508>
2015-08-26 22:18:21 +02:00
Nicolas Goaziou 4f8d40dc33 Merge branch 'maint' 2015-08-23 22:46:29 +02:00
Nicolas Goaziou 9c5588377f Fix COMMENT fontification
* lisp/org.el (org-set-font-lock-defaults): Fix regexp.

Reported-by: Martin Carlé <mc@aiguphonie.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/100404>
2015-08-23 22:45:27 +02:00
Rasmus dbf2c95774 Revert "Merge branch 'maint'"
This reverts commit cadb9f3603, reversing
changes made to f6be2b5aa3.
2015-08-21 22:26:11 +02:00
Rasmus a53620d841 Revert "org.el: Update Version and Package-Requires header"
This reverts commit 97d43ff681.
2015-08-21 22:26:00 +02:00
Rasmus 6d3c988561 Revert "org.el: Add version header"
This reverts commit 182552ee75.
2015-08-21 22:23:42 +02:00
Nicolas Goaziou a8a60cc7f7 Merge branch 'maint' 2015-08-21 14:08:14 +02:00
Nicolas Goaziou 183348cda5 Fix typo
* lisp/org.el (org-open-at-point): Fix typo.

Reported-by: Sergei Nosov <sergei.nosov@gmail.com>
2015-08-21 14:07:26 +02:00
Nicolas Goaziou 5f217e6fd5 Merge branch 'maint' 2015-08-21 13:59:10 +02:00
Nicolas Goaziou daa8e23175 Fix expansion of archived trees
* lisp/org.el (org-hide-archived-subtrees): Do not assume BEG is at
  beginning of line.  This matters when function is called with point in
  the middle of an archived headline.

Reported-by: Hymie! <hymie@lactose.homelinux.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/100291>
2015-08-21 13:56:50 +02:00
Nicolas Goaziou 41b7c46519 Merge branch 'maint' 2015-08-20 14:05:27 +02:00
Nicolas Goaziou a72c58178d Fix f4d7646
* lisp/org.el (org-deadline):
(org-schedule): Remove spurious argument.
2015-08-20 14:02:39 +02:00
Nicolas Goaziou ad685348fd Merge branch 'maint' 2015-08-19 16:09:13 +02:00
Nicolas Goaziou f4d76465be Fix new time logging upon rescheduling
* lisp/org.el (org-deadline):
(org-schedule): Properly store new time so it is accessible using "%s"
in `org-log-note-headings'.

Reported-by: Malcolm Purvis <malcolm@purvis.id.au>
<http://permalink.gmane.org/gmane.emacs.orgmode/100211>
2015-08-19 16:07:22 +02:00
Nicolas Goaziou 3733658bb5 Merge branch 'maint' 2015-08-19 15:23:47 +02:00
Nicolas Goaziou 93b73bd303 Fix translated link
* lisp/org-element.el (org-element-link-parser): Call
  `org-link-translation-function' if required.
(org-element-link-interpreter): Build link from type and path instead of
simply pasting raw value.

* lisp/org.el (org-translate-link): Call parser to extract proper path
  and type.

* testing/lisp/test-org-element.el (test-org-element/link-interpreter):
  Add test.

Reported-by: Sergei Nosov <sergei.nosov@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/100227>
2015-08-19 15:22:22 +02:00
Nicolas Goaziou c5cbc6936e Merge branch 'maint' 2015-08-19 11:15:52 +02:00
Nicolas Goaziou 1abc4887a2 Fix `org-entry-properties' with default priority
* lisp/org.el (org-entry-properties): When no priority is explicitly
  set, report `org-default-priority' instead.

* testing/lisp/test-org.el (test-org/entry-properties): Update test.
2015-08-19 11:12:43 +02:00
Bastien 34c458929a Merge branch 'maint' 2015-08-18 11:53:54 +02:00
Bastien 682bb962f3 org.el (org-occur): Match timestamps at the end of a headline
* org.el (org-occur): Workaround to match timestamps at the
end of a headline.
2015-08-18 11:53:45 +02:00
Bastien af7ea548b0 Merge branch 'maint' 2015-08-17 20:43:03 +02:00
Bastien a03cd64994 Fix c6d9a4ec
* org.el (org-check-before-date, org-check-after-date): Save
match data.
2015-08-17 20:42:50 +02:00
Bastien da83bf584d Merge branch 'maint' 2015-08-16 15:15:09 +02:00
Bastien c27c101fa3 org.el: Fix `org-comment-string' fontification
* org.el (org-set-font-lock-defaults): Don't fontify
`org-comment-string' when not in a headline.
2015-08-16 15:14:27 +02:00
Nicolas Goaziou b9b500afd9 Merge branch 'maint' 2015-08-14 22:36:51 +02:00
Philip 453492ca95 org.el: Fix recursive regexp backtracking
* org.el (org-link-search): Avoid recursive regexp backtracking behavior
when following search links.

<http://article.gmane.org/gmane.emacs.orgmode/100010>

TINYCHANGE
2015-08-14 22:33:08 +02:00
Nicolas Goaziou 67fe03bcd7 Remove `org-list-empty-line-terminates-plain-lists'
* lisp/org-list.el (org-list-empty-line-terminates-plain-lists): Remove
  variable.
(org-list-end-re):
(org-list-separating-blank-lines-number):
* lisp/org.el (org-blank-before-new-entry): Adapt to change above.

* testing/lisp/test-org-element.el (test-org-element/at-point):
* testing/lisp/test-org-list.el (test-org-list/move-item-down):
(test-org-list/move-item-up):
(test-org-list/insert-item): Update tests.

This variable is not useful: plain lists can always be terminated with
two blank lines.
2015-08-14 16:34:37 +02:00
Rasmus 97d43ff681 org.el: Update Version and Package-Requires header 2015-08-14 02:05:30 +02:00
Rasmus cadb9f3603 Merge branch 'maint' 2015-08-14 02:04:49 +02:00
Nicolas Goaziou f6be2b5aa3 Merge branch 'maint' 2015-08-14 02:04:13 +02:00
Rasmus 182552ee75 org.el: Add version header
* org.el: Add version header.
* README_maintainer: Mention Version header.
2015-08-14 02:03:54 +02:00
Matt Lundin a3eeddefce Fix completion when selecting more than one tag
* lisp/org.el (org-fast-tag-selection): Make sure to set local variable
  buffer-tags to actual buffer-tags before pushing selected tag to the
  list; otherwise, the subsequent completion list will be limited to the
  one selected tag.
2015-08-14 01:58:49 +02:00
Nicolas Goaziou 2f2f266c24 Merge branch 'maint' 2015-08-13 22:33:29 +02:00
Nicolas Goaziou db314d8ad0 Fix table detection in non-Org buffers
* lisp/org.el (org-at-table-p): Allow local tables without full valid
  syntax when current buffer is not in Org mode.

Reported-by: Benjamin Slade <slade@jnanam.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/99982>
2015-08-13 22:31:36 +02:00
Nicolas Goaziou 4bb5306f2d Merge branch 'maint' 2015-08-13 02:44:02 +02:00
Nicolas Goaziou 4dc79cbe9d Fix splitting headlines with RET
* lisp/org.el (org-return): Make sure to keep headline from being
  invalidated by restricting positions where it can be split.

* testing/lisp/test-org.el (test-org/return): Add test.
2015-08-13 02:42:08 +02:00
Alexey Lebedeff 997a9a45d9 Make `org-return' follow links in headings again
* org.el (org-return): Check for links first when
  `org-return-follows-link' is non-nil, before inserting any newlines.

* testing/lisp/test-org.el (test-org/return): Add test.

This patch restores order in which `org-return' perform actions (which
was changed in a7e62499f2).

TINYCHANGE
2015-08-13 02:25:17 +02:00
Nicolas Goaziou 3add787abd Merge branch 'maint' 2015-08-11 19:12:49 +02:00
Nicolas Goaziou 6116c72975 Fix column view sums
* lisp/org.el (org-entry-properties): Remove need for `org-summaries'
  property.

* lisp/org-colview.el (org-columns--value): New function.
(org-columns):
(org-agenda-columns): Use new functions.

Reported-by: Johan Sandblom <js@ndblom.se>
<http://permalink.gmane.org/gmane.emacs.orgmode/99865>
2015-08-11 19:12:17 +02:00
Nicolas Goaziou e658b07c8a Merge branch 'maint' 2015-08-10 22:36:02 +02:00
Nicolas Goaziou aa98f7c79a Edit proper timestamp when on a time range
* lisp/org.el (org-time-stamp): Offer appropriate default value
  depending on position of point in a time range.

Reported-by: Christoph LANGE <math.semantic.web@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99783>
2015-08-10 22:32:24 +02:00
Nicolas Goaziou a472043b74 Fix ambiguous docstrings
* lisp/org.el (org-at-date-range-p):
(org-at-timestamp-p): Make match data explicit when returning a non-nil
value.
2015-08-10 22:31:31 +02:00
Kyle Meyer caf762e9bc Merge branch 'maint' 2015-08-10 12:19:59 -04:00
Kyle Meyer 44c8cd7136 org-map-entries: Fix org-agenda-prepare-buffers call
* lisp/org.el (org-map-entries): Check that buffer-file-name is non-nil
  before passing to org-agenda-prepare-buffers.

Like 11e8749, this surfaced as an error when 05efa7a ("Backport commit
3a5f751 from Emacs master branch", 2015-08-08) replaced a
'(while (setq VAR (pop LIST)) BODY)' with '(dolist (VAR LIST) BODY)',
resulting in the body being executed when '(nil)' was passed to
org-agenda-prepare-buffers.

Reported-by: Robert Klein <roklein@roklein.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/99779>
2015-08-10 12:19:13 -04:00
Nicolas Goaziou b911f17fc3 Merge branch 'maint' 2015-08-10 13:58:40 +02:00
Nicolas Goaziou 07a2d3d6f5 Fix agenda wrt commented headlines
* lisp/org.el (org-agenda-prepare-buffers): Ignore commented headlines
  deeper than level 1.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99529>
2015-08-10 13:54:19 +02:00
Nicolas Goaziou 898cfbcac0 Implement faster `show-children' function
* lisp/org.el (org-show-children): New function.
(org-cycle-internal-local):
(org-set-visibility-according-to-property):
(org-content):
(org-move-subtree-down):
(orgstruct-setup):
(org-show-set-visibility):
* contrib/lisp/org-toc.el (org-toc-cycle-subtree):
(org-toc-restore-config):
* lisp/org-agenda.el (org-agenda-show-1):
* lisp/org-feed.el (org-feed-update): Use new function.

* etc/ORG-NEWS: Document new function.

Suggested-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99616>
2015-08-10 13:37:29 +02:00
Nicolas Goaziou 7204ba0e46 Fix infloop due to wrong angle link regexp
* lisp/org.el (org-make-link-regexps): Fix infloop.

Reported-by: Gregor Zattler <telegraph@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/99779>
2015-08-10 10:04:09 +02:00
Kyle Meyer f6aa5341cb org-cycle-agenda-files: Fix agenda file check
* lisp/org.el (org-cycle-agenda-files): Raise error if there are no
  agenda files, as intended.  Simplify code.
2015-08-09 21:39:18 -04:00
Kyle Meyer 04aea5ea6f org-local-logging: Replace let* with let
* lisp/org.el (org-local-logging): Replace let* with let.
2015-08-09 21:39:18 -04:00
Kyle Meyer 906034b1a1 Partially revert last backport
* lisp/org.el (org-assign-fast-keys, org-make-tags-matcher)
(org-cycle-agenda-files): Revert dolist change because code in body
expects the list to be modified by pop each iteration.
(org-fast-todo-selection, org-fast-tag-selection): Revert dolist change
because code in body expects the list to be modified by pop each
iteration and because the variable name is used outside of the dolist
body.
2015-08-09 21:28:27 -04:00
Stefan Monnier ef96370304 Backport commit 3a5f751 from Emacs master branch
* lisp/org.el (org-goto-map, org-assign-fast-keys)
(org-contextualize-keys, org-contextualize-validate-key)
(org-notes-order-reversed-p, org-local-logging, org-map-entries)
(org-find-olp, org-find-exact-heading-in-directory)
(org-cycle-agenda-files, org-release-buffers, org-fill-template)
(org-agenda-prepare-buffers, org-occur-in-agenda-files)
(org-replace-escapes): Use dolist.
(org-mode): Optimize away XEmacs-only code.
(org-refile-get-targets): Remove unused var `f'.
(org-fast-todo-selection): Remove unused var `e'.
(org-make-tags-matcher): Use dolist.  Remove unused var `term'.
(org-fast-tag-selection): Use dolist.  Remove unused var `e'.
(org-format-latex): Use dolist.  Remove unused var `e'.
(org-backward-sentence, org-forward-sentence, org-meta-return)
(org-kill-line): Mark arg as unused.
(org-submit-bug-report): Silence compiler warning.
(org-occur-in-agenda-files): Don't use add-to-list on local vars.
(org-get-cursor-date): Remove unused var `tm'.
(org-comment-or-uncomment-region): Use standard name `_'.
(reftex-docstruct-symbol, reftex-cite-format): Declare to
silence byte-compiler.
(org-reftex-citation): Add `org--' prefix to dynamically scoped
`rds' var.

org.el: Fix up some lexical scoping warnings, and use dolist
3a5f75193ed10ee5fb458e9879340947f31d5e12
Stefan Monnier
Sat Aug 8 19:41:57 2015 -0400
2015-08-09 21:28:06 -04:00
Nicolas Goaziou 3b20eed34a Open timestamps also on CLOCK lines
* lisp/org.el (org-open-at-point): CLOCK are a valid location for
  timestamps.

Reported-by: Christoph LANGE <math.semantic.web@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99754>
2015-08-10 00:18:16 +02:00
Nicolas Goaziou c9ac8f6956 Fix false positives in TODO keywords
* lisp/org.el (org-entry-properties): Make sure case is meaningful when
  matching a TODO keyword.
* testing/lisp/test-org.el (test-org/entry-properties): Add test.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99756>
2015-08-09 23:56:57 +02:00
Nicolas Goaziou 570b1935e7 org-agenda: Do not block non-TODO entries
* lisp/org-agenda.el (org-agenda-dim-blocked-tasks): Do not check if an
  entry can be blocked when it doesn't have any TODO keyword.

* lisp/org.el (org-entry-blocked-p): Make sure entry is really an open
  task before even considering it as a blocked task.  Small refactoring.

* testing/lisp/test-org.el (test-org/entry-properties): Update tests.
(test-org/entry-blocked-p): New test.

Reported-by: Bingo UV <right.ho@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99544>
2015-08-06 17:56:40 +02:00
Nicolas Goaziou b1d3a904f1 Tiny fix
* lisp/org.el (org-get-tag-face): Tiny fix.
2015-08-06 15:41:16 +02:00
Nicolas Goaziou 3a632fa201 Fontify priorities, tags and TODO in colview
* lisp/org.el (org-get-priority-face): New function.
(org-font-lock-add-priority-faces): Use new function.

* lisp/org-colview.el (org-columns-new-overlay): Preserve face from
  string to display.
(org-columns-display-here): Apply usual face on TODO keywords, tags and
priorities in the columns overlay.
2015-08-06 15:35:44 +02:00
Nicolas Goaziou 4f3b3ce3d9 Fix a docstring
* lisp/org.el (org-get-tag-face): Fix docstring.  Small refactoring.
2015-08-06 14:57:23 +02:00
Paul Eggert ff92583e42 Backport commit eb0f65b from Emacs master branch
Don't overflow if computing approximate percentage
eb0f65b4fbbea60100b53cb40a1d7138d47ad0d2
Paul Eggert
Fri Jul 31 10:13:38 2015 -0700

* lisp/org-list.el (org-update-checkbox-count):
* lisp/org.el (org-table-map-tables)
(org-update-parent-todo-statistics):
Prefer (floor (* 100.0 NUMERATOR) DENOMINATOR) when calculating
progress-report percentages and the like.  This avoids problems
if (* 100 NUMERATOR) would overflow.
* lisp/org-colview.el (org-nofm-to-completion):
Prefer (round (* 100.0 NUMERATOR) DENOMINATOR) to a
more-complicated and less-accurate approximation.
2015-08-04 22:58:47 -04:00
Bastien 0d0d0ad56e Merge branch 'backport-master'
Conflicts:
	lisp/org-table.el
2015-08-05 01:01:46 +02:00
Mitchel Humpherys 99425a46dd contrib: rip out org-jira
Its changelog says it's abandoned, it doesn't really do anything, and it
clashes with [1].  Rip it out.

[1] https://github.com/baohaojun/org-jira
2015-08-05 00:46:43 +02:00
Bastien f246576081 org.el (org-split-string): Tiny refactoring
* org.el (org-split-string): Tiny refactoring.

Thanks to Marcin Borkowski for raising this.
2015-08-04 23:29:37 +02:00
Bastien 9111c21a75 org.el (org-latex-to-mathml-convert-command): Tiny docstring fix
* org.el (org-latex-to-mathml-convert-command): Tiny docstring fix.
2015-08-04 21:32:30 +02:00
Nicolas Goaziou f63d76872c Fix links with newline characters
* lisp/org-element.el (org-element-link-parser): Correctly parse links
  with newline characters.

* lisp/org.el (org-make-link-regexps): Allow newline characters within
  angle links.
(org-activate-angle-links): Support multiline angle links.

* testing/lisp/test-org-element.el (test-org-element/link-parser):
  Update tests.

As a rule of thumb, any newline character and all surrounding
whitespaces are treated as a single space in a bracket link.  They are
removed in angle links.
2015-08-04 16:40:25 +02:00
Nicolas Goaziou 02532389f4 Fix priority for fuzzy searches
* lisp/org.el (org-link-search): If fuzzy search is not starred, prefer
  targets and named elements over headlines.
2015-08-04 14:41:51 +02:00
Nicolas Goaziou 776449fd7d Prevent duplicating calls to `org-link-search'
* lisp/org.el (org-open-at-point): Do not call twice `org-link-search'
  when destination is not accessible within the current narrowed part of
  the buffer.
2015-08-04 14:32:55 +02:00
Nicolas Goaziou b4d85b47a9 Remove spurious argument to `org-link-search'
* lisp/org.el (org-link-search): Remove TYPE argument, used to force
  `org-occur' or `org-do-occur' on fuzzy search.  Instead, enclose string
  within forward slashes.

* lisp/org-macro.el (org-macro-initialize-templates):
* lisp/ob-exp.el (org-link-search): Apply signature change.
2015-08-04 14:10:44 +02:00
Nicolas Goaziou 271ecd090a Small refactoring
* lisp/org.el (org-set-tags): Small refactoring.
2015-08-04 11:01:33 +02:00
Nicolas Goaziou a3b2b7473e Repair radio target search
* lisp/org.el (org-open-at-point): Find radio targets again.
(org-search-radio-target): New function.

* testing/lisp/test-org.el (test-org/open-at-point/radio-target): New
  test.
2015-08-03 02:59:13 +02:00
Nicolas Goaziou e50033d494 Prevent fuzzy links from matching themselves
* lisp/org.el (org-open-at-point):
(org-link-search): Prevent fuzzy links from matching themselves.
2015-08-03 02:20:06 +02:00
Nicolas Goaziou cfe5bc97f8 Fix link search
* lisp/org.el (org-open-link-marker): Remove variable.
(org-open-at-point): Apply removal.
(org-link-search): Sanitize function.  Fix issue with internal link
encoding.
(org-search-not-self): Remove function.

* lisp/ox.el (org-export--inclusion-absolute-lines): Ensure INCLUDE
  keywords with locations can find named elements and targets.

* testing/lisp/test-org.el (test-org/return):
(test-org/coderef):
(test-org/custom-id): Update tests.
(test-org/fuzzy-links): Add tests.

Reported-by: Ivanov Dmitry <usr345@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/99340>
2015-08-03 01:06:32 +02:00
Nicolas Goaziou 57883f7957 Fix org-at-TBLFM-p
* lisp/org.el (org-at-TBLFM-p): Make sure match is case-insensitive.
  Improve speed in the general case.
2015-08-02 17:56:12 +02:00
Oleh Krehel 00142f4edf lisp/org.el (org-set-tags): Simplify further
* lisp/org.el (org-set-tags): Use let* for c0 p0 c1 rpl di tc;
Restructure so that no check on c0 is needed; Don't return a useless
tags var from cond; Change and into an equivalent when.
2015-07-28 15:16:49 +02:00
Oleh Krehel ceae5d651b lisp/org.el (org-set-tags): Simplify the code
* lisp/org.el (org-set-tags): Prefer let* to multi-variable setq,
move c0 p0 c1 rpl di tc variables to a narrower let scope.
2015-07-28 15:06:25 +02:00
Kyle Meyer 6f9184a294 Merge branch 'maint' into backport-master 2015-07-26 23:56:50 -04:00
Paul Eggert fa1a61c2ef Backport commit 85aa6ed from Emacs master branch
Use \r rather than ^M in string literals
85aa6ede9fe1b8165a99a4046dd8262ec93a02d5
Paul Eggert
Sat May 30 09:44:38 2015 -0700
2015-07-26 23:29:32 -04:00
Paul Eggert 6b04312e85 Backport commit 96794d2 from Emacs master branch
Don't quote nil and t in doc strings
96794d2f97cd064e4c2bf4f71459b42558cc8c79
Paul Eggert
Thu May 21 10:06:44 2015 -0700
2015-07-26 23:29:31 -04:00