Commit Graph

14730 Commits

Author SHA1 Message Date
Matt Lundin 5e27b2fd32 Ensure that org-get-tags returns all local tags
* lisp/org.el: (org-get-tags) Create a clearer separation between
  local and inherited tags in the function, so that
  org-remove-uninherited tags is only run on inherited tags. This is
  important to avoid destroying existing tags when adding new tags.
* testing/lisp/test-org.el: (test-org/get-tags) Add regression test
2018-08-19 10:28:27 +02:00
Kyle Meyer ab1f7712de org-attach: Don't query unnecessarily about archiving
* lisp/org-attach.el (org-attach-archive-delete-maybe): Don't query
about deleting attachments if the entry doesn't have any attachments.
2018-08-10 21:24:54 -04:00
Bastien 18998fd4c2 Merge branch 'maint' 2018-08-05 08:02:14 +02:00
Charles Celerier 30498ef932 ox-odt: Fix `org-odt-template' styles file retrieval
* lisp/ox-odt.el (org-odt-template): Fix `org-odt-template' styles
  file retrieval.

TINYCHANGE

Signed-off-by: Charles Celerier <chckyn@gmail.com>
2018-08-05 08:02:00 +02:00
Nicolas Goaziou d975b44fd4 Fix `org-kill-line' on tag lines
* lisp/org.el (org-kill-line): Preserve tags when `org-special-ctrl-k'
  is non-nil.
* testing/lisp/test-org.el (test-org/kill-line): New test.

Reported-by: Matt Lundin <mdl@imapmail.org>
<http://lists.gnu.org/r/emacs-orgmode/2018-07/msg00122.html>
2018-07-17 22:24:01 +02:00
Nicolas Goaziou 417479238b org-macs: Move a macro 2018-07-17 11:41:58 +02:00
Nicolas Goaziou a2636b5286 org-clock: Fix `org-clock-in' with (4) argument.
* lisp/org-clock.el (org-clock-in): Use `org-get-heading' so one can
  select an empty task.  Also check base buffer instead of comparing
  current buffer.  Small refactoring.

Reported-by: Robert Irelan <rirelan@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-07/msg00116.html>
2018-07-17 10:54:28 +02:00
Nicolas Goaziou 65ebb128bc org-macro: Fix "results" macro
* lisp/org-macro.el (org-macro-initialize-templates): Do not
  initialize the special "results" macro.
(org-macro-replace-all): Do not raise an error if "results" macro has
no associated template yet.
* lisp/ox.el (org-export-as): Update code comments.
* testing/lisp/test-ox.el (test-org-export/expand-macro): Add test.
2018-07-07 12:53:13 +02:00
Nicolas Goaziou 623cc46259 org-macro: Small refactoring
* lisp/org-macro.el (org-macro--get-property): New function.
(org-macro-initialize-templates): Use new function.
2018-07-07 12:37:24 +02:00
Nicolas Goaziou 84d87d990e org-macro: Fix a docstring
* lisp/org-macro.el (org-macro-initialize-templates): Add missing
  macros to docstring.

Reported-by: "Berry, Charles" <ccberry@ucsd.edu>
<http://lists.gnu.org/r/emacs-orgmode/2018-07/msg00032.html>
2018-07-07 12:10:48 +02:00
Nicolas Goaziou 445dc6af6f org-colview: Do not move point when initializing columns
* lisp/org-colview.el (org-columns): Do not move point.

Reported-by: Benjamin Motz <benni.motz@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-07/msg00040.html>
2018-07-07 09:27:04 +02:00
Nicolas Goaziou d3774fba77 Limit `org-open-at-point'
* lisp/org.el (org-open-at-point): Do not open everything that looks
  like a link, in particular in verbatim or code objects.  However,
  still conveniently open links in comments, node properties and
  keywords.
2018-07-05 13:35:26 +02:00
Nicolas Goaziou 120f871f41 Small refactoring
* lisp/ob-core.el (org-babel-open-src-block-result): Fix docstring,
  refactor code.
* lisp/org.el (org-open-at-point): Refactor so as to not call
  `org-babel-open-src-block-result' unconditionally.
2018-07-05 13:15:30 +02:00
Nicolas Goaziou 3f601e218d org-src: Fix auto-saving of remote editing buffers
* lisp/org-src.el (org-src--auto-save-timer): No longer buffer-local.
(org-src-mode): Tiny refactoring so as to keep code under 80 columns.

Reported-by: Andreas Fuchs <asf@boinkor.net>
http://lists.gnu.org/archive/html/emacs-orgmode/2018-07/msg00002.html
2018-07-02 00:45:12 +02:00
Nicolas Goaziou 7d9e4da447 Prevent spurious newline character in fixed-width area value
* lisp/org-element.el (org-element-fixed-width-parser): Prevent
  spurious newline character at the end of the value.
* lisp/ox-latex.el (org-latex-fixed-width):
* lisp/ox-man.el (org-man-fixed-width):
* lisp/ox-texinfo.el (org-texinfo-fixed-width):
* contrib/lisp/ox-groff.el (org-groff-fixed-width): Adapt to change.
* testing/lisp/test-org-element.el (test-org-element/fixed-width-parser):
  Update tests.

Reported-by: 孙振祥 <sunznx@icloud.com>
<http://lists.gnu.org/archive/html/emacs-orgmode/2018-07/msg00003.html>
2018-07-02 00:24:38 +02:00
Nicolas Goaziou 937e7ce76b org-macs: Fix last commit
* lisp/org-macs.el (org-parse-time-string): Fix typo in last commit.
* testing/lisp/test-org-element.el (test-org-element/timestamp):
  Rename to `test-org-element/timestamp-parser'.
2018-07-02 00:18:44 +02:00
Nicolas Goaziou e1884a0985 org-macs: Tiny refactoring
* lisp/org-macs.el (org-parse-time-string): Refactor code.

`org-parse-time-string' does not need to handle non-Org timestamps,
like "<tomorrow>" or "<+2d>" so we remove the cond branch.
2018-07-01 23:25:56 +02:00
Nicolas Goaziou 6f8fdabf35 org-macs: Fix circular dependency
* lisp/org-macs.el (org-matcher-time): Fix circular dependency between
  `org-parse-time-string', `org-matcher-time' and `org-2ft'.  Improve
  docstring.

Reported-by: Allen Li <vianchielfaura@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2017-11/msg00023.html>
2018-06-28 22:40:51 +02:00
Robert Irelan fda1d27610 org-clock: Properly handle `org-extend-today-until' in clock tables
* lisp/org-clock.el (org-clock-special-range): Handle non-default
   `org-extend-today-until' when generating a clock table with the
   `:block` directive.

 Reported-by: Robert Irelan <rirelan@gmail.com>
 <http://lists.gnu.org/archive/html/emacs-orgmode/2018-04/msg00294.html>
2018-06-27 08:31:38 +02:00
Nicolas Goaziou cad692c276 ox: Fix Italian translation for "Figure"
* lisp/ox.el (org-export-dictionary): Fix Italian translation for
  "Figure".

Reported-by: Franco Pasut <franco.pasut@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00373.html>
2018-06-26 12:00:30 +02:00
Nicolas Goaziou accf99cbc0 Deprecate `org-effort-durations'
* lisp/org.el (org-effort-duration): Remove unused variable.
* lisp/org-compat.el (org-effort-durations): Make
  `org-effort-duration' an alias for `org-duration-units'.
* lisp/org-clock.el (org-clock-modify-effort-estimate): Fix docstring.
* doc/org-manual.org (Footnotes): Clarify footnote.

The variable is inactive since introduction of "org-duration" library.
2018-06-25 17:13:04 +02:00
Nicolas Goaziou 7c14efd3e9 org-info: Fix typo
* lisp/org-info.el (org-info-follow-link): Fix typo in regexp.
2018-06-24 19:55:11 +02:00
Nicolas Goaziou 1f9e1cce62 org-footnote: Fix last commit
* lisp/org-footnote.el (org-footnote-next-reference-or-definition):
  Fix typo introduced in last commit.
2018-06-24 19:47:41 +02:00
Nicolas Goaziou c37c6bda3c org-footnote: Fix footnote predicates
* lisp/org-footnote.el (org-footnote-at-reference-p):
(org-footnote-at-definition-p): Rewrite using Elements library.
(org-footnote-get-next-reference): Use `org-footnote-at-reference-p'.
(org-footnote-next-reference-or-definition): Use old definition for
`org-footnote-at-definition-p' and `org-footnote-at-definition-p'.

This patch aims at reducing the calls to the inaccurate
`org-footnote-in-valid-context-p' function.  However,
`org-footnote-next-reference-or-definition' still uses it because the
function is for fontification only, so 1. accuracy matters less
2. Elements has a slower worse case scenario.
2018-06-24 14:57:49 +02:00
Nicolas Goaziou 627cb7f578 org-footnote: Fix `org-footnote-goto-previous-reference'
* lisp/org-footnote.el (org-footnote-goto-previous-reference): Only
  add to mark ring on a successful match.  Improve error message when
  reference is outside visible part of buffer.
(org-footnote-get-next-reference): Avoid using
`org-footnote-at-reference-p', which is inaccurate, due to
`org-footnote-in-valid-context-p'.
* testing/lisp/test-org-footnote.el (test-org-footnote/goto-previous-reference):
  New test.
2018-06-24 11:25:15 +02:00
Marco Wahl 9553896b11 Merge branch 'keep-text-scale-in-agenda-at-reload' 2018-06-24 09:58:01 +02:00
Marco Wahl a6b4cec691 org-agenda: Refactored. Add test.
* lisp/org-agenda.el (org-agenda-mode): Factored out a function for a
  loop occuring two times.
* testing/lisp/test-org-agenda.el: test the text scale after
  agenda-undo.
2018-06-24 09:52:29 +02:00
Nicolas Goaziou 58b512013e org-clock: Fix `org-clock-display'
* lisp/org-clock.el (org-clock-put-overlay): Do not expand links when
  displaying clocked times.

Reported-by: Sheng Yang (杨圣) <yangsheng6810@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00024.html>
2018-06-23 23:55:01 +02:00
Nicolas Goaziou 8e54cafeb2 Fix noweb expansion during export
* lisp/ob-core.el (org-babel-sha1-hash): Add optional argument to
  specify context.
(org-babel-execute-src-block): Use new argument.
* lisp/ob-exp.el (org-babel-exp-src-block): Use new argument.
(org-babel-exp-results): Fix context.

Reported-by: Ken Mankoff <mankoff@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00117.html>
2018-06-23 23:04:45 +02:00
Marco Wahl d6ebe38e2c Merge branch 'keep-some-local-variables-at-rebuild' into keep-text-scale-in-agenda-at-reload 2018-06-23 20:36:04 +02:00
Nicolas Goaziou 62dd2cc829 Fix regression in tags alignment
* lisp/org.el (org--align-tags-here): Correctly preserve column.
* testing/lisp/test-org.el (test-org/tag-align): Add test.

The regression was introduced in
593058e4a6.

Reported-by: Bernt Hansen <bernt@norang.ca>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00245.html>
2018-06-22 18:49:11 +02:00
Henry Blevins 9c8de985a5 ob-scheme: Fix scheme blocks ignoring :results in formatting
* ob-scheme.el (org-babel-execute:scheme): Process the :result header
argument to conditionally and appropriately format output.

Currently, `org-babel-execute:scheme' ignores the user specified :result header
argument found in the :result-param parameter and process all output as a table.
The fix is to pass the `result' and :result-param to the `org-babel-result-cond'
function to invoke the corresponding formatting.

For example, the following block incorrectly formats its output as a table:

(list 1 2 3)

| 1 | 2 | 3 |

This patch results in the correct behavior:

(list 1 2 3)

: (1 2 3)

Bringing it inline with the result using Emacs lisp:

(list 1 2 3)

: (1 2 3)
2018-06-21 22:00:19 +02:00
Nicolas Goaziou fbd138f527 org-agenda: Fix SPC in agenda
* lisp/org-agenda.el (org-agenda-show-and-scroll-up): Properly display
  drawers when SPC is pressed.  Hide them again with a universal
  prefix argument.

Reported-by: Bernt Hansen <bernt@norang.ca>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00254.html>
2018-06-21 20:25:03 +02:00
Nicolas Goaziou 9b7191001c org-capture: Silence byte-compiler 2018-06-21 18:13:31 +02:00
Nicolas Goaziou 031c53103a org-capture: Fix formulas when capturing rows
* lisp/org-capture.el (org-capture-finalize): Possibly update formula
  when inserting the captured rows in the table.

* testing/lisp/test-org-capture.el (test-org-capture/table-line): Add
  tests.

Reported-by: "Holst Thomas (PS-EC/ESE4)" <Thomas.Holst@de.bosch.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00276.html>
2018-06-21 18:09:40 +02:00
Nicolas Goaziou 547b431e70 org-capture: Fix row insertion in a table with a formula
* lisp/org-capture.el (org-capture-place-table-line): Insert new row
  above the formula, not below.
* testing/lisp/test-org-capture.el (test-org-capture/table-line): Add
  test.
2018-06-21 12:17:07 +02:00
Nicolas Goaziou c891b840d2 org-table: `org-table-fix-formulas-confirm' is not safe.
* lisp/org-table.el (org-table-fix-formulas-confirm): Funcall'ing
  a symbol is never safe, no matter what the symbol is.
2018-06-21 11:48:54 +02:00
Marco Wahl 00c1184a04 org-agenda: Keep local-variables defining text-scale
* lisp/org-agenda.el (org-agenda-mode): Save and restore local
	   variables text-scale-mode-amount, text-scale-mode,
	   text-scale-mode-lighter, face-remapping-alist.  In effect
	   this keeps the text-scale at agenda rebuild and redo.

This commit is predicated on the newsgroup post of Samuel Wales "point
moves and zoom level reverts when refreshing agenda" at Sun, 27 May
2018.
2018-06-20 17:22:52 +02:00
Nicolas Goaziou 460d83831a Silence byte-compiler 2018-06-19 22:53:59 +02:00
Nicolas Goaziou 6c3ce3c17b org-macs: Fix `provide' location 2018-06-19 22:42:11 +02:00
Nicolas Goaziou 7fbb705d13 org-capture: Do not force newline on empty capture templates
* lisp/org-capture.el (org-capture-fill-template): Do not force
  newline on empty capture templates.

Reported-by: xristos <xristos@sdf.org>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00052.html>
2018-06-19 16:38:09 +02:00
Nicolas Goaziou 075e79de4f org-archive: Do not create multiple archive subtrees
* lisp/org-archive.el (org-archive-subtree): Fix regexp.

Reported-by: Bernt Hansen <bernt@norang.ca>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00056.html>
2018-06-19 13:44:38 +02:00
Nicolas Goaziou 9ff77b1e57 org-info: Fix path parsing
* lisp/org-info.el (org-info-follow-link):
(org-info-export): Manual is separated from node name by either "#" or
"::", not ":".
2018-06-19 10:44:56 +02:00
Nicolas Goaziou 593058e4a6 `org-set-tags' modifies buffer only when necessary
* lisp/org.el (org--align-tags-here):
(org-set-tags): Modify buffer only when necessary.

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

Reported-by: Allen Li <darkfeline@felesatra.moe>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00242.html>
2018-06-19 09:40:00 +02:00
Nicolas Goaziou 2e1daf14e0 Update "Version" keyword 2018-06-17 10:25:35 +02:00
Nicolas Goaziou 54abd0f0ea org-capture: Fix last commit
* lisp/org-capture.el (org-capture-fill-template): Properly handle
  allowed values when target sets them.
2018-06-16 23:15:34 +02:00
Christian Schwarzgruber 7fcceecf5d Improve `org-log-reschedule` and `org-log-redeadline' docstrings
* lisp/org.el (org-log-reschedule):
(org-log-redeadline): Improve docstring.

TINYCHANGE
2018-06-16 21:51:37 +02:00
Nicolas Goaziou 42a2c248eb org-capture: Fix completion for properties in capture buffer
* lisp/org.el (org-read-property-value):
* lisp/org-capture.el (org-capture-fill-template): Sidestep
  `org-set-property'.  Use previous function and `org-entry-put'
  instead.

Reported-by: Eric Danan <eric.danan@u-cergy.fr>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00061.html>
2018-06-16 17:03:22 +02:00
stardiviner dcf1796636 ob-shell: Initialize header arguments for other shell names
* lisp/ob-shell.el (org-babel-shell-initialize) Initialize
  org-babel-default-header-args: for shell names.
2018-06-15 22:46:11 +02:00
Nicolas Goaziou b3981d6ad0 Fix `org-metaup' and `org-metadown' on regions
* lisp/org.el (org-metaup): Do not leave a character behind when
  transposing regions.
(org-metadown): Fix "Transposed regions overlap" error.

Reported-by: Adam Porter <adam@alphapapa.net>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00184.html>
2018-06-15 18:52:09 +02:00