0
0
Fork 1
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-07-16 10:16:26 +00:00
Commit graph

11102 commits

Author SHA1 Message Date
Nicolas Goaziou 4c00842e88 Fix `org-toggle-heading'
* lisp/org.el (org-toggle-heading): Avoid adding spurious stars when
  changing a plain list into a subtree.

Reported-by: Rainer Stengele <rainer.stengele@online.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/94223>
2015-02-03 21:39:53 +01:00
Nicolas Goaziou 1d4c79d415 org-agenda: Fix agenda diary corruption
* lisp/org-agenda.el (org-agenda-insert-diary-make-new-entry): Do not
  save excursion or final position is lost.

Reported-by: Gregor Zattler <grfz@gmx.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/94543>
2015-02-02 18:19:30 +01:00
Konubinix 2ebb14d746 Make use of `org-insert-heading' instead of inserting the * character
* lisp/org-agenda.el (org-agenda-insert-diary-as-top-level): Make
  use of `org-insert-heading' instead of inserting the * character

Therefore, the hooks associated to the insertion of a heading will be
triggered.  Since those hooks may cause the creation of some
metadata.  `org-end-of-meta-data' is used afterward.
2015-02-02 13:24:37 +01:00
Nicolas Goaziou b5d9f4be4d org-table: Allow accentuated characters in remote table names
* lisp/org-table.el (org-table-eval-formula): Allow a larger set of
  characters in remote name.

Reported-by: flav <flav.justflav@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/75690>
2015-02-01 01:03:45 +01:00
Sami Airaksinen c90925be29 org.el: org-babel-load-file loads first tangle file
(org-babel-load-file): When org-mode FILE has multiple target files
for tangle blocks, `exported-file' will be set to last found
target file, which might not be the `file'.

Therefore fix for this bug is to select the last element of that
tangled file list, which is the tangle target file of the first found
tangle block, most typically the `file'.

TINYCHANGE
2015-02-01 00:02:21 +01:00
Nicolas Goaziou a752684bf0 org-clock: Fix `org-clock-in-last' with universal argument
* lisp/org-clock.el (org-clock-in-last): `org-clock-in' expects an
  universal argument, not the return value of `org-clock-select-task'.

Reported-by: Peter Münster <pmlists@free.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/94331>
2015-01-31 12:46:50 +01:00
Charles Berry 37fc8667e0 ob-core.el: inline src block removal bugfix
* ob.core.el (org-babel-remove-inline-result): Removing an inline src
  block result removes all whitespace preceding it. The function is
  now `interactive'.

  * ob-core.el (org-babel-insert-result): The call to
  `org-babel-remove-inline-result' preceeds insertion of whitespace
  and setting location of local variable `inlinep'.

  Daniele Pizzolli reported that cleaning a buffer by evaluating
  `org-babel-remove-inline-result' can leave unwanted whitespace.  That
  bug is fixed, and the function is made `interactive'.
2015-01-30 19:27:54 -08:00
Nicolas Goaziou fe63e59faf Small refactoring
* lisp/org.el (org-log-beginning):
* lisp/org-agenda.el (org-agenda-insert-diary-make-new-entry): Small
  refactoring.
2015-01-30 19:41:02 +01:00
Nicolas Goaziou 98a1bc868a Replace `org-end-of-meta-data-and-drawers'
* lisp/org.el (org-end-of-meta-data): New function.
(org-end-of-meta-data-and-drawers): Remove function.

* lisp/org-capture.el (org-capture-place-plain-text): Use new
  function.

* testing/lisp/test-org.el (test-org/end-of-meta-data): New test.

* etc/ORG-NEWS: Document removal.
2015-01-30 19:31:27 +01:00
Kyle Meyer 7834a1ce66 org-agenda: Add only-window setup option
* lisp/org-agenda.el (org-agenda-window-setup, org-agenda-prepare-window):
  Add option to show agenda as the only window in the current frame.
2015-01-30 10:39:53 +01:00
Nicolas Goaziou a1116aa54e Fix `org-agenda-insert-diary-make-new-entry'
* lisp/org-agenda.el (org-agenda-insert-diary-make-new-entry): Ensure
  point is at a real body line and not in front of meta data, so
  regular contents can be inserted safely after a call to this
  function.

Reported-by: Samuel Loury <konubinix@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94482>
2015-01-30 10:23:47 +01:00
Nicolas Goaziou 31e7634779 Fix special properties list
* lisp/org.el (org-special-properties): Add missing "CATEGORY".

* doc/org.texi (Special properties): Remove "NOBLOCKING" as a special
  property, since it can only be set through a properties drawer.
  This is a reserved property.

Reported-by: Samuel Loury <konubinix@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94483>
2015-01-30 09:55:31 +01:00
Nicolas Goaziou 5ae0749e63 ox-html: Do not output "nil" for empty sections
* lisp/ox-html.el (org-html-section): Do not output "nil" when section
  has no contents.

Reported-by: T.F. Torrey <tftorrey@tftorrey.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94464>
2015-01-30 00:31:33 +01:00
Nicolas Goaziou e33637551d ob-core: Silence byte-compiler 2015-01-30 00:24:22 +01:00
Nicolas Goaziou 8ff32ab112 Be more cautious when preserving visibility
* lisp/org-element.el (org-element-swap-A-B):
* lisp/org-list.el (org-list-swap-items):
(org-list-send-item): In order to preserve visibility of moved items
or elements, only consider inner overlays.

Reported-by: Michael Brand <michael.ch.brand@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94320>
2015-01-30 00:20:01 +01:00
Charles Berry 85ff663ce4 lisp/ob-core.el: Inline source block / babel call results are replaceable
* lisp/ob-core.el (org-babel-remove-inline-result): Delete results of
  current inline src block or inline babel call if it is wrapped in a
  "{{{results(.*)}}}" macro call.

* lisp/ob-core.el (org-babel-get-lob-one-liner-matches): Ensure that
  the point ends up on the same line as, and just before, `call_'
  before setting match-data.

* ob-core.el (org-babel-get-inline-src-block-matches): Use
  `org-element-context' and friends to find inline-src-block.  When
  point is in an inline-src-block (including white space determined by
  :post-blank) set match-data and return `t'.

* lisp/ob-core.el (org-babel-insert-result): Delete any `results'
  macro following current inline src block or babel call; insert
  current value in 'results' macro possibly wrapping RESULT in an
  export snippet or inline source block first.  Use of `:results list'
  or `:results table', or use of a multiline RESULT (after stripping a
  trailing newline) or a list RESULT from an inline src block or babel
  call throws an error.
2015-01-29 12:05:31 -08:00
Charles Berry f301ac8e9f ob-exp.el: Enable removal of {{{results(...)}}}
* ob-exp.el (org-babel-exp-do-export): `clean' lambda form removes inline
  results wrapped in `results{{{(' and `)}}}' by calling
  `org-babel-remove-inline-result'.
2015-01-29 12:05:31 -08:00
Charles Berry 638cde3ac9 lisp/ox.el: Enable removable inline src results
* lisp/ox.el: (org-export-as): Treat `results' as an `identity' macro
  with one argument after Babel executes.
2015-01-29 12:05:31 -08:00
Nicolas Goaziou f7a1e23d20 ox-org: Allow custom export for links
* lisp/ox-org.el (org-org-link): New function.

This patch allows to handle `org' export format in EXPORT argument
from `org-add-link-type'.

Suggested-by: John Kitchin <johnrkitchin@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94439>
2015-01-29 19:31:03 +01:00
Nicolas Goaziou a1f54021c9 org-element: Remove :alt-title property for headlines
* lisp/org-element.el (org-element-headline-parser): Remove :alt-title.
* lisp/ox.el (org-export-get-alt-title): Check regular :ALT_TITLE
  property instead of :alt-title.

`:alt-title' is an export-specific property. As a consequence, it's
value doesn't need to be parsed at "org-element.el"'s level. There, it
is treated as a regular property : `ALT_TITLE'.

This also removes the last call to
`org-element-parse-secondary-string' from "org-element.el".
2015-01-28 11:41:39 +01:00
Nicolas Goaziou e1862b5c44 ox-ascii: Fix indentation for description lists with links in tags
* lisp/ox-ascii.el (org-ascii--current-text-width): Compute contents'
  text width according to exported tag instead of original one.

Reported-by: Rasmus <rasmus@gmx.us>
<http://permalink.gmane.org/gmane.emacs.orgmode/94416>
2015-01-28 11:29:43 +01:00
Nicolas Goaziou 98ee739e6d org-element: Avoid `org-element-parse-secondary-string'
* lisp/org-element.el (org-element-headline-parser,
  org-element-inlinetask-parser, org-element-item-parser,
  org-element--collect-affiliated-keywords): Use
  `org-element--parse-objects' instead of
  `org-element-parse-secondary-string' when parsing live objects in
  secondary strings.

`org-element-parse-secondary-string' parses a given string in
a temporary buffer, rendering buffer position related
properties (e.g., :begin) invalid.

Reported-by: John Kitchin <johnrkitchin@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/94397>
2015-01-27 22:25:15 +01:00
Nicolas Goaziou 6617e6dfa9 org-element: Tiny refactoring
* lisp/org-element.el (org-element-headline-interpreter,
  org-element-inlinetask-interpreter): Use format control string
  instead of calling `char-to-string'.
2015-01-27 17:49:22 +01:00
Nicolas Goaziou 6dc26059cb Merge branch 'master' of orgmode.org:org-mode 2015-01-27 15:35:56 +01:00
Rasmus a297692b1c ox-html: Remove extra HTML_HEAD, HTML_HEAD_EXTRA
* ox-html.el (html): Fix typo.
2015-01-27 03:30:43 +01:00
Nicolas Goaziou 96b02fa9a6 org-element: Tiny refactoring
* lisp/org-element.el (org-element-map): Reduce consing and improve
  readability at the price of a tiny code duplication.
2015-01-26 19:45:45 +01:00
Aaron Ecay 076e0ea518 Fix error messages.
* lisp/ob-coq.el (org-babel-coq-initiate-session):
* lisp/ob-latex.el (org-babel-execute:latex):
* lisp/org-macro.el (org-macro-replace-all):
* lisp/org.el (org--get-display-dpi): Fix formatting of error
messages.
2015-01-26 02:53:15 -05:00
Nicolas Goaziou cd6fa4c15e org-element: Optimize `org-element-map'
* lisp/org-element.el (org-element--parsed-properties-alist): New
  variable.
(org-element-map): Remove unnecessary funcalls.  Externalize some
computations in the variable above.
2015-01-25 12:32:03 +01:00
Nicolas Goaziou 61eedb852f ob-core: Fix error messages
* lisp/ob-core.el (org-babel--script-escape-inner,
  org-babel-script-escape): Error messages do not end with a full
  stop.
2015-01-24 23:20:46 +01:00
Nicolas Goaziou b6fce5c90b ox: Prune parse tree before calling tree filter
* lisp/ox.el (org-export-collect-tree-properties): Do not
  set :ignore-list.
(org-export--populate-ignore-list): Remove function.
(org-export--selected-trees): Small refactoring.
(org-export-prune-tree): New function.
(org-export-remove-uninterpreted-data): Fix docstring.
(org-export-as): Prune tree before calling tree filter.

* testing/lisp/test-ox.el (org-test-with-parsed-data): Fix macro.

This patch introduces two changes in the export process:

  1. Non-exported elements are removed from the tree instead of being
     moved into an ignore list (with the exceptions of tables rows
     and cells)

  2. Parse tree filter is called on the tree being exported, not the
     original one.

Reported-by: Eric S Fraga <e.fraga@ucl.ac.uk>
<http://permalink.gmane.org/gmane.emacs.orgmode/94162>
2015-01-23 23:59:23 +01:00
Aaron Ecay 3996de60da ob-R: Convert some defvars to defconsts.
* lisp/ob-R.el (org-babel-R-eoe-indicator):
(org-babel-R-eoe-output): Convert from defvar to defconst.
(org-babel-R-write-object-command): Convert from defvar to defconst.
Add line breaks and indentation.
2015-01-23 14:39:30 -05:00
Aaron Ecay fa5fd63516 babel: fix up org-babel-script-escape
* lisp/ob-core.el (org-babel--script-escape-inner): New function.
(org-babel-script-escape): Use it.
* testing/lisp/test-ob.el (test-org-babel/script-escape): New test.
2015-01-23 14:36:40 -05:00
Aaron Ecay d067982b59 babel: Remove functions which are just indirection around org-babel-script-escape
* lisp/ob-groovy.el (org-babel-groovy-table-or-string): Remove.
(org-babel-groovy-evaluate): Call `org-babel-script-escape' instead.
* lisp/ob-haskell.el (org-babel-haskell-table-or-string): Remove.
(org-babel-execute:haskell): Call `org-babel-script-escape' instead.
* lisp/ob-io.el (org-babel-io-table-or-string): Remove.
(org-babel-io-evaluate):Call `org-babel-script-escape' instead.
* lisp/ob-scala.el (org-babel-scala-table-or-string): Remove.
(org-babel-scala-evaluate): Call `org-babel-script-escape' instead.
2015-01-23 14:36:40 -05:00
Aaron Ecay c4f34a69b5 babel: Remove functions which are never called.
* lisp/ob-awk.el (org-babel-awk-table-or-string):
* lisp/ob-shell.el (org-babel-sh-table-or-results): Remove.
2015-01-23 14:36:40 -05:00
Nicolas Goaziou 53592f4e25 org-table: Fix typo
* lisp/org-table.el (org-table-show-reference): Fix typo.
2015-01-23 00:16:58 +01:00
Aaron Ecay a0095ce1a7 ob-python: Convert two defvars to defconsts.
* lisp/ob-python.el (org-babel-python-wrapper-method):
(org-babel-python-pp-wrapper-method): Convert from defvar to defconst.
2015-01-22 01:55:23 -05:00
Aaron Ecay 9f75cea40d Obsolete ‘org-at-regexp-p’.
* lisp/org.el (org-at-regexp-p): Remove, adding an obsolete function
alias.
(org-in-regexp): Tidy docstring.
(org-open-at-point):
(org-between-regexps-p):
* lisp/org-table.el (org-table-fedit-shift-reference):
(org-table-show-reference): Call ‘org-in-regexp’ instead.
2015-01-22 01:52:49 -05:00
Aaron Ecay caad78ca8a babel: Fix bug in ‘org-babel-lob-get-info’.
* lisp/ob-lob.el (org-babel-lob-get-info): Use `save-match-data'.

Callers rely on the match data being set to
‘org-babel-lob-one-liner-regexp’.
2015-01-22 00:47:48 -05:00
Aaron Ecay d45b5a7884 babel: Fix bug in org-babel-get-inline-src-block-matches.
* lisp/ob-core.el (org-babel-get-inline-src-block-matches): Use
`org-looking-at-p' instead of `thing-at-point'.

The latter could give odd results depending on the syntax table.  In
particular, for me (thing-at-point 'word) was returning src_foo in
this context.
2015-01-22 00:44:42 -05:00
Nicolas Goaziou f15b17688c ox: Fix docstrings
* lisp/ox.el (org-export-dictionary, org-export-translate): Fix spaces
  at the end of sentences.  Do not upcase `car' and `cdr'.
2015-01-22 00:23:06 +01:00
Nicolas Goaziou 6b450ce81c ox: Remove `org-export-ignore-element'
* lisp/ox.el (org-export-ignore-element): Remove function.
(org-export-collect-tree-properties): Do not assume users can
modify :ignore-list export property.

* testing/lisp/test-ox.el (test-org-export/user-ignore-list): Remove
  test.

:ignore-property is an implementation detail, which should not be
exposed to users.  Also, it is easier to simply remove the element to
ignore from the parse tree with `org-element-extract-element'.
2015-01-22 00:11:35 +01:00
Nicolas Goaziou cf77de2c3a Fix docstrings
* lisp/org.el (org-next-visible-heading,
  org-previous-visible-heading): Shorten summary.  Fix typo.
2015-01-21 23:44:21 +01:00
Aaron Ecay 9348b5f1b0 Add new functions to move to the next/prev headline skipping inline tasks.
* lisp/org.el (org-next-visible-heading):
(org-previous-visible-heading): New functions.
(org-speed-commands-default, org-mode-map): Use them.
2015-01-20 18:55:07 -05:00
Aaron Ecay 37e0fd2318 ob-asymptote, ob-emacs-lisp: remove spurious declare-function calls.
* lisp/ob-asymptote.el:
* lisp/ob-emacs-lisp.el: Remove spurious `declare-function's.
2015-01-20 18:42:56 -05:00
Nicolas Goaziou ec0706ea40 macro: Implement argument extracting and escaping functions
* lisp/org-macro.el (org-macro-escape-arguments,
  org-macro-extract-arguments): New functions.

* lisp/org-element.el (org-element-macro-parser): Use new function.

* testing/lisp/test-org-macro.el (test-org-macro/escape-arguments,
  test-org-macro/extract-arguments): New tests.
2015-01-21 00:27:24 +01:00
Nicolas Goaziou 9fc8e3c0fa `org-open-link' follows timestamps in properties
* lisp/org.el (org-open-at-point): Follow timestamps in properties
  drawers.  Refactor.

Suggested-by: Marco Wahl <marcowahlsoft@gmail.com>
2015-01-20 21:42:12 +01:00
Aaron Ecay d34b804a6f org: Calculate dpi directly.
* lisp/org.el (org--get-display-dpi): New function.
(org-create-formula-image-with-dvipng):
(org-create-formula-image-with-imagemagick): Use it.

The previous method tried to calculate the display dpi from the font
height, but this is wonky and not necessary, since it can be
calculated directly.
2015-01-19 00:34:56 -05:00
Aaron Ecay 05ac7b37a4 org.el: org-toggle-inline-images: Only display messsages when interactive.
* lisp/org.el (org-toggle-inline-images): Only message if
called-interactively-p.

The old code made a halfhearted attempt to do this; this patch
provides the other half of the heart.
2015-01-19 00:16:51 -05:00
Aaron Ecay b3712b9840 ob-ocaml: Add a cautionary comment about dodgy regex use.
* lisp/ob-ocaml.el (org-babel-ocaml-read-list): Add comment
2015-01-18 23:47:36 -05:00
Aaron Ecay f1dcbfe79c org-footnote: Use a simpler method to generate random labels.
* lisp/org-footnote.el (org-footnote-new): Improve generation of
random labels.
2015-01-18 23:46:02 -05:00