Commit Graph

3766 Commits

Author SHA1 Message Date
Nicolas Goaziou 54318add34 Change export block syntax
* lisp/org-element.el (org-element-export-block-parser):
(org-element--current-element): Use new syntax for export blocks.
(org-element-block-name-alist): Remove.

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

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

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

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

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

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

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

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

  #+BEGIN_EXPORT backend
  ...
  #+END_EXPORT

instead of

  #+BEGIN_backend
  ...
  #+END_backend

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

  #+INCLUDE: "file.org" HTML

becomes

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Changes in contrib:

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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