Commit Graph

9550 Commits

Author SHA1 Message Date
Nicolas Goaziou 45509c4490 ox: Fix erroneous code comment
* lisp/ox.el (org-export--generate-copy-script): Fix code comment.
2013-11-29 10:07:31 +01:00
Nicolas Goaziou 320ae9021e ox: Fix cache confusion during export
* lisp/ox.el (org-export--generate-copy-script): Do not share cache
  when copying buffers since keys and values are modified by
  side-effect.
2013-11-28 22:19:29 +01:00
Bastien Guerry c811bb0ea5 org.el (org-cycle-hide-drawers): Fix bug about re-searching at the wrong side of point
* org.el (org-cycle-hide-drawers): Fix bug about re-searching
at the wrong side of point.

The bug was introduced by this commit:
http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=e8bafd

And reported here:
http://article.gmane.org/gmane.emacs.orgmode/79282
2013-11-28 06:27:57 +01:00
Achim Gratz e655e664bf org: check for derived-mode-p instead of "org-mode" exactly
* lisp/org.el (org-mode-restart): Check for derived-mode-p instead of
  "org-mode" exactly.  This covers a situation normal-mode already
  instantiates a derived mode (e.g. via file local variables).
2013-11-27 20:52:03 +01:00
Achim Gratz f2483ec4bb org: fix commit 0911edfac8
* lisp/org.el (org-mode-restart): After `normal-mode´ the mode may not
  be "org-mode".  Explicitly switch to org-mode in that case.
2013-11-27 19:56:38 +01:00
Nick Dokos 0911edfac8 Second try: Ensure that file local variables are set
* lisp/org.el (org-mode-restart): Call normal-mode,
  instead of org-mode. This will set the mode but it
  will also set file local variables properly.

Reported by Tom Dye: C-c C-c on e.g an #+OPTIONS line
would lose file local variable settings.

The original fix (commit 5ea0228) was incorrect: if the
local variable was a mode setting, then we ended up in an
"infinite" recursion. Problem found, reported and a reproducer
provided by York Zhao.
2013-11-27 09:19:56 -05:00
Nick Dokos a82a5206f3 Revert "Ensure that file local variables are set"
This reverts commit 5ea02285ba.

York Zhao ran into an infinite recursion with this "fix".
2013-11-27 09:19:55 -05:00
Nicolas Goaziou 5a2dabc21b org-element: Optimize parser only when cache is active
* lisp/org-element.el (org-element-at-point): Try opportunistic
  shortcut only when cache is active.
2013-11-26 23:51:26 +01:00
Nicolas Goaziou 15246d1165 org-colview: Silence byte-compiler 2013-11-26 18:23:35 +01:00
Nicolas Goaziou 71c8474ae9 org-element: Speed-up for `org-element-at-point'
* lisp/org-element.el (org-element-at-point): Rewrite function. Remove
  optional argument.

Include an opportunistic search at the beginning of the function.  It
drastically improves speed on large sections for a small overhead on
small ones.
2013-11-26 18:18:33 +01:00
Nicolas Goaziou 2b22886005 org-element: Prepare signature change
* lisp/ob-exp.el: Declare signature change.
* lisp/org-macro.el: Declare signature change.
* lisp/org.el (org-backward-element, org-drag-element-backward): Avoid
  using optional argument from `org-element-at-point'.
* testing/lisp/test-org-element.el: Update test.
2013-11-26 18:08:19 +01:00
Carsten Dominik 0ae48c544b Fix bug in uncompilation of column format
* lisp/org-colview.el (org-columns-uncompile-format): Fix bug when retrieving
operator symbol.
2013-11-26 13:14:06 +01:00
York Zhao f1583aab46 Fix problem with :exact-positions in capture
* lisp/org-capture.el (org-capture-place-entry): Set :exact-position
before doing other stuff, to allow function with other target settings

TINYCHANGE

Assuming file "test.org" has a single headline "* Level 1" (ended with
newline character), when trying to use function type capture target in
an org-capture template, as shown in the example:

(setq org-capture-templates
      `(("t"
         "Test function type target"
         entry
         (function
          (lambda ()
            (set-buffer (org-capture-target-buffer "test.org"))
            (goto-char (point-max))))
         "* Level 2")))

When this template gets filled, file "test.org" becomes:

* Level 1
* Level 2

Instead of:

* Level 1
** Level 2

This is because when using function type target, `:exact-position' is
used to store buffer position returned by user's function (the lambda
function here), and function `org-capture-place-entry' will never
insert template as a child of current entry when `:exact-position' is
used.

The problem is addressed by not special casing for `:exact-position'
in function `org-capture-place-entry'.

York
2013-11-26 06:28:07 +01:00
Nicolas Goaziou a9eec72ecf Merge branch 'maint' 2013-11-25 23:36:38 +01:00
Nicolas Goaziou 3ead82a321 ox-publish: Error when publishing non-existent file
* lisp/ox-publish.el (org-publish-cache-ctime-of-src): Return an error
  when publishing a non-existent file.

Suggested-by: Arne Babenhauserheide <arne_bab@web.de>
2013-11-25 23:34:20 +01:00
Nicolas Goaziou 7bee47120b org-element: Update paragraph separate regexp
* lisp/org-element.el (org-element-paragraph-separate): More accurate
  regexp.
2013-11-25 23:19:48 +01:00
Nicolas Goaziou 4a27c2b4b6 Improved Flyspell checks
* lisp/org.el (org-mode-flyspell-verify): Rewrite function using
  Org parser.  As a consequence, Org is more cautious about areas
  where checks are allowed.
(org-fontify-meta-lines-and-blocks-1, org-activate-footnote-links): Be
subtler when removing flyspell overlays.
(org-unfontify-region): Remove reference to unused `org-no-flyspell'
property.
(org-fontify-drawers): New function.
(org-set-font-lock-defaults): Use new function to fontify drawers.
* contrib/lisp/org-wikinodes.el (org-wikinodes-activate-links): Remove
reference to unused `org-no-flyspell' property.
2013-11-24 16:14:09 +01:00
Eric Schulte 8c98879d7c declare function to appease compiler
* lisp/ob-C.el (org-remove-indentation): Declare function to appease
  compiler.
* lisp/ob-core.el (org-remove-indentation): Declare function to
  appease compiler.
* lisp/ob-fortran.el (org-remove-indentation): Declare function to
  appease compiler.
2013-11-23 17:02:22 -07:00
Eric Schulte 39070b7fc7 sometimes remove common indentation when trimming
* lisp/ob-C.el (org-babel-C-execute): Remove common indentation when
  trimming.

* lisp/ob-core.el (org-babel-read-result): Remove common indentation
  when trimming.
  (org-babel-update-block-body): Remove common indentation when
  trimming.

* lisp/ob-fortran.el (org-babel-execute:fortran): Remove common
  indentation when trimming.

* lisp/ob-tangle.el (org-babel-process-comment-text): Better default
  to process tangled comments.
2013-11-23 15:57:29 -07:00
Eric Schulte 6a4dfd3182 fixed export of inline src blocks
* lisp/ob-exp.el (org-babel-exp-non-block-elements): Fixed export of
  inline src blocks.
2013-11-23 12:24:58 -07:00
Eric Schulte 1f498c93f2 change default sh code block shell to bash
* lisp/ob-sh.el (org-babel-sh-command): Change default sh code block
  shell to bash.
2013-11-23 09:14:27 -07:00
Achim Gratz e26b6fb77b Merge branch 'maint' 2013-11-23 16:18:10 +01:00
Achim Gratz 5213e0f704 org-crypt: fix 3e87d5893d
* lisp/org-crypt.el: Declare `epg-context´.
  (org-encrypt-string): Correct indentation.
2013-11-23 16:15:45 +01:00
Nicolas Goaziou e8bafdd04f Optimize hiding all drawers in a buffer
* lisp/org.el (org-cycle-hide-drawers): Make sure each drawer is only
  flagged once.
2013-11-23 09:34:48 +01:00
Nicolas Goaziou 402c310f00 Fix some defconst and docstrings
* lisp/org.el (org-drawer-regexp, org-clock-drawer-start-re,
  org-clock-drawer-end-re): Fix docstring.
(org-clock-drawer-re): Fix value
2013-11-23 09:34:48 +01:00
Nicolas Goaziou cdbdb9ee66 org-inlinetask: Small clean-up 2013-11-23 09:34:48 +01:00
Bastien Guerry b6a1584fa6 Merge branch 'maint' 2013-11-22 22:33:05 +01:00
Nicolas Richard 9ff70abc14 Use key-description on the keys mentionned by the functions defined by
`orgtbl-mode'.
2013-11-22 22:32:50 +01:00
Nicolas Richard a598e9c163 Remove old comment
The comment was introduced (in git) at commit
4be4c56239 ; it refers to a
FIXME located ~40 lines above it. The FIXME was removed in
dc8bc8e392.
2013-11-22 22:32:45 +01:00
Eric Schulte 89a35bc147 inline src block parser set "switches" in info
* lisp/ob-core.el (org-babel-parse-inline-src-block-match): Inline src
  block parser set "switches" in info, otherwise later offset are broken.
2013-11-22 08:28:29 -07:00
Eric Schulte bbcf17b969 set location info parameter for inline src blocks
* lisp/ob-core.el (org-babel-execute-src-block): Set location info
  parameter for inline src blocks.
  (org-babel-get-src-block-info): Set location info parameter for
  inline src blocks.
2013-11-22 08:28:29 -07:00
Eric Schulte 060d79f080 whitespace fixes 2013-11-22 08:28:29 -07:00
Nicolas Goaziou 72a81dd06a Fix export of links to attachements (part 2)
* lisp/org.el (org-entry-get): Widen buffer in order to retrieve
  properties, as `org-entry-properties' and
  `org-entry-get-with-inheritance' already do.
2013-11-22 12:42:41 +01:00
Nicolas Goaziou 5ae3a25755 Fix export of links to attachments (part 2)
* lisp/org.el (org-entry-get): Widen buffer in order to retrieve
  a property, as both `org-entry-properties' and
  `org-entry-get-with-inheritance' already do.
2013-11-22 12:39:15 +01:00
Bastien Guerry 0a4d192b79 Merge branch 'maint' 2013-11-22 10:52:53 +01:00
Alexander Vorobiev b88b5d4fd1 org-compat: Support for getting data from Windows clipboard
* lisp/org-compat.el (org-get-x-clipboard): Use w32-get-clipboard-data
to get the clipboard data under Windows.

TINYCHANGE
2013-11-22 10:52:41 +01:00
Nicolas Goaziou 7a726dd137 Merge branch 'maint' 2013-11-22 09:49:17 +01:00
Nicolas Goaziou 23e6c72133 ox-html: Fix TOC entries
* lisp/ox-html.el (org-html--format-toc-headline): Add missing
  headline number in TOC entries.  This fixes commit
  4c94c4d062.
2013-11-22 09:48:25 +01:00
Nick Dokos 5ea02285ba Ensure that file local variables are set
* lisp/org.el (org-mode): Call `hack-local-variables'
  at the end of `org-mode' to set file local variables.
  Cribbed from `normal-mode'.

Reported by Tom Dye: C-c C-c on e.g an #+OPTIONS line
would lose file local variable settings.
2013-11-21 00:30:05 -05:00
Bastien Guerry 388dc52c93 Merge branch 'maint' 2013-11-20 19:28:25 +01:00
Thierry Volpiatto 3e87d5893d org-crypt.el: Fix warning
* org-crypt.el (org-encrypt-string, org-encrypt-entry)
(org-decrypt-entry): Fix warning.

TINYCHANGE

epg-context is let-bounded in org-crypt and then epg local set it in
this context.  It should just be set as local var instead of being let
bounded.

See http://debbugs.gnu.org/cgi/bugreport.cgi?bug=15081
2013-11-20 19:26:12 +01:00
Eric Schulte bb97f5cdff rm redundant value/output splitting of lisp blocks
* lisp/ob-lisp.el (org-babel-execute:lisp): The car/cadr are now taken
  previously in the function and need not be taken within the call to
  `org-babel-result-cond'.
2013-11-19 09:06:25 -07:00
Nicolas Goaziou d35233f84a Merge branch 'maint' 2013-11-18 20:49:43 +01:00
Nicolas Goaziou c5aad89f5a Fix export of links to attachements
* lisp/org.el (org-entry-properties): Ignore narrowing when retrieving
  current headline properties.
2013-11-18 19:11:17 +01:00
Michael Brand 971a3a4e48 Hyperlink: Use url-encode-url for browse-url
* lisp/org.el (org-open-at-point): When available (Emacs 24.3.1) use
`url-encode-url' instead of `org-link-escape-browser'.
2013-11-17 12:00:18 +01:00
Nicolas Goaziou 36c8d8b4d2 org-footnote: Fix dual `org-load-hook' run
* lisp/org-footnote.el (org-footnote-section): Do not require
  `org-element' when initializing the variable, since `org' is not
  provided yet.
2013-11-17 09:52:54 +01:00
Bastien Guerry 9214000c21 Merge branch 'maint'
Conflicts:
	doc/org.texi
2013-11-17 09:17:39 +01:00
Bastien Guerry 4e798549fe Backport Paul's fixes from Emacs trunk (2/2)
See http://article.gmane.org/gmane.emacs.diffs/123123
2013-11-17 09:15:25 +01:00
Bastien Guerry a6210cc9c2 Backport Paul's fixes from Emacs trunk (1/2)
See http://article.gmane.org/gmane.emacs.diffs/123123
2013-11-17 09:12:41 +01:00
Bastien Guerry f8661f7e3d Merge branch 'maint' 2013-11-17 08:47:48 +01:00