Commit Graph

4080 Commits

Author SHA1 Message Date
Marco Wahl 7e57cf5d40 org: Fix tags extraction
* lisp/org.el (org-get-tags-at): Use non-greedy match up to colon to
  match all tags (and not just the last.)
* testing/lisp/test-org.el (test-org/tags-at): One test to cover the
  issue.
2016-06-09 10:06:14 +02:00
Don March bd49486db9 Make today's deadlines "close" without lead time
* lisp/org.el (org-deadline-close): A timestamp is close if the days
  between now and the timestamp are less then or equal to the days of
  lead time.

* testing/lisp/test-org.el: Add tests for org-deadline-close.
2016-06-04 20:45:41 +02:00
Don March 42620c1efa Rename org-deadline-is-close to have -p suffix
* lisp/org-agenda.el
  (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item):
* lisp/org.el (org-deadline-close): Rename to...
  (org-deadline-close-p): ...this.

* testing/lisp/test-org.el (test-org/deadline-close): Rename to...
  (test-org/deadline-close-p): ...this.
2016-06-04 20:39:15 +02:00
Don March 43b5ca1626 Make today's deadlines "close" without lead time
* lisp/org.el (org-deadline-close): A timestamp is close if the days
  between now and the timestamp are less then or equal to the days of
  lead time.

* testing/lisp/test-org.el: Add tests for org-deadline-close.
2016-06-04 20:39:15 +02:00
Nicolas Goaziou 3fd361eb77 Merge branch 'maint' 2016-06-02 13:33:34 +02:00
Yasushi SHOJI 361fa80eba Fix tag width calculation for multi-column chars
* lisp/org.el (org-align-tags-here): Fix tag width calculation for
  multi-column chars.

Some characters have multiple column width.  Calculating string width
with points gives a wrong value than actual display width.  Use
`string-width' instead.

Here is an ECM for this problem.  `M-x org-update-statistics-cookies` or
`C-c #` on bar moves the tag on the headline.

* foo [0/0]								🔤
** child
* bar [0/0]							     :日本語:
** child
12345678901234567890123456789012345678901234567890123456789012345678901234567890
         1         2         3         4         5         6         7         8
2016-06-02 13:31:09 +02:00
Nicolas Goaziou ecf20715e2 Merge branch 'maint' 2016-06-01 14:54:20 +02:00
Nicolas Goaziou 1f3d72e8b4 Fix TODO case-sensitivity in `org-get-heading'
* lisp/org.el (org-get-heading): Prevent removing false-positive TODO
  keywords due to case-insensitivity.
* testing/lisp/test-org.el (test-org/get-heading): New test.
2016-06-01 14:49:59 +02:00
Nicolas Goaziou 319c05f1dc Merge branch 'maint' 2016-06-01 00:44:55 +02:00
Nicolas Goaziou a1df8cfe71 Fix case-sensitivity of TODO keywords in imenu
* lisp/org.el (org-imenu-get-tree): Todo keywords are case-sensitive.

Reported-by: Georgiy Tugai <georgiy.tugai@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107500>
2016-06-01 00:43:28 +02:00
Nicolas Goaziou 11d6ebc60f 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.
2016-05-31 23:34:14 +02:00
Nicolas Goaziou 21ba5f510e 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>
2016-05-31 23:34:00 +02:00
Nicolas Goaziou 3d0ade9571 By default, use relative name for compilation
* lisp/org.el (org-compile-file): %f meant relative name of compiled
  file.  %F is its full name.  Also always set `default-directory' to
  the directory of the source.

Reported-by: Stig Brautaset <stig@brautaset.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/107348>
2016-05-30 00:13:22 +02:00
Nicolas Goaziou cf77060d18 Fix last commit
* lisp/org.el (org-edit-headline): Fix `save-match-data' scope.

`org-trim' modifies match data. `read-string' doesn't.
2016-05-30 00:02:27 +02:00
Marco Wahl 127f86bdc5 org: Fix interactive headline edit
* lisp/org.el (org-edit-headline): Save match-data before calling
  read-string.
2016-05-28 12:01:14 +02:00
Nicolas Goaziou 0ac099a6f8 Remove final parts of XEmacs compatibility code
* lisp/org-compat.el: Declare `org-add-hook', `org-decompose-region',
  `org-detach-overlay', `org-file-equal-p', `org-float-time',
  `org-indent-line-to', `org-indent-to-column', `org-looking-at-p',
  `org-looking-back', `org-propertize', `org-re' and
  `org-select-frame-set-input-focus' as obsolete.
(org-overlay-display, org-overlay-before-string, org-find-overlays):
Move to "org.el"
(org-xemacs-key-equivalents, org-xemacs-p): Remove variables.
(org-region-active-p): Drop XEmacs support.
(org-xemacs-without-invisibility): Remove macro.
(org-get-x-clipboard-compat): Remove function.
* lisp/org-macs.el (org-match-string-no-properties): Remove function.

* lisp/ob-core.el:
* lisp/org-agenda.el:
* lisp/org-archive.el:
* lisp/org-clock.el:
* lisp/org-colview.el:
* lisp/org-crypt.el:
* lisp/org-element.el:
* lisp/org-faces.el:
* lisp/org-feed.el:
* lisp/org-footnote.el:
* lisp/org-habit.el:
* lisp/org-id.el:
* lisp/org-indent.el:
* lisp/org-inlinetask.el:
* lisp/org-lint.el:
* lisp/org-list.el:
* lisp/org-mouse.el:
* lisp/org-pcomplete.el:
* lisp/org-src.el:
* lisp/org-table.el:
* lisp/org-timer.el:
* lisp/org.el:
* lisp/ox-ascii.el:
* lisp/ox-odt.el:
* lisp/ox.el:
* contrib/lisp/org-notify.el:
* contrib/lisp/ox-taskjuggler.el:
* contrib/lisp/org-wikinodes.el:
* testing/lisp/test-org-src.el:
* testing/lisp/test-org.el: Silence byte-compiler.
2016-05-26 13:56:25 +02:00
Nicolas Goaziou 4129ae6737 Remove some XEmacs compatibility layer
* lisp/ob-calc.el (calc-trail):
* lisp/ob-python.el (org-babel-python-mode):
* lisp/org-agenda.el (org-agenda-tags-column):
(org-agenda-show-new-time):
* lisp/org-clock.el (org-clock-update-mode-line):
(org-clock-put-overlay):
(org-clock-resolve):
* lisp/org-faces.el (org-faces):
* lisp/org-indent.el (org-indent-mode):
* lisp/org-macs.el (org-load-noerror-mustsuffix):
* lisp/org-table.el (orgtbl-setup):
* lisp/org.el (org-key):
(org-self-insert-cluster-for-undo):
(org-tags-column):
(org-emphasis-alist):
(org-mode):
(org-set-font-lock-defaults):
(org-cycle-internal-local):
(org-tree-to-indirect-buffer):
(org-set-frame-title):
(org-priority):
(org-set-tags):
(org-set-current-tags-overlay):
(org-toggle-time-stamp-overlays):
(org-display-custom-time):
(org-diary-to-ical-string):
(org--format-latex-make-overlay):
(org-dvipng-color):
(org-latex-color):
(org-mode-map):
(org-speed-commands-default):
(org-reload):
(org-display-warning):
(org-end-of-line):
* lisp/ox-man.el (org-man-inline-src-block):
* contrib/lisp/org-vm.el (org-vm-follow-link):
* contrib/lisp/ox-groff.el (org-groff-inline-src-block):
(org-groff-src-block): Remove some XEmacs compatibility layer.
2016-05-26 11:30:11 +02:00
Feng Shu 2a8a8b3109 Fix typo
* org.el (org-preview-latex-process-alist): Fix typo in docstring.
2016-05-24 22:23:23 +02:00
Feng Shu 6826ccdebc Latex previewing: imagemagick use pdflatex by default
* org.el (org-preview-latex-process-alist): Use "pdflatex" instead of
  "latex".
2016-05-24 19:27:29 +02:00
Feng Shu bf93e166be Use dvisvgm to preview latex formulas
* ox-html.el (org-html-with-latex): Add dvisvgm support.
(org-html-with-latex): Add dvisvgm support.
(org-html-format-latex): "ltxpng" -> "ltximg".
(org-html-latex-environment): Add dvisvgm support.
(org-html-latex-fragment): Add dvisvgm support.

* org.el (org-preview-latex-default-process): New variable.
(org-latex-create-formula-image-program): Rename it to `org-preview-latex-default-process'.
(org-latex-preview-ltximg-directory): Rename it to `org-preview-latex-image-directory'.
(org-preview-latex-image-directory): New variable.
(org--format-latex-make-overlay): Add optional image-type, which used to deal with svg.
(org-toggle-latex-fragment): "org-ltxpng" -> "org-ltximg".
(org-format-latex): Add dvisvgm support.
(org-create-formula-image): Big refactor, merge dvipng and imagemagick
backend's feature.  Add dvisvgm feature.
(org-preview-latex-process-alist): Add new variable, which used to set
latex preview processes.
(org-create-formula-image-with-dvipng):
(org-create-formula-image-with-imagemagick): Useless, removed.

* org.texi (@LaTeX{} fragments):
(Previewing @LaTeX{} fragments):
(Math formatting in HTML export):
(Working with @LaTeX{} math snippets): Add dvisvgm information.
2016-05-21 10:50:38 +02:00
Nicolas Goaziou e234643d92 Fix `org-open-at-point-global'
* lisp/org.el (org-open-at-point-global): Handle any external link
  looking like an Org link or time-stamp.

Reported-by: Uwe Brauer <oub@mat.ucm.es>
<http://permalink.gmane.org/gmane.emacs.orgmode/107220>
2016-05-20 22:04:11 +02:00
Nicolas Goaziou 2d846210eb Implement conditional case-fold search in org-occur
* lisp/org.el (org-occur-case-fold-search): New variable.
(org-occur): Use new variable.

* testing/lisp/test-org.el (test-org/occur): Add tests.
2016-05-20 14:04:04 +02:00
Nicolas Goaziou ea1147a479 Add `org-compile-file' and `org-file-newer-than-p'
* lisp/org.el (org-compile-file):
(org-file-newer-than-p): New functions.

* lisp/ox-latex.el (org-latex-compile): Use new functions.

* lisp/ox-man.el (org-man-compile): Use new functions.
(org-man-collect-errors): Remove it.

* lisp/ox-texinfo.el (org-texinfo-compile): Use new functions.
(org-texinfo-collect-errors): Remove function as it is not accurate
enough (e.g., it doesn't handle internationalization).
2016-05-19 09:44:05 +02:00
Kyle Meyer d38e91867c Fix remaining declare-function issues on master
* lisp/org-list.el (org-export-create-backend):
Indicate that FN is not a defun.
* lisp/org-list.el (org-export-create-backend):
(org-export-data-with-backend):
(org-export-get-backend):
(org-export-get-environment):
(org-export-get-next-element):
(org-export-with-backend):
Correct source file name.
* lisp/org.el (calendar-check-holidays):
(org-agenda-format-item):
Correct argument list.
2016-05-15 19:16:30 -04:00
Kyle Meyer 4925d5be7b Merge branch 'maint' 2016-05-15 19:00:30 -04:00
Kyle Meyer 19cf68da90 Fix remaining declare-function issues
* lisp/ob-shell.el (org-babel-comint-in-buffer):
(org-babel-comint-with-output):
* lisp/org-table.el (org-export-create-backend):
* lisp/org.el (org-babel-do-in-edit-buffer): Indicate that FN is not a
defun.
* lisp/ob-tangle.el (org-string-nw-p):
* lisp/org-table.el (org-export-create-backend):
(org-export-data-with-backend):
(org-export-filter-apply-functions):
(org-export-first-sibling-p):
(org-export-get-backend):
(org-export-get-environment):
(org-export-install-filters):
(org-export-table-has-special-column-p):
(org-export-table-row-is-special-p): Correct source file name.
* lisp/ob-R.el (ess-wait-for-process):
* lisp/org-clock.el (calendar-iso-to-absolute):
* lisp/org-list.el (org-previous-line-empty-p):
* lisp/org-pcomplete.el (org-entry-properties):
* lisp/org-table.el (org-export-data-with-backend):
(org-export-get-environment):
* lisp/org.el (org-element-interpret-data): Correct argument list.
2016-05-15 18:59:20 -04:00
Kyle Meyer 1c9bb0dba8 Fix up last backport
* lisp/org.el (org-export-backend-options): Add back removed
declare-function call.
* lisp/ob-awk.el (orgtbl-to-generic):
* lisp/ob-core.el (orgtbl-to-generic):
* lisp/ob-gnuplot.el (orgtbl-to-generic): Remove BACKEND argument from
declare-function calls.

The last backport added this argument to match orgtbl-to-generic's
signature in Emacs's version of Org, but the BACKEND argument to
orgtbl-to-generic was later removed in 9209aa3 (org-table: Use "ox.el"
internally for radio tables, 2014-08-24).
2016-05-15 18:59:19 -04:00
Paul Eggert 1f046ea4b1 Backport commit 65c8c7c from Emacs
* lisp/ob-awk.el (orgtbl-to-generic):
* lisp/ob-core.el (orgtbl-to-generic):
* lisp/ob-exp.el (org-element-context):
* lisp/ob-gnuplot.el (org-time-string-to-time)
(orgtbl-to-generic):
* lisp/ob-haskell.el (org-export-to-file):
* lisp/ob-latex.el (org-create-formula-image)
(org-latex-compile):
* lisp/ob-python.el (run-python):
* lisp/ob-tangle.el (org-link-escape, org-back-to-heading):
* lisp/org-colview.el (org-agenda-redo):
* lisp/org-feed.el (url-retrieve-synchronously):
* lisp/org-info.el (Info-find-node):
* lisp/org-list.el (org-previous-line-empty-p):
* lisp/org-macs.el (org-string-match-p):
* lisp/org.el (org-beamer-mode):
Fix prototype to match current definition.
* lisp/ob-comint.el (tramp-flush-directory-property):
* lisp/ob-tangle.el (org-babel-update-block-body):
* lisp/org-bibtex.el (org-babel-trim):
* lisp/org-pcomplete.el (org-export-backend-options):
* lisp/org-protocol.el (org-publish-get-project-from-filename):
Fix file name in declare-function.
* lisp/ob-comint.el (with-parsed-tramp-file-name)
* lisp/ob-core.el (with-parsed-tramp-file-name):
* lisp/org.el (org-beamer-mode):
Append ‘t’ to declare-function, since the declaration isn’t a defun.
* lisp/ob-core.el (org-save-outline-visibility):
Remove; not needed.
* lisp/ob-scheme.el (run-geiser, geiser-mode)
(geiser-eval-region, geiser-repl-exit):
* lisp/ox-org.el (htmlize-buffer):
Prepend "ext:" to file name, since it is not part of Emacs.
* lisp/org-gnus.el (nnimap-group-overview-filename):
Remove decl, since function was removed.
* lisp/org-macro.el (org-with-wide-buffer):
Omit unnecessary (and mismatching) decl.
* lisp/org-clock.el (calendar-iso-to-absolute):
Declare calendar-iso-to-absolute instead, since it is the
non-obsolete version of this function.
* lisp/org-compat.el (w32-focus-frame):
Remove decl, since function is now obsolete.

Pacify ‘make check-declare’
65c8c7cb96c14f9c6accd03cc8851b5a3459049e
Paul Eggert
Sat May 14 19:57:44 2016 -0700
2016-05-15 18:59:16 -04:00
Nicolas Goaziou 8127b3c30d Merge branch 'maint' 2016-05-05 13:15:34 +02:00
Nicolas Goaziou 83e373f109 Fix `org-occur' when regexp matches a single char
* lisp/org.el (org-occur): Fix infloop when regexp matches a single
  char.  Improve docstring.

(org-check-before-date):
(org-check-after-date):
(org-check-dates-range): Match correct object since point may be at the
beginning of the next one.

* testing/lisp/test-org.el (test-org/occur): New test.
2016-05-05 12:59:46 +02:00
Nicolas Goaziou 1ca1d52e92 Fix `org-occur' when called non-interactively
* lisp/org.el (org-first-headline-recenter): Check if current buffer is
  actually displayed in a window before trying to recenter view.
2016-05-05 11:55:00 +02:00
Nicolas Goaziou 36dbdb9465 Fix keywords in defcustom
* lisp/org.el (org-show-context-detail): Fix keywords according to
  commit c112f40.
2016-05-01 01:32:16 +02:00
Nicolas Goaziou 590cb1227a Merge branch 'maint' 2016-05-01 01:30:57 +02:00
Nicolas Goaziou af853dd3aa Fix `org-flag-drawer' with optional argument
* lisp/org.el (org-flag-drawer): Do not require point to be at a drawer
  in order to call the function with an optional argument.

* testing/lisp/test-org.el (test-org/flag-drawer): Narrow test.
2016-05-01 01:27:30 +02:00
Nicolas Goaziou bb034dfe04 `org-show-context' always displays point
* lisp/org.el (org-show-set-visibility): Always show point, even when it
  is hidden in a block or a drawer.

* testing/lisp/test-org.el (test-org/show-set-visibility): Add tests.

Reported-by: Derek Feichtinger <dfeich@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106744>
2016-05-01 01:14:10 +02:00
Nicolas Goaziou c112f40d51 org-agenda: Remove unnecessary visibility modification
* lisp/org.el (org-show-context-detail): Change default visibility span
  for agenda context.

* lisp/org-agenda.el (org-agenda-goto):
(org-agenda-todo):
(org-agenda-add-note):
(org-agenda-priority):
(org-agenda-set-tags):
(org-agenda-set-property):
(org-agenda-set-effort):
(org-agenda-toggle-archive-tag):
(org-agenda-clock-in): Special visibility is taken care of by
`org-show-context'.  Do not hard-code anything else.

* contrib/lisp/org-contacts.el (org-contacts-gnus-article-from-goto):
Special visibility is taken care of by `org-show-context'.  Do not
hard-code anything else.
2016-04-29 11:35:49 +02:00
Nicolas Goaziou 3baf246f4f Handle correctly `shift-select-mode'
* lisp/org.el (org-beginning-of-line): Handle correctly `shift-select-mode'.

Reported-by: Mathieu Marques <mathieumarques78@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106783>
2016-04-28 23:28:15 +02:00
Nicolas Goaziou 6ed60a797a Merge branch 'maint' 2016-04-28 22:08:01 +02:00
Nicolas Goaziou c8c2d2b1f7 Fix multiple groups of mutually exclusive tags
* lisp/org.el (org-set-tags): Use a subtler mechansim to remove
  duplicate tags.  This fixes a bug introduced in 77b4fad.

Reported-by: Christoph LANGE <math.semantic.web@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106763>
2016-04-28 22:04:49 +02:00
Nicolas Goaziou f227c2f1af Silence byte-compiler 2016-04-28 17:02:29 +02:00
Nicolas Goaziou 1daac70fc5 Merge branch 'maint' 2016-04-26 21:03:45 +02:00
Nicolas Goaziou e818699113 Fix storing links to headlines containing multiple links
* lisp/org.el (org-store-link): Fix storing links to headlines
  containing multiple links.

* testing/lisp/test-org.el (test-org/store-link): New test.

Reported-by: Georgiy Tugai <georgiy.tugai@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106606>
2016-04-26 20:59:33 +02:00
Nicolas Goaziou 00a8275c62 Fix links to elements with a name
* lisp/org.el (org-store-link): Properly handle elements with a NAME
  keyword.
2016-04-26 18:58:01 +02:00
Kyle Meyer dfafc869a3 Merge branch 'maint' 2016-04-23 17:40:16 -04:00
Kyle Meyer ae73c75fa6 org-yank: Correct docstring
* lisp/org.el (org-yank): Update docstring for change in default value
  of org-yank-adjusted-subtrees.

The default value was changed to nil in 2949012 (Change default values
of some variables., 2009-02-01).

Reported-by: Jorge Peixoto de Morais Neto <jorge13515@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106610>
2016-04-23 17:38:45 -04:00
Oleh Krehel 8614a2476f Add detailed location to "org-mode fontification error"
* lisp/org.el (org-fontify-meta-lines-and-blocks): Update.
2016-04-20 17:22:09 +02:00
Nicolas Goaziou 7894129841 Merge branch 'maint' 2016-04-19 01:37:50 +02:00
Nicolas Goaziou 77b4fad528 Remove duplicate candidates when setting tags
* lisp/org.el (org-set-tags): Remove duplicate candidates from menu.
2016-04-19 01:34:27 +02:00
Nicolas Goaziou 9297757fc0 Fix tag related defcustoms
* lisp/org.el (org-tag-alist):
(org-tag-persistent-alist): Improve docstring. Fix values.
2016-04-18 18:08:53 +02:00
Nicolas Goaziou 4743d43dd8 Properly handle `org-tag-persistent-alist'
* lisp/org.el (org-current-tag-alist): New variable.
(org-set-tags):
(org-global-tags-completion-table):
(org-agenda-prepare-buffers): Use new variable.
(org-set-regexps-and-options): Use new variable.  Handle STARTUP early
so that "#+STARTUP: noptag" is taken into consideration.

* lisp/org-agenda.el (org-agenda-bulk-action): Use new variable.

* lisp/org-mobile.el (org-mobile-create-index-file): `org-tag-alist' is
  no longer buffer-local.

* testing/lisp/test-org.el (test-org/set-regexps-and-options): Add
  tests.
2016-04-18 18:07:40 +02:00
Nicolas Goaziou 74d3bd484f Factorize tags parsing
* lisp/org.el (org-tag-string-to-alist):
(org-tag-alist-to-string):
(org-tag-alist-to-groups): New functions.
(org-set-regexps-and-options): Use new functions.

(org--setup-process-tags): Remove function.

(org--setup-collect-keywords): Return tag groups as a string instead of
a list so as to be compatible with new functions.

* lisp/org-mobile.el (org-mobile-create-index-file): Use new functions.

* lisp/org-pcomplete.el (pcomplete/org-mode/file-option/tags): Use new
  functions.
(pcomplete/org-mode/tag): Small refactoring.

* testing/lisp/test-org.el (test-org/tag-string-to-alist):
(test-org/tag-alist-to-string):
(test-org/tag-alist-to-groups): New tests.
2016-04-18 17:40:15 +02:00
Nicolas Goaziou d87158ba2a Merge branch 'maint' 2016-04-16 11:38:25 +02:00
Nicolas Goaziou e0acd8a15a Fix "Invalid time zone specification" error
* lisp/org.el (org-timestamp-change): Correctly handle `encode-time'
  parameters.

Suggested-by: Derek Feichtinger <dfeich@gmail.com>
Reported-by: Eric Abrahamsen <eric@ericabrahamsen.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/106344>
2016-04-16 11:35:43 +02:00
Nicolas Goaziou 9314380284 Merge branch 'maint' 2016-04-14 09:18:00 +02:00
Nicolas Goaziou 846467b718 Fix typo
* lisp/org.el (org-property--local-values): Fix typo in doc string.
2016-04-14 09:17:34 +02:00
Kyle Meyer 634e12a31e Merge branch 'maint' 2016-04-11 00:32:43 -04:00
Kyle Meyer acfd411193 Update format-time-string calls for argument change
* lisp/org.el (org-timestamp-format):
* lisp/ox-icalendar.el (org-icalendar-convert-timestamp): Specify t for
  the ZONE argument of format-time-string to indicate UTC.

As of Emacs's af32fa9 (New optional ZONE arg for format-time-string
etc., 2015-07-26), UTC is indicated by passing t as the third argument
to format-time-string rather than any non-nil value.

This change is in place of a backport of Emacs's b787d55 (More
format-time-string change fixups, 2016-04-02), which would not work for
earlier versions of Emacs.
2016-04-11 00:32:08 -04:00
Nicolas Goaziou 492d68c936 Add ODT to default export back-ends
* lisp/org.el (org-export-backends): Add `odt' to default value.

Reported-by: Uwe Brauer <oub@mat.ucm.es>
<http://permalink.gmane.org/gmane.emacs.orgmode/106198>
2016-04-10 10:22:38 +02:00
Michael Strey 0fac70ea89 org.el: Fix bug from switch to lexical binding
* lisp/org.el (org-check-dates-range): Fix a bug introduces with the
  switch to lexical binding in commit
  1f49e9fdfd.

This change fixed the following bug:  C-c \ D leads to error message "Symbol's value as variable is void: start-date".

TINYCHANGE
2016-04-08 23:12:42 +02:00
Nicolas Goaziou 64ca6f2c24 Keep headlines named like current one in refile targets
* lisp/org.el (org-refile-get-targets): Change signature.
(org-refile-get-location): Change signature.  Also apply change above.
(org-goto):
(org-refile): Apply change above.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106051>
2016-04-05 23:45:37 +02:00
Nicolas Goaziou ff236e5c85 Merge branch 'maint' 2016-03-30 15:36:16 +02:00
Nicolas Goaziou 954103dd9b Fix indentation bug
* lisp/org.el (org--get-expected-indentation): Return correct columns
  when at the end of an empty item.
* testing/lisp/test-org.el (test-org/indent-line): Add test.
2016-03-30 15:34:24 +02:00
Marcin Borkowski ebd68ae499 Enhance year handling
* lisp/org.el (org-read-date-analyze): Handle two-digit years with
`org-small-year-to-year' instead of just adding 2000
2016-03-18 14:31:07 +01:00
Nicolas Goaziou bf40aba6cd Merge branch 'maint' 2016-03-17 16:51:43 +01:00
Nicolas Goaziou 261eadb9d4 Fix indentation bug
* lisp/org.el (org--get-expected-indentation): Fix indentation.
* testing/lisp/test-org.el (test-org/indent-line): Add test.
2016-03-17 16:50:54 +01:00
Kyle Meyer 015d971f48 Merge branch 'maint' 2016-03-12 11:12:08 -05:00
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