Commit graph

14694 commits

Author SHA1 Message Date
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
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
Nicolas Goaziou 1704a25b98 org-tempo: Fix docstring
* lisp/org-tempo.el (org-tempo-keywords-alist): Fix docstring.
2018-06-14 16:39:28 +02:00
Nicolas Goaziou 956a5a4cb1 Ignore inlinetasks in `org-before-first-heading-p'
* lisp/org.el (org-before-first-heading-p): Ignore inlinetasks.
2018-06-13 22:20:27 +02:00
Nicolas Goaziou f50f373389 Add facility for commit log messages from Org documents
* lisp/org-compat.el (org-add-log-current-headline): New function.
* lisp/org.el (org-mode): Use new function.
2018-06-13 22:15:56 +02:00
Nicolas Goaziou 3f26c9bd2e `org-get-heading' returns nil instead of erroring out
* lisp/org.el (org-get-heading): Return nil instead of throwing an
  error before first headline.
2018-06-13 22:15:17 +02:00
Nicolas Goaziou f440ff0a6a Fix imenu compatibility with non-contiguous structure
* lisp/org.el (org-mode): Move imenu compatibility to "org-compat.el".
* lisp/org-compat.el (org-imenu-new-marker): Remove function.
(org-imenu-get-tree): Handle non-contiguous structure.

Reported-by: Thibault Polge <thibault@thb.lt>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00088.html>
2018-06-13 01:13:16 +02:00
Nicolas Goaziou 3745c0af9f Fix indentation when wrapping a block around a region
* lisp/org.el (org-insert-structure-template): Indent like the first
  line, not the line the point happens to be on.

Reported-by: stardiviner <numbchild@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00107.html>
2018-06-12 09:03:33 +02:00
Marco Wahl 842002f9f7 org-archive: Fix insert of extra blank line at archiving
* lisp/org-archive.el (org-archive-subtree): Remove insertion of extra
  blank line in case of org-archive-reversed-order.
2018-06-07 15:52:26 +02:00
Marco Wahl 13a09b3ba5 Merge branch 'maint' 2018-06-06 16:05:26 +02:00
Marco Wahl 2b76aebfc6 org-element: Fix interpretation as todo kwd when prefix of headline
* lisp/org-element.el (org-element-headline-parser): Check for space
  after todo-kwd.
* testing/lisp/test-org-element.el (test-org-element/headline-todo-keyword):
  Respective tests.
2018-06-06 15:58:20 +02:00
Nicolas Goaziou 8b9c1e15df ob-tangle: Fix `org-babel-detangle'
* lisp/ob-tangle.el (org-babel-tangle-jump-to-org): Preserve position
  in source block only if it doesn't put point outside of the block.

Reported-by: Frederick Giasson <fred@curbside.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-06/msg00008.html>
2018-06-05 11:55:55 +02:00
Nicolas Goaziou ed7d1dc6d7 Fix quirks in `org-insert-structure-template'
* lisp/org.el (org-insert-structure-template): Fix some issues.
  Refactor code.
* testing/lisp/test-org.el (test-org/insert-structure-template):
  Update tests.

Reported-by: stardiviner <numbchild@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00553.html>
2018-06-02 23:41:56 +02:00
Nicolas Goaziou 97fac41194 Revert "ob-C: Provide ob-C++' and ob-D'"
This reverts commit f35994b314.
2018-05-30 12:57:21 +02:00
Rasmus 7ac46c52b7 Check format of org-structure-template-alist
* org.el (org--check-org-structure-template-alist): New function
  yielding user-error if using old org-structure-template-alist
  format.
  (org--insert-structure-template-mks):
* org-tempo.el (org-tempo-add-templates): Use new function
2018-05-28 23:44:51 +02:00
Nicolas Goaziou dac180ea0d org-footnote: Improve :safe values
* lisp/org-footnote.el (org-footnote-auto-label):
(org-footnote-auto-adjust): Use simpler :safe value.

The point of the :safe value is to determine if the variable is safe,
not to check correctness of its value. Besides, lambda functions
appear as the following in *Help* buffer:

  This variable is safe as a file local variable if its value
  satisfies the predicate which is a byte-compiled expression.

which is not particularly clear.  Let's keep :safe values simple.
2018-05-28 21:18:28 +02:00
Aaron Ecay c32938b7fd Revert "Un-fontlock sub/superscripts when point enters them"
This reverts commit 102832e66f.

See <https://lists.gnu.org/archive/cgi-bin/namazu.cgi?query=%2Bmessage-id%3A%3C87y3g43mjy.fsf%40nicolasgoaziou.fr%3E&submit=Search&idxname=emacs-orgmode>
2018-05-27 21:29:57 +01:00
Nicolas Goaziou f35994b314 ob-C: Provide ob-C++' and ob-D'
Reported-by: Van L <van@scratch.space>
<http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00492.html>
2018-05-27 22:21:15 +02:00
Nicolas Goaziou c698c8e959 Fix tags completion
* lisp/org.el (org-tags-completion-function): Refactor function. Fix
  tag completion.

Reported-by: Alain.Cochard@unistra.fr
<http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00450.html>
2018-05-27 22:13:00 +02:00
Nicolas Goaziou 2086ea42cf org-footnote: Tiny refactoring
* lisp/org-footnote.el (org-footnote-section): Tiny refactoring.
2018-05-27 21:59:19 +02:00
Aaron Ecay c56bb9d59a org-footnote: add :safe properties to the defcustoms 2018-05-27 17:33:44 +01:00
Aaron Ecay 102832e66f Un-fontlock sub/superscripts when point enters them
* lisp/org.el (org-remove-font-lock-display-properties): Rename to
‘org-remove-font-lock-display-properties’.  It is a more
specific/accurate name.
(org-match-substring-with-braces-regexp):
(org-match-substring-regexp): Add a note to docstrings about what the
match groups are.
(org-raise-scripts--post-command-hook): New function, modeled on
‘prettify-symbols--post-command-hook’.
(org-raise-scripts): Use the above.

Inspired by
<https://lists.gnu.org/archive/cgi-bin/namazu.cgi?query=%2Bmessage-id%3A%3C518DCC34-E435-42F7-A15E-FAE7727033F8%40scratch.space%3E&submit=Search&idxname=emacs-orgmode>
2018-05-27 17:13:59 +01:00
Aaron Ecay 5192e810ae Add “summary” to ‘org-html-html5-elements’
* lisp/ox-html.el (org-html-html5-elements): Add “summary”

As suggested by Kaushal Modi in
<https://lists.gnu.org/archive/cgi-bin/namazu.cgi?query=%2Bmessage-id%3A%3CCAFyQvY2YoLDpM9PWLV86FwvPOVkuxg9O8KdryG3z%3D5QRm7Aujg%40mail.gmail.com%3E&submit=Search&idxname=emacs-orgmode>
2018-05-27 16:59:15 +01:00
Aaron Ecay 1117d65622 org.el: remove trailing whitespace 2018-05-27 16:58:39 +01:00
Nicolas Goaziou 2c5a8740ad Remove spurious colon in tags view
* lisp/org.el (org-scan-tags): Remove spurious colon in tags view.
  Small refactoring.

The regression was introduced in
be31a0c459.

Reported-by: Rainer Stengele <rainer.stengele@online.de>
<http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00478.html>
2018-05-26 12:30:46 +02:00
Nicolas Goaziou 2918894f36 org-table: Tiny refactoring
* lisp/org-table.el (org-table-get-formula): Tiny refactoring.
(org-table-get-stored-formulas): Fix string.
2018-05-22 10:46:57 +02:00
Nicolas Goaziou 9d51a8b5a0 org-capture: Fix table line capture with custom location
* lisp/org-capture.el (org-capture-place-table-line): Fix error when
  a precise location is given, e.g. with `file+function' target.

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

Reported-by: Thomas Holst <thomas_holst@gmx.de>
<http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00359.html>
2018-05-17 22:57:49 +02:00
Nicolas Goaziou 1cfd5d04e3 Fix a docstring
* lisp/org.el (org-store-link): Use "link" instead of puzzling
  "org-link".
2018-05-17 16:55:31 +02:00
Nicolas Goaziou 463664bdd0 Merge branch 'maint' 2018-05-16 22:07:33 +02:00
Nicolas Goaziou 2b26644b3a Fix `org-skip-over-state-notes'
* lisp/org.el (org-skip-over-state-notes): Allow empty TODO states.

Reported-by: Michael Brand <michael.ch.brand@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00337.html>
2018-05-16 22:06:39 +02:00
Nicolas Goaziou c46fcd9874 org-lint: Add checker for spurious colons in tags
* lisp/org-lint.el (org-lint--checkers): Add checker.
(org-lint-spurious-colons): New function.
* testing/lisp/test-org-lint.el (test-org/spurious-colons): New test.
2018-05-14 17:41:04 +02:00
Nicolas Goaziou 7143ae0355 Fix typo
* lisp/org.el (org-tag-alist): Fix typo in docstring.
2018-05-14 15:38:05 +02:00
Nicolas Goaziou ac21151c4a Fix typo in docstring
* lisp/org.el (org-tag-persistent-alist): Fix typo.

Reported-by: Bernt Hansen <bernt@norang.ca>
<http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00293.html>
2018-05-13 22:36:09 +02:00
Nicolas Goaziou 640e05523a org-agenda: Fix the last fix...
* lisp/org-agenda.el (org-tags-view): Fix last commit.
2018-05-11 21:55:23 +02:00
Nicolas Goaziou 68b376dee0 org-agenda: Fix "org-agenda: one-armed “if” -> “when”"
* lisp/org-agenda.el (org-tags-view): Re-instate delete `else' part.

Reported-by: Bernt Hansen <bernt@norang.ca>
<http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00286.html>
2018-05-11 21:49:25 +02:00
Nicolas Goaziou 92b03d161a ox-texinfo: Change sentence ending
* lisp/ox-texinfo.el (org-texinfo-plain-text): Sentences can end with
  a capital letter without a special symbol in Org.

It is simpler to provide a non-breaking space when a capital letter
followed by a period should not end than providing a way to force
ending a sentence.
2018-05-11 19:40:10 +02:00
Nicolas Goaziou 13fb6a3fae Move obsolete declarations into "org-compat.el" 2018-05-10 15:41:50 +02:00
Aaron Ecay 7106eab974 Many small code improvements
* lisp/org-capture.el (org-capture-member): Make obsolete; the old
definition was identical to ‘org-capture-get’ anyway.
(org-capture-mode-map): Move the calls to ‘define-key’ up to where the
variable is defined.
(org-capture-mode-hook): Small docstring tweak.
(org-capture-mode): Fix typo in mode lighter.
(org-capture-set-target-location, org-capture-place-item):
(org-capture-place-plain-text, org-capture-narrow):
(org-capture-empty-lines-after):
(org-capture-import-remember-templates): ‘if’ without else -> ‘when’
* lisp/org-colview.el (org-columns-edit-value): Change an error to a
user-error.
(org-columns-uncompile-format): Improve docstring.
* lisp/org-compat.el (org-remove-from-invisibility-spec): Make
obsolete, the underlying emacs function exists since 1997, commit 31aa282e.
(org-in-invisibility-spec-p, org-count-lines): ‘if’ without else -> ‘when’.
* lisp/org-element.el (org-element-swap-A-B):
* lisp/org-entities.el (org-entities-create-table):
* lisp/org-list.el (org-insert-item):
* lisp/org-macs.el (org-with-point-at, org-base-buffer):
(org-preserve-local-variables, org-overlay-display):
(org-overlay-before-string): ‘if’ without else -> ‘when’.
* lisp/org-eshell.el (org-eshell-open): Fix docstring typo.
* lisp/org-pcomplete.el (pcomplete/org-mode/file-option/language):
(pcomplete/org-mode/file-option/startup):
(pcomplete/org-mode/file-option/options):
(pcomplete/org-mode/file-option/infojs_opt):
(pcomplete/org-mode/link, pcomplete/org-mode/tex):
(pcomplete/org-mode/todo, pcomplete/org-mode/searchhead):
(pcomplete/org-mode/tag, pcomplete/org-mode/prop): Avoid the formerly
misspelled ‘pcomplete-uniqify-list’ function.  It has a defalias in
emacs >= 27; we add our own for older emacsen.
(pcomplete/org-mode/file-option/bind): ‘if’ without else -> ‘when’.
* lisp/org-protocol.el (org-protocol-capture):
(org-protocol-convert-query-to-plist): ‘if’ without else -> ‘when’.
(org-protocol-do-capture): Pacify byte compiler, simplify conditional
logic.
* lisp/org-table.el (org-table-create-with-table.el): Simplify conditional
logic.
(org-table-create, org-table-convert-region, org-table-next-field):
(org-table-beginning-of-field, org-table-end-of-field):
* lisp/org-w3m.el (org-w3m-copy-for-org-mode): ‘if’ without else ->
‘when’.
* lisp/org.el (org-babel-do-load-languages, org-previous-link):
(org-refile): Use ‘(foo ...)’ instead of ‘(funcall 'foo ...)’.
(org-add-log-note): Convert a long cond into a cl-case.
(org-priority): Improve docstring, show a deprecation warning if the
‘show’ argument is passed (which was previously silently ignored).
Also, use ?\s instead of ?\ as a character literal for space.
(org-fast-tag-insert): Fix docstring typo.
(org-fill-element): ‘if’ without else -> ‘when’.
(org-on-target-p): Remove ancient compatibility alias.
2018-05-10 04:22:30 +01:00