Commit Graph

16597 Commits

Author SHA1 Message Date
Nicolas Goaziou 9eff31aada `org-edit-special' edits export blocks
* lisp/org.el (org-edit-special): Allow to edit export blocks.
* etc/ORG-NEWS: Document feature.
2014-11-24 00:14:13 +01:00
Nicolas Goaziou bde27ccacc org-src: Fix docstring
* lisp/org-src.el (org-src-ask-before-returning-to-edit-buffer): Fix
  docstring.  Move variable in appropriate section.
2014-11-24 00:07:39 +01:00
Nicolas Goaziou 367827f005 Fix failing test
* lisp/org.el (org-indent-region): Fix failing test.
2014-11-24 00:07:39 +01:00
Nicolas Goaziou 203bf5870f org-src: Unify source editing tools
* lisp/org-src.el (org-src-strip-leading-and-trailing-blanklines,
  org-edit-src-force-single-line, org-edit-src-picture,
  org-edit-src-from-org-mode, org-edit-src-allow-write-back-p,
  org-edit-src-beg-marker, org-edit-src-end-marker,
  org-edit-src-overlay, org-edit-src-block-indentation,
  org-edit-src-saved-temp-window-config, org-edit-src-code-timer):
  Remove variables.
(org-src--allow-write-back-p, org-src--beg-marker,
org-src--block-indentation, org-src--code-timer, org-src--end-marker,
org-src--end-marker, org-src--from-org-mode, org-src--overlay,
org-src--saved-temp-window-config, org-src--type,
org-src--babel-info): New variables.

(org-src--construct-edit-buffer-name, org-src--edit-buffer,
org-src--source-buffer, org-src--get-lang-mode, org-src--coordinates,
org-src--goto-coordinates, org-src--element-contents-area,
org-src--make-source-overlay, org-src--on-element-p,
org-src--contents-for-write-back, org-src--edit-element,
org-edit-table.el, org-edit-export-block): New functions.
(org-edit-src-find-buffer, org-src-construct-edit-buffer-name,
org-src-tangle, org-src-in-org-buffer): Remove functions.

(org-edit-src-code, org-edit-fixed-width-region, org-edit-src-abort,
org-edit-src-save): Use new functions and variables.
(org-edit-src-exit): Use new functions and variables.  Change
signature.

* lisp/org.el (org-edit-special, org-indent-line, org-indent-region):
  Use new functions and variables.

* lisp/ob-core.el (org-babel-do-in-edit-buffer): Remove useless check.
(org-babel-expand-src-block): Apply signature change.

This patches resolves discrepancies between source editing tools and
globally simplifies process (auto-save feature, region
preservation...).  It introduces export block editing.  It also moves
internal variables and functions into an appropriate namespace and
delete some unused functions.
2014-11-24 00:07:39 +01:00
Nicolas Goaziou 9c06f8cce9 org-src: Remove unused functions and variables
* lisp/org-src.el (org-edit-src-region-extra): Remove variable.
(org-edit-src-find-region-and-lang, org-edit-src-get-lang,
org-edit-src-get-label-format, org-edit-src-get-indentation,
org-src-fontify-block, org-src-fontify-buffer): Remove functions.

(org-src-font-lock-fontify-block): Remove reference to removed
function in docstring.

Remove all functions and variables related to parsing, which is now
delegated to org-element.el.  Also reorder a defcustom and
a declaration in the library.
2014-11-22 20:59:08 +01:00
Nicolas Goaziou 3953cb19b4 Merge branch 'maint' 2014-11-22 00:04:51 +01:00
Peter Moresi aa65ac35aa ob-js: Fix passing multiline variables
* lisp/ob-js.el (org-babel-js-var-to-js): Replace newline characters
  with "\n" in strings.

Let's say I have a multi-line string stored in an example block.

I want to store my CSV in an example block.

  ColA,ColB,ColC
  1,2,3
  4,5,6

I have a JavaScript function that accepts a string named 'csv' and passing in 'my-csv-data'.

  console.log(csv);

When I expand the source block I end up with:

var csv="ColA,ColB,ColC
  1,2,3
  4,5,6";
console.log(csv);

This will not execute correctly because JavaScript does not support newlines in strings.

What I want instead is:

  var csv="ColA,ColB,ColC\n  1,2,3\n  4,5,6";
  console.log(csv);

TINYCHANGE
2014-11-22 00:02:00 +01:00
Nicolas Goaziou 40f2b885f6 Open outer link on nested links
* lisp/org.el (org-open-at-point): Open outer link on nested links.

* testing/lisp/test-org.el (test-org/open-at-point/inline-image): New
  test.

Suggested-by: Daniel Bausch <bausch@dvs.tu-darmstadt.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/92796>
2014-11-20 23:35:28 +01:00
rasmus 0e52f02f2c org-entities.el: Add parallel symbol
* org-entities.el (org-entities): Add parallel symbol.

From patch proposal by Brady Trainor.

TINYCHANGE
2014-11-19 14:50:21 +01:00
Nicolas Goaziou 78773315ee Merge branch 'maint' 2014-11-18 19:46:44 +01:00
Nicolas Goaziou 4f31b68e8f org-element: Fix 'search failed ":"' error
* lisp/org-element.el (org-element-context): Fix 'search failed ":"'
  error when point is on a blank line after a keyword.

* testing/lisp/test-org-element.el (test-org-element/context): Add
  tests.
2014-11-18 19:44:46 +01:00
Nicolas Goaziou 4df091b431 Tiny refactoring
* lisp/org.el (org-entry-properties): Tiny refactoring.
2014-11-18 10:43:50 +01:00
Nicolas Goaziou 3e13ffdfb6 Fix CATEGORY property retrieval
* lisp/org.el (org-entry-properties): Fix returned CATEGORY property
  when no specific keyword is provided.

* testing/lisp/test-org.el (test-org/entry-properties): Add test.
2014-11-18 10:27:45 +01:00
Nicolas Goaziou 4375a941cc Fix SCHEDULED property retrieval
* lisp/org.el (org-entry-properties): Fix storing SCHEDULED property
  when specific argument is not specified.

* testing/lisp/test-org.el (test-org/entry-properties): Add test.

Reported-by: Richard Lawrence <richard.lawrence@berkeley.edu>
<http://permalink.gmane.org/gmane.emacs.orgmode/92728>
2014-11-18 10:27:36 +01:00
Nicolas Goaziou 1dfa77dee4 Fix order of TODO keywords with S-right
* lisp/org.el (org-set-regexps-and-options): Fix order of TODO
  keywords with S-right.

Thanks to Sébastien Vauban for reporting it.
<http://permalink.gmane.org/gmane.emacs.orgmode/92708>
2014-11-17 17:41:31 +01:00
Nicolas Goaziou 919722a6a6 ox-latex: Do not message "PDF file produced" for fragments
* lisp/ox-latex.el (org-latex-compile): Do not message "PDF file
  produced" for fragments.
2014-11-16 17:58:11 +01:00
Nicolas Goaziou 6b3aa71061 Fix `org-indent-line' on blank lines after a paragraph
* lisp/org.el (org--get-expected-indentation): Properly compute
  expected indentation on blank lines after a paragraph.
(org-indent-line): Update docstring.

* testing/lisp/test-org.el (test-org/indent-line): Add test.
2014-11-16 17:39:04 +01:00
Nicolas Goaziou 1452b15235 org-element: Fix docstring
* lisp/org-element.el (org-element-lineage): Fix docstring.
2014-11-16 16:49:18 +01:00
Nicolas Goaziou 409560b7f8 Merge branch 'maint' 2014-11-16 15:51:13 +01:00
Nicolas Goaziou 59111b77ef Fix `org-insert-heading'
* lisp/org.el (org-insert-heading): Fix some corner case when point is
  in an invisible list.

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

Reported-by: Luke Crook <luke@balooga.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/92619>
2014-11-16 15:48:58 +01:00
Nicolas Goaziou f74cc9c4fb ORG-NEWS: Document `org-element-lineage' 2014-11-16 14:09:00 +01:00
Nicolas Goaziou a7e62499f2 Fix `org-return'
* lisp/org.el (org-return): Avoid false positives in function.

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

Thanks to Sébastien Vauban for reporting it.

<http://permalink.gmane.org/gmane.emacs.orgmode/92657>
2014-11-16 14:02:13 +01:00
Nicolas Goaziou 61ba40c371 ox: Deprecate `org-export-get-genealogy' for `org-element-lineage'
* lisp/ox.el (org-export-collect-tree-properties,
  org-export-numbered-headline-p, org-export-get-tags,
  org-export-resolve-fuzzy-link, org-export-get-ordinal,
  org-export-get-parent-headline, org-export-get-parent-element,
  org-export-get-parent-table):

* lisp/ox-ascii.el (org-ascii--current-text-width):

* lisp/ox-beamer.el (org-beamer--frame-level):

* lisp/ox-icalendar.el (org-icalendar-blocked-headline-p):

* lisp/ox-latex.el (org-latex-footnote-reference):

* lisp/ox-odt.el (org-odt--enumerate, org-odt-link--infer-description,
  org-odt-table): Use `org-element-lineage' instead of
  `org-export-get-genealogy'.
2014-11-16 13:30:33 +01:00
Nicolas Goaziou 182d61fc8f org-element: Implement `org-element-lineage'
* lisp/org-element.el (org-element-lineage): New function.

* testing/lisp/test-org-element.el (test-org-element/lineage): New
  test.
2014-11-16 13:30:33 +01:00
Nicolas Goaziou 4c4f91800e org-info: Throw an error when following an info link fails
* lisp/org-info.el (org-info-follow-link): Throw an error instead of
  a message when search fails.
2014-11-16 00:18:24 +01:00
Kim 96e1971f0f org-info: Try info index if info node is not found
* lisp/org-info.el (org-info-follow-link): Attempt index lookup if node
  lookup fails.

* doc/org.texi (External links): Update info links.

Info index is almost always finer grain than info nodes.  For example
with this change, [[info:libc#close]] brings up not only
"(libc)Opening and Closing Files" info node, but also place the cursor
on the line that documents "close" function within the node.  This is
done by looking up "close"in the index upon failing to find a node
named "close".  Hence one can now link function, variable and other
names that are in the index rather than being limited to info node
names.  Typically there are far more index items than there are node
names.  For example libc manual has about 700 nodes, but over 4000
concept, type, function, and variables index items.  More examples of
new ways to create links are shown using org.info as example

- [[info:org#org-clock-idle-time]] uses "Variable Index"
- [[info:org#org-capture]] uses "Command and Function Index".
- [[info:org#timestamp]] uses "Main Index"
- [[info:org#C-c C-c]] uses "Key Index"

TINYCHANGE
2014-11-16 00:14:29 +01:00
Nicolas Goaziou 4670b0420c Merge branch 'maint' 2014-11-16 00:10:08 +01:00
Florian Beck 685d3ba4af Replace obsolete aliases of calendar functions
* lisp/org-agenda.el (org-agenda-diary-entry): Replace obsolete functions.
2014-11-16 00:09:37 +01:00
Nicolas Goaziou e4195fa7db ORG-NEWS: Document read date change 2014-11-13 21:49:03 +01:00
Teika kazura acdbc34995 Let `org-read-date' respect `org-replace-disputed-keys' again
* lisp/org.el (org-read-date): Respect `org-replace-disputed-keys'.

Beginning from org-8.1, org-read-date ignores
`org-replace-disputed-keys'.  This commit restores the original
behavior.  Users who want the org-8.1 behavior should customize
`org-read-date-minibuffer-local-map' instead.

See http://thread.gmane.org/gmane.emacs.orgmode/90626/focus=91318 for
the discussion on this issue.

This commit in effect reverts a6986494a0
and e8023dde58.

TINYCHANGE
2014-11-13 21:40:19 +01:00
Łukasz Gruner 43ca1f649d fix org-eldoc path 2014-11-11 21:52:01 +01:00
Nicolas Goaziou 83d8a2b16d Fix cba2f0a
* lisp/org.el (org-adapt-indentation): Update docstring.
(org-fixup-indentation): Ignore contents of source blocks and example
blocks when indentation should be preserved.

* testing/lisp/test-org.el (test-org/demote, test-org/promote): Add
  tests.
2014-11-10 20:40:03 +01:00
Nicolas Goaziou ece68a7a6f org-colview: Use regular "ITEM" property
* lisp/org-colview.el (org-columns-display-here): Use regular "ITEM"
  value instead of computing another one.  Simplify process.
  (org-columns-cleanup-item): Remove function.

* contrib/lisp/org-colview-xemacs.el (org-columns-display-here): Use
  regular "ITEM" value instead of computing another one.  Simplify
  process.  (org-columns-cleanup-item): Remove function.

* etc/ORG-NEWS: Document change.
2014-11-10 16:51:33 +01:00
Nicolas Goaziou 9309fd5d20 Add "ITEM" to special properties
* lisp/org.el (org-special-properties): Add "ITEM".  Tiny fix to
  docstring.
(org-entry-properties): Compute "ITEM" property's value.
(org-buffer-property-keys): Remove hack since "ITEM" now officially
belongs to the special properties list.

* doc/org.texi (Special properties): Document "ITEM" change.

* testing/lisp/test-org.el (test-org/entry-properties): Add test.
2014-11-10 16:45:36 +01:00
Nicolas Goaziou d2e78d2505 org.texi: Remove "ID" as a special property
* doc/org.texi (Special properties): Remove "ID" as a special
  property.  Sort list.

Special properties cannot be set only using properties located in
a properties drawer.  "ID" is always set through a properties drawer.
It is more a reserved property than a special one.
2014-11-10 11:07:22 +01:00
Nicolas Goaziou 7af7edc505 Tags completion ignores narrowing
* lisp/org.el (org-get-buffer-tags): Ignore narrowing, if any.  Small
  refactoring.
2014-11-10 09:43:01 +01:00
Nicolas Goaziou 34bbb39454 Fix parser wrt to defcustom syntax related changes
* lisp/org-element.el (org-element-paragraph-separate,
  org-element--object-regexp): Turn defconst into defvar.
(org-element--set-regexps): Properly set previous variables.
(org-element-update-syntax): New function.

* lisp/org-list.el (org-plain-list-ordered-item-terminator,
  org-list-allow-alphabetical): Call new function whenever these
  variables are modified and Org is already loaded.

* lisp/org.el (org-add-link-type): Call new function since a new link
  type triggers a rebuild of syntax regexps, possibly invalidating
  cache in all Org buffers.

Reported-by: Christopher Dannheim <ch.dannheim@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/92487>
2014-11-10 00:08:44 +01:00
Paul Sexton a95cfebbc3 Updated org-drill to latest version, 2.4.3. 2014-11-09 14:06:03 +13:00
Nicolas Goaziou 3f78abf0b0 Merge branch 'maint' 2014-11-08 21:40:59 +01:00
Mario Frasca 4c37a937a7 org-plot: Correction in callback registration
org-plot.el (org-plot/gnuplot): Correct the callback for the and
register it as soon as possible.

The data-file variable is not in the scope of the callback, one needs
to grab its value while registering the callback.  With this patch the
timer is set as soon as the file is created.  Without this patch the
timer is set at the end of a let-block, if anything goes wrong in the
let-block before the timer is set, the file will not be removed.

TINYCHANGE
2014-11-08 21:38:52 +01:00
Mario Frasca 9f28685b29 org-plot: Reset gnuplot process instead of killing it
org-plot.el (org-plot/gnuplot): Do not kill the gnuplot process. just
jump to end of buffer and rely on command to do the resetting job.

Without this patch, the gnuplot process associated to the gnuplot
buffer is killed before each batch of instructions from orgmode to
gnuplot.  With or without this patch, Org mode sends a reset
instruction to the gnuplot process as first instruction.

TINYCHANGE
2014-11-08 21:37:15 +01:00
Nicolas Goaziou cba2f0a2a3 Improve `org-promote' and `org-demote'
* lisp/org.el (org-promote, org-demote): Fix docstring.  Small
  refactoring.  Ignore narrowing.
(org-fixup-indentation): Smarter indentation: handle inlinetasks and
footnote definitions.

* testing/lisp/test-org.el (test-org/demote, test-org/promote): New
  test.

`org-called-with-limited-levels' check is removed when promoting
a top-level headline.  The motivation behind it in this particular
case wasn't clear (see 10aba6b126) and
I couldn't find a good reason to keep it.

Suggested-by: Sébastien Vauban
<http://permalink.gmane.org/gmane.emacs.orgmode/92450>
2014-11-08 14:40:24 +01:00
Nicolas Goaziou e429eb4315 Merge branch 'maint' 2014-11-08 10:19:31 +01:00
Nicolas Goaziou e80894fcc0 Silence byte-compiler 2014-11-08 10:18:42 +01:00
Łukasz Gruner 51823c1bb8 Add support for eldoc
Eldoc wil show:
- a 'breadcrumb' of headers when on headerline
- properties of SRC block when on BEGIN/END_SRC line
- inside body of SRC block it will try to use that mode's eldoc function
2014-11-08 06:55:07 +01:00
Nicolas Goaziou 77f088066d Silence byte-compiler 2014-11-07 21:46:08 +01:00
Nicolas Goaziou f49833293a ox: Fix "wrong type argument listp" when filtering tags
* lisp/org.el (org--setup-process-tags): Fill `org-tag-groups-alist'
  only when group tags are defined.

Reported-by: Elric Milon <emacs@whirm.eu>
<http://permalink.gmane.org/gmane.emacs.orgmode/92406>
2014-11-07 21:12:10 +01:00
Nicolas Goaziou a2f8a48ab5 Merge branch 'maint'
Conflicts:
	lisp/ox.el
2014-11-07 00:16:42 +01:00
Leslie H. Watter d4a4fc740e ox.el: Add pt_BR translations to export engine
* lisp/ox.el: (org-export-dictionary) Add pt_BR messages to the list.

TINYCHANGE
2014-11-06 23:47:28 +01:00
Nicolas Goaziou c177d3ca9e Merge branch 'maint' 2014-11-06 19:20:13 +01:00