Commit Graph

12888 Commits

Author SHA1 Message Date
Nicolas Goaziou 5e37a5c116 ox: Fix export of footnote definitions in pruned parts of tree
* lisp/ox.el (org-export--missing-definitions):
(org-export--install-footnote-definitions): New functions
(org-export--merge-external-footnote-definitions): Remove function
(org-export-as):
(org-export--prune-tree): Use new functions.
* testing/lisp/test-ox.el (test-org-export/footnotes): Add tests.

Reported-by: Mark Edgington <edgimar@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107940>
2016-06-27 23:57:42 +02:00
Nicolas Goaziou d4408684e1 org-compat: Small refactoring
* lisp/org-compat.el (org-compatible-face): Small refactoring.  Remove
  Emacs 22 related part of the code.
2016-06-26 14:43:20 +02:00
Nicolas Goaziou 2f90a60bd8 Remove Emacs 22 related code
* contrib/lisp/htmlize.el (htmlize-face-color-internal):
(htmlize-face-to-fstruct):
* lisp/org-agenda.el (org-anniversary):
(org-cyclic):
(org-block):
(org-date):
* lisp/org-compat.el (org-region-active-p):
* lisp/org.el (org-use-extra-keys):
(occur-mode-find-occurrence-hook): Remove Emacs 22 related code and
comments.

(org-diary-class): Remove function.
2016-06-26 14:35:22 +02:00
Nicolas Goaziou 1891dd4816 org-compat: Tiny refactoring
* lisp/org-compat.el (org-re): Use `obsolete' in `declare'.
2016-06-26 10:29:27 +02:00
Michael Brand e4baab8e10 Extend a docstring
* lisp/org.el (org-startup-truncated): Extend docstring.
(org-set-font-lock-defaults): Also the last top level expression on an
own line.
2016-06-25 17:04:43 +02:00
Lele Gaifax c338f9c630 org-colview.el: Fix typo in function name
* lisp/org-colview.el (org-columns-hscroll-title): Rename from
  `org-columns-hscoll-title'.
(org-columns--display-here-title):
(org-columns-remove-overlays): Adjust reference to renamed function.
2016-06-24 15:58:29 +02:00
Nicolas Goaziou 313146374e org-colview: Fix last commit
* lisp/org-colview.el (org-columns-edit-value): Fix last commit.
2016-06-24 10:06:02 +02:00
Nicolas Goaziou 1114418dd4 org-colview: Replace `org-columns-eval' with `org-columns--call'
* lisp/org-colview.el (org-columns-edit-value): Small refactoring.  Use
  new function.
(org-columns--call): New function.
(org-columns-eval): Remove function.
(org-columns-next-allowed-value): Use new function.
2016-06-24 09:59:49 +02:00
Nicolas Goaziou f364229176 Merge branch 'maint' 2016-06-24 09:22:00 +02:00
Nicolas Goaziou 0d72c34937 Improve a docstring
* lisp/org.el (org-delete-all): Improve docstring.
2016-06-24 09:21:38 +02:00
Nicolas Goaziou bffa144f54 org-mobile: Fix TODO keywords generation
* lisp/org-mobile.el (org-mobile-create-index-file): Call
  `org-delete-all' later since it is a destructive operation.

Reported-by: Ian Dunn <dunni@gnu.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/107900>
2016-06-24 09:18:30 +02:00
Nicolas Goaziou 5485170263 org-capture: Remove forbidden value type from "file" templates
* lisp/org-capture.el (org-capture-expand-file): Remove plain S-exps
  from allowed values.
2016-06-24 01:11:49 +02:00
Nicolas Goaziou 8860c92f62 ob-exp: Small fix
* lisp/ob-exp.el (org-babel-exp-src-block): Use `symbol-name' instead of
  `eval' since the argument is a dynamically scoped variable anyhow.
2016-06-24 00:55:03 +02:00
Nicolas Goaziou 3bfbd26acd org-clock: Remove handling for illicit :scope values
* lisp/org-clock.el (org-dblock-write:clocktable): :scope is not meant
  to be a s-exp, so don't use `eval' on it.
2016-06-24 00:52:19 +02:00
Nicolas Goaziou ba4831bba8 Fix `org-no-properties' called with an optional argument
* lisp/org-macs.el (org-no-properties): Fix function so that optional
  argument `restricted' is not ignored.
2016-06-23 15:55:39 +02:00
Nicolas Goaziou 89d2006e84 Remove `org-substitute-posix-classes'
* lisp/org-macs.el (org-substitute-posix-classes): Remove function.

This function is unused throughout the code base and not part of any
public API.
2016-06-23 15:28:45 +02:00
Nicolas Goaziou aae0b22a0c Deprecate `org-format-seconds' in favor of `format-seconds'
* lisp/org-macs.el (org-format-seconds): Remove function.
* lisp/org-compat.el (org-format-seconds): Mark function as an obsolete
  alias.
* lisp/org-table.el (org-table-time-seconds-to-string):
* lisp/ox.el (org-export-stack-refresh): Apply removal.
2016-06-23 15:26:17 +02:00
Nicolas Goaziou ee7aa9878f Deprecate `org-no-warnings' in favor of `with-no-warnings'
* lisp/org-macs.el (org-no-warnings): Rewove macro.
* lisp/org-compat.el (org-no-warnings): Mark `org-no-warnings' as
  obsolete.
* contrib/lisp/org-contacts.el (defvar):
* contrib/lisp/org-wl.el (org-wl-open):
* lisp/org-agenda.el (defvar):
(org-anniversary):
(org-cyclic):
(org-block):
(org-date):
* lisp/org-bbdb.el (defvar):
* lisp/org-clock.el (org-clock-out):
(org-clock-cancel):
* lisp/org-mouse.el (org-mouse-show-context-menu):
* lisp/org.el (org-modify-ts-extra):
(org-order-calendar-date-args): Small refactoring.
* lisp/ox-odt.el (org-odt-htmlfontify-string):
2016-06-23 15:20:32 +02:00
Nicolas Goaziou 28ba698262 org-macs: Remove `org-replace-match-keep-properties'
* lisp/org-macs.el (org-replace-match-keep-properties): Remove function.

This function is unused through the code base and doesn't specifically
belong to a public API.
2016-06-23 15:13:14 +02:00
Nicolas Goaziou 999f224299 Deprecate `org-called-interactively-p' in favor of `called-interactively-p'
* lisp/org-compat.el (org-called-interactively-p): Make it an obsolete
  alias for `called-interactively-p'.
* lisp/org-macs.el (org-called-interactively-p): Remove function.
* contrib/lisp/org-expiry.el (org-expiry-insinuate):
(org-expiry-deinsinuate):
(org-expiry-process-entry):
(org-expiry-process-entries):
(org-expiry-archive-subtree):
(org-expiry-add-keyword):
* lisp/ob-core.el (org-babel-expand-src-block):
(org-babel-sha1-hash):
* lisp/org-agenda.el (org-toggle-sticky-agenda):
(org-agenda-write):
(org-agenda-dim-blocked-tasks):
(org-agenda-redo):
(org-agenda-show-1):
(org-agenda-set-tags):
* lisp/org-lint.el (org-lint):
* lisp/org-table.el (org-table-blank-field):
(org-table-current-column):
(org-table-current-dline):
(org-table-sort-lines):
(org-table-sum):
(org-table-rotate-recalc-marks):
(org-table-eval-formula):
(orgtbl-send-table):
* lisp/org.el (org-mode):
(org-copy-subtree):
(org-paste-subtree):
(org-store-link):
(org-todo):
(org-occur):
(org-create-math-formula):
(org-toggle-inline-images):
(org-mark-subtree):
(org-mark-element): Apply removal.
2016-06-23 15:08:03 +02:00
Nicolas Goaziou 75f61e11c3 Remove `org-inhibit-invisibility'
* lisp/org-macs.el (org-inhibit-invisibility): Remove function.
* lisp/org.el (org-set-tags): Apply removal.
2016-06-23 14:28:20 +02:00
Nicolas Goaziou 5721fd890a Remove `org-maybe-intangible'
* lisp/org-macs.el (org-maybe-intangible): Remove macro.
* lisp/org.el (org-activate-bracket-links):
(org-hide-wide-columns): Apply removal.
2016-06-23 14:25:51 +02:00
Nicolas Goaziou ff80654617 Mark `org-bound-and-true-p' as obsolete
* lisp/org-macs.el (org-bound-and-true-p): Remove macro.
* lisp/org-compat.el (org-bound-and-true-p): Deprecated alias for
  `bound-and-true-p'.
* lisp/ob-core.el (org-babel-confirm-evaluate):
* lisp/org-agenda.el (org-agenda-write):
(org-agenda-add-entry-text):
(org-agenda-todo):
* lisp/org-clock.el (org-clocktable-defaults):
(org-clocktable-write-default):
* lisp/org-colview.el (org-columns):
(org-columns--compute-spec):
(org-agenda-columns):
* lisp/org-indent.el (org-indent-set-line-properties):
* lisp/org-inlinetask.el (org-inlinetask-fontify):
* lisp/org-mobile.el (org-mobile-write-agenda-for-mobile):
* lisp/org-pcomplete.el (pcomplete/org-mode/file-option/options):
(pcomplete/org-mode/file-option/infojs_opt):
* lisp/org-src.el (org-src-mode-configure-edit-buffer):
(org-edit-table.el):
* lisp/org.el (org-store-link):
(org-refile):
(org-get-export-keywords):
(org-set-tags):
(org-order-calendar-date-args):
(org-mode-restart):
(org-tbl-menu):
(org-beginning-of-line):
(org-end-of-line):
(org-kill-line):
(org-truely-invisible-p):
(org-remove-flyspell-overlays-in): Use `bound-and-true-p' instead of
`org-bound-and-true-p'.
2016-06-23 14:23:52 +02:00
Nicolas Goaziou 23d84285bf Deprecate `org-char-to-string' in favor of `char-to-string'
* lisp/org-macs.el (org-char-to-string): Remove function.
* lisp/org-compat.el (org-char-to-string): Declare function as obsolete.
* lisp/org.el (org-link-unescape-compound): Apply removal.
2016-06-23 14:10:34 +02:00
Nicolas Goaziou b3d2b354c9 org-list: Silence byte-compiler
* lisp/org-list.el (org-list-item-body-column): Silence byte-compiler.
2016-06-23 10:21:07 +02:00
Nicolas Goaziou d13b0745dc Mark a few functions as obsolete
* lisp/ob-R.el (org-babel-variable-assignments:R):
* lisp/ob-ref.el (org-babel-ref-goto-headline-id):
* lisp/org-agenda.el (org-agenda-prepare-window):
(org-agenda-switch-to):
* lisp/org-capture.el (org-capture-goto-target):
* lisp/org-clock.el (org-clock-goto):
(org-clock-special-range):
* lisp/org-ctags.el (org-ctags-visit-buffer-or-file):
* lisp/org-eshell.el (org-eshell-open):
* lisp/org-feed.el (org-feed-show-raw-feed):
* lisp/org-id.el (org-id-goto):
* lisp/org-irc.el (org-irc-visit-erc):
* lisp/org-macs.el (org-string-nw-p):
* lisp/org-mobile.el (org-mobile-apply):
* lisp/org-src.el (org-src-switch-to-buffer):
* lisp/org.el (org-get-location):
(org-tree-to-indirect-buffer):
(org-mark-ring-goto):
(org-refile):
(org-add-log-note):
(org-revert-all-org-buffers):
(org-switchb):
(org-cycle-agenda-files):
(org-submit-bug-report):
(org-goto-marker-or-bmk):
* lisp/ox-html.el (org-html-htmlize-generate-css): Silence byte
  compiler.

The following functions are marked as obsolete:
- `org-string-match-p'
- `org-number-sequence'
- `org-floor*'
- `org-pop-to-buffer-same-window'
- `org-delete-directory'
- `org-buffer-narrowed-p'
2016-06-23 10:00:00 +02:00
Nicolas Goaziou bfed384cd8 org-compat: Use lexical binding
* lisp/org-compat.el (org-move-to-column):
(org-pop-to-buffer-same-window): Silence byte-compiler.
2016-06-23 09:25:33 +02:00
Nicolas Goaziou 705904552c Deprecate `org-find-if' in favor of `cl-find-if'
* lisp/org.el (org-find-if): Remove function.
(org-key):
* contrib/lisp/org-contacts.el (org-contacts-db-need-update-p):
(org-contacts-filter):
(org-contacts-test-completion-prefix):
(org-contacts-remove-ignored-property-values): Use `cl-find-if'
* lisp/org-compat.el (org-find-if): Mark function as an obsolete alias
  for `cl-find-if'.
2016-06-23 09:22:49 +02:00
Nicolas Goaziou a24f339f58 Work around a display bug when previewing LaTeX fragments
* lisp/org.el (org-format-latex): Change signature.
(org-toggle-latex-fragment):
* lisp/ox-html.el (org-html-format-latex): Apply signature change.
2016-06-23 00:56:18 +02:00
Nicolas Goaziou 2f2e6625ac Work around a display bug when previewing LaTeX fragments
* lisp/org.el (org-format-latex): Change signature.
(org-toggle-latex-fragment):
* lisp/ox-html.el (org-html-format-latex): Apply signature change.
2016-06-23 00:33:22 +02:00
Nicolas Goaziou 24852ef060 Merge branch 'maint' 2016-06-22 22:43:19 +02:00
Nicolas Goaziou ecffcbcf1c Tiny fix to `org-set-effort'
* lisp/org.el (org-set-effort): Use `equal' instead of `string='.

Since (string= "nil" nil) is non-nil, a "nil" heading could be mistaken
for the current clocked task if `org-clock-current-task' is not bound,
or if there is no current clocked task.
2016-06-22 22:39:50 +02:00
Nicolas Goaziou 411524a31c Merge branch 'maint' 2016-06-22 22:38:07 +02:00
Nicolas Goaziou 2be2a15566 Merge branch 'maint' of orgmode.org:org-mode into maint 2016-06-22 22:36:22 +02:00
Nicolas Goaziou 85dd02b0dd ox: Fix export of empty footnote definitions outside scope
* lisp/ox.el (org-export-get-footnote-definition): When a definition is
  empty, but does exist, return the empty string instead of raising an
  error.
* testing/lisp/test-ox.el (test-org-export/get-footnote-definition): New
  test.

Reported-by: Mark Edgington <edgimar@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107873>
2016-06-22 22:34:53 +02:00
Nicolas Goaziou 5cd793c59a ox-publish: Change signature for preparation and completion functions
* doc/org.texi (Sources and destinations): Document new signature.
* lisp/ox-publish.el (org-publish-project-alist): Update docstring.
(org-publish-projects): Call preparation and
completion functions with the project properties as the sole argument.

`project-plist' used to be dynamically scoped.  This is no longer
possible due to the switch to lexical binding.

Reported-by: Arun Isaac <arunisaac@systemreboot.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/107856>
2016-06-22 15:31:48 +02:00
Nicolas Goaziou 6b7944805f org-mobile: Use lexical binding
* lisp/org-agenda.el (org-agenda-keep-restricted-file-list): New
  variable, dynamically scoped.
(org-agenda): Variable is now necessarily bound.

* lisp/org-mobile.el (org-mobile-create-index-file): Silence
  byte-compiler.
2016-06-22 00:01:10 +02:00
Nicolas Goaziou d87f4e1570 org-w3m: Use lexical binding 2016-06-21 23:41:41 +02:00
Nicolas Goaziou 11335f0ec0 org-rmail: Use lexical binding 2016-06-21 23:38:39 +02:00
Nicolas Goaziou 267af5e2fb org-protocol: Tiny clean up 2016-06-21 23:37:19 +02:00
Nicolas Goaziou 097edbfde4 org-protocol: Silence byte-compiler 2016-06-21 23:36:31 +02:00
Nicolas Goaziou 3dab837aef org-protocol: Use lexical binding
* lisp/org-protocol.el (org-protocol-store-link):
(org-protocol-open-source):
(org-protocol-check-filename-for-protocol):
(org-protocol-create): Silence byte-compiler.
2016-06-21 23:23:18 +02:00
Nicolas Goaziou 62d3d24f0b org-plot: Use lexical binding
* lisp/org-plot.el (org-plot/add-options-to-plist): Silence
  byte-compiler.
2016-06-21 23:19:11 +02:00
Nicolas Goaziou 313a97fca3 org-pcomplete: Small clean-up 2016-06-21 23:16:19 +02:00
Nicolas Goaziou b35d05ac2e org-pcomplete: Use lexical binding 2016-06-21 23:14:49 +02:00
Nicolas Goaziou 6bd701f44f org-mouse: Use lexical binding
* lisp/org-mouse.el (org-mouse-main-buffer): New dynamically scoped
  variable.
(org-mouse-replace-match-and-surround):
(org-mouse-for-each-item):
(org-mouse-move-tree-start):
(org-mouse-do-remotely):
(org-mouse-agenda-context-menu): Silence byte-compiler.
2016-06-21 23:12:23 +02:00
Nicolas Goaziou 994fe3e566 org-macs: Silence byte-compiler
* lisp/org-macs.el (org-save-outline-visibility): Remove unused symbol.
2016-06-21 23:02:35 +02:00
Nicolas Goaziou 3c5d215274 org-mhe: Use lexical binding 2016-06-21 23:01:52 +02:00
Nicolas Goaziou 5fcb15d976 org-macs: Use lexical binding
* lisp/org-macs.el (org-save-outline-visibility): Small refactoring.
2016-06-21 22:56:46 +02:00
Nicolas Goaziou b2835f3b8f org-irc: Use lexical binding
* lisp/org-irc.el (org-irc-ellipsify-description): Replace `mapc' +
  `lambda' with `dolist'.
2016-06-21 22:45:08 +02:00
Nicolas Goaziou 8d87417111 org-inlinetask: Use lexical binding 2016-06-21 22:42:09 +02:00
Nicolas Goaziou 26f0f938f4 org-info: Use lexical binding
* lisp/org-info.el (org-info-store-link): Small refactoring.
2016-06-21 22:38:51 +02:00
Nicolas Goaziou bb4b0d7efc org-gnus: Use lexical binding 2016-06-21 22:36:06 +02:00
Nicolas Goaziou b1c05d5169 org-eshell: Use lexical binding 2016-06-21 22:34:25 +02:00
Nicolas Goaziou c69fd5bf61 org-entities: Tiny refactoring
* lisp/org-entities.el (org-entities--user-safe-p): Use pattern matching
  and strengthen check for name.
2016-06-21 16:53:27 +02:00
Nicolas Goaziou 27c5cf153f org-entities: Use lexical binding
* lisp/org-entities.el (org-entities):
(org-entities-create-table):
(org-entities-help): Silence byte-compiler.
2016-06-21 16:40:08 +02:00
Nicolas Goaziou 4f63cfabb3 Deprecate `org-babel-trim' in favor of `org-trim'
* lisp/org.el (org-trim): Add optional argument.

* contrib/lisp/ob-mathematica.el (org-babel-execute:mathematica):
* contrib/lisp/org-bibtex-extras.el (obe-html-export-citations):
* contrib/lisp/org-mime.el (org-mime-compose):
* lisp/ob-C.el (org-babel-C-execute):
* lisp/ob-calc.el (org-babel-execute:calc):
* lisp/ob-clojure.el (org-babel-expand-body:clojure):
* lisp/ob-core.el (org-babel-initiate-session):
(org-babel-parse-multiple-vars):
(org-babel-read-element):
(org-babel-insert-result):
(org-babel-expand-noweb-references):
(org-babel-trim): Mark obsolete.
* lisp/ob-forth.el (org-babel-forth-session-execute):
* lisp/ob-fortran.el (org-babel-execute:fortran):
* lisp/ob-haskell.el (org-babel-execute:haskell):
* lisp/ob-latex.el (org-babel-expand-body:latex):
* lisp/ob-lisp.el (org-babel-expand-body:lisp):
* lisp/ob-ocaml.el (org-babel-execute:ocaml):
* lisp/ob-octave.el (org-babel-octave-evaluate-session):
* lisp/ob-python.el (org-babel-python-evaluate-external-process):
(org-babel-python-evaluate-session):
* lisp/ob-ref.el (org-babel-ref-split-args):
* lisp/ob-ruby.el (org-babel-ruby-evaluate):
* lisp/ob-shell.el (org-babel-sh-evaluate):
* lisp/ob-table.el (org-sbe):
* lisp/ob-tangle.el (org-babel-spec-to-string):
* lisp/org-bibtex.el (org-bibtex-get):
* testing/lisp/test-ob.el (test-ob/parse-header-args): Use `org-trim'
  instead of `org-babel-trim'.
2016-06-21 15:33:00 +02:00
Nicolas Goaziou 1c30dea0ec ob-core: Small refactoring
* lisp/ob-core.el (org-babel-get-src-block-info): Small refactoring.
2016-06-21 14:42:17 +02:00
Nicolas Goaziou f8eb0b30ea ob-shell: Fix "wrong type sequencep: function" error
* lisp/ob-shell.el (org-babel-shell-names): Fix error introduced when
  switching to lexical binding.
2016-06-20 22:12:02 +02:00
Nicolas Goaziou 47fdeb1f48 org-ctags: Do not require "cl" at compile time 2016-06-20 15:08:25 +02:00
Nicolas Goaziou 7d3380612f org-ctags: Use lexical binding
* lisp/org-ctags.el (org-ctags-open-file):
(org-ctags-fail-silently): Silence byte-compiler.
2016-06-20 15:04:33 +02:00
Nicolas Goaziou b67a3ff715 org-crypt: Use lexical binding 2016-06-20 15:00:47 +02:00
Nicolas Goaziou 2108f0c23a ob-shell: Use lexical binding
* lisp/ob-shell.el (org-babel-sh-initiate-session): Silence
  byte-compiler.
2016-06-20 14:58:32 +02:00
Nicolas Goaziou d4ea5decea ob-lob: Fix docstring
* lisp/ob-lob.el (org-babel-lob--src-info): Fix typo.
2016-06-20 14:47:22 +02:00
Nicolas Goaziou a5cf0f6fb8 ob-lob: Remove `org-babel-lob-files'
* lisp/ob-lob.el (org-babel-lob-files): Remove variable.
(org-babel-library-of-babel): Fix docstring.

Since its creation, `org-babel-lob-files' has been a no-op.  Since no-one
noticed it during those 7 years, it can safely be removed.

Reported-by: "Charles C. Berry" <ccberry@ucsd.edu>
<http://permalink.gmane.org/gmane.emacs.orgmode/107824>
2016-06-20 14:47:10 +02:00
Nicolas Goaziou bae2286393 ob-core: Tiny refactoring
* lisp/ob-core.el (org-babel-graphical-output-file): Refactor code.  Fix
  error messages.
2016-06-20 14:41:04 +02:00
Nicolas Goaziou 6cefae1637 ob-core: Use lexical binding
* lisp/ob-core.el (org-babel-get-src-block-info):
(org-babel-insert-header-arg):
(org-babel-enter-header-arg-w-completion):
(org-babel-params-from-properties):
(org-babel-process-params):
(org-babel-read): Use lexical scoping when eval'ing.
(org-babel-examplify-region): Silence byte-compiler.
(org-babel-merge-params):
(org-babel-noweb-p): Refactor code.
2016-06-20 14:35:16 +02:00
Kyle Meyer 160efb5129 Merge branch 'maint' 2016-06-19 14:18:10 -04:00
Kyle Meyer 792bb9b655 org-set-effort: Fix void variable error
* lisp/org.el (org-set-effort): Check if org-clock-current-task is
  defined because org-clock.el may not be loaded yet.
2016-06-19 14:11:25 -04:00
Kyle Meyer b237d4df04 org-set-effort: Remove extra space in prompt
* lisp/org.el (org-set-effort): Make spacing across different prompt
  cases consistent.  Simplify prompt concatenation.
2016-06-19 14:11:20 -04:00
Nicolas Goaziou 69552bd42f ob-tangle: Fix failing test on Emacs 24.3
* lisp/ob-tangle.el (org-babel-tangle): Do not use `add-to-list' on
  a let-bound symbol.
2016-06-19 00:57:03 +02:00
Nicolas Goaziou 65e9dcee8d ob-tangle: Use lexical binding
* lisp/ob-tangle.el (org-babel-process-comment-text):
(org-babel-spec-to-string):
(org-babel-tangle-single-block):
(org-babel-tangle-comment-links):
(org-babel-tangle-jump-to-org): Silence byte-compiler.
2016-06-19 00:38:22 +02:00
Nicolas Goaziou 270ed02b02 ob-exp: Tiny refactoring
* lisp/ob-exp.el (org-export-babel-evaluate): Tiny refactoring.
2016-06-19 00:38:22 +02:00
Nicolas Goaziou ce19c05e34 ob-exp: Use lexical binding
* lisp/ob-exp.el (org-babel-exp-src-block): Use `eval' with optional
  LEXICAL argument.
(org-babel-exp-process-buffer): Remove unused bindings.
2016-06-19 00:38:22 +02:00
Nicolas Goaziou 72d4c3db2d ob-exp: Do not require `cl' at compile time
* lisp/ob-exp.el (org-babel-exp-process-buffer): Use `pcase' instead of
  `case'.
2016-06-19 00:38:22 +02:00
Nicolas Goaziou e1139e1895 ob-exp: Consolidate export of code blocks
* lisp/ob-exp.el (org-babel-exp--at-source): New macro.
(org-babel-exp-in-export-file): Remove macro.
(org-babel-exp-src-block): Remove unused argument.  Use new macro.
(org-babel-exp-process-buffer): Apply signature change above.  Put
temporary properties on top of Babel code so as to find original
location without relying on heuristics.
(org-babel-exp-results): Use new macro.

Export process has to know context of Babel code being evaluated (e.g.,
so as to retrieve parameters from node properties).  However, evaluating
previous code can drastically change the buffer.  The library used some
heuristics to find the original location.  Those are not necessary
anymore.
2016-06-19 00:38:22 +02:00
Nicolas Goaziou cfaf0d54d7 ox: Remove `org-export-execute-babel-code'
* lisp/ox.el (org-export-execute-babel-code): Remove function.
(org-export-as): Replace previous function with
`org-babel-exp-process-buffer'.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Change signature.
  Copy buffer before evaluating code.

* testing/lisp/test-ob-exp.el (ob-exp/exports-inline-code):
(ob-exp/exports-inline-code-double-eval):
(ob-exp/exports-inline-code-eval-code-once):
(ob-exp/exports-inline-code-double-eval-exports-both):
(ob-export/export-with-results-before-block):
(ob-export/export-src-block-with-switches):
(ob-export/export-src-block-with-flags):
(ob-export/export-and-indentation):
(ob-export/export-under-commented-headline):
(ob-export/reference-in-post-header):
(ob-export/babel-evaluate):
(org-test-with-expanded-babel-code):
* testing/lisp/test-ob-lob.el (test-ob-lob/export-lob-lines):
(test-ob-lob/do-not-eval-lob-lines-in-example-blocks-on-export): Apply
change.

This patch merges `org-export-execute-babel-code' within
`org-babel-exp-process-buffer', removing one level of indirection.  Now,
all the Babel evaluation is on the Babel side.
2016-06-18 22:11:14 +02:00
Nicolas Goaziou f195259821 Merge branch 'maint' 2016-06-17 14:17:23 +02:00
Nicolas Goaziou 0279d84cd7 ob-exp: Remove spurious comma un-escaping
* lisp/ob-exp.el (org-babel-exp-code): Remove spurious comma
  un-escaping.
2016-06-17 14:16:39 +02:00
Nicolas Goaziou ee7ca3cc43 org-list: Allow multiple receiver locations for radio lists
* lisp/org-list.el (org-list-send-list): Allow multiple receiver
  locations.
* testing/lisp/test-org-list.el (test-org-list/send-list): Add test.
2016-06-17 10:19:07 +02:00
Nicolas Goaziou 3781a3dbbd org-table: Allow multiple receiver locations for radio tables
* lisp/org-table.el (orgtbl-send-replace-tbl): Allow multiple receiver
  locations.
* testing/lisp/test-org-table.el (test-org-table/send-region): Add test.
2016-06-17 10:05:40 +02:00
Nicolas Goaziou 4b3bdd019e Merge branch 'maint' 2016-06-17 00:41:54 +02:00
Nicolas Goaziou 75238d25ed Fix refiling to an empty headline
* lisp/org.el (org-refile): Do not assume the headline is not empty.

Reported-by: Fabrice Popineau <fabrice.popineau@supelec.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/107772>
2016-06-17 00:39:52 +02:00
Xi Shen 35df86c5c0 ob-sql.el: Support sqlcmd in Cygwin environment
* lisp/ob-sql.el (org-babel-sql-dbstring-mssql): Format Microsoft
  `sqlcmd' command line args.
(org-babel-sql-convert-standard-filename): Convert a Posix path to
Windows long path in Cygwin environment, or do nothing.
(org-babel-execute:sql): Add `mssql' engine support and remove support
for `msosql' engine.

The `osql' command line tool was last updated in 2004,
https://technet.microsoft.com/en-us/library/aa214012(v=sql.80).aspx, and
could not output the query result in a way that morden `org-table.el'
expects.  The `sqlcmd' is the preferred command line tool to connect the
Microsoft SQL Server and it also has a Linux version,
https://msdn.microsoft.com/en-us/library/hh568447(v=sql.110).aspx.

TINYCHANGE
2016-06-17 00:26:20 +02:00
Nicolas Goaziou 8416402269 Silence byte-compiler 2016-06-17 00:24:12 +02:00
Nicolas Goaziou db671e1449 ob-ref: Fix reference expansion
* lisp/ob-ref.el (org-babel-ref-resolve): Properly expand a reference to
  a Babel call.
2016-06-16 23:44:53 +02:00
Nicolas Goaziou c3b42e917f ob: Remove `org-babel-lob-execute'
* lisp/ob-lob.el (org-babel-lob-execute): Remove function
(org-babel-lob-execute-maybe):
* lisp/ob-ref.el (org-babel-ref-resolve):
* testing/lisp/test-ob-header-arg-defaults.el (test-ob-header-arg-defaults/global/call):
(test-ob-header-arg-defaults/tree/overwrite/call):
(test-ob-header-arg-defaults/tree/accumulate/call):
(test-ob-header-arg-defaults/tree/complex/call):
* testing/lisp/test-ob-lob.el (test-ob-lob/named-caching-call-line):
(test-ob-lob/caching-call-line):
(test-ob-lob/call-with-header-arguments): Apply removal.
2016-06-16 23:37:40 +02:00
Nicolas Goaziou dbb375fdfc Simplify Babel calls evaluation
* lisp/ob-lob.el (org-babel-default-lob-header-args): Merge value with
  `org-babel-default-header-args' since this variable is meant to
  replace the latter.
(org-babel-lob-ingest): Make sure `org-babel-default-lob-header-args' is
used instead of `org-babel-default-header-args'.
(org-babel-lob--src-info): New function.
(org-babel-lob-get-info): Use new function.  Make return value
a replacement for `org-babel-get-src-block-info'.
(org-babel-lob-execute): Use `org-babel-execute-src-block' instead of
duplicating functionalities.
* lisp/ob-exp.el (org-babel-exp-process-buffer): Apply changes to
  `org-babel-lob-get-info' return value.

* testing/examples/ob-header-arg-defaults.org:
* testing/lisp/test-ob-header-arg-defaults.el (test-ob-header-arg-defaults/tree/accumulate/call):
(test-ob-header-arg-defaults/tree/complex/call):
(test-ob-header-arg-defaults/tree/overwrite/call):
* testing/lisp/test-ob-lob.el (test-ob-lob/caching-call-line):
(test-ob-lob/named-caching-call-line): Update tests.

The purpose of this commit is to make Babel calls more
predictable (e.g., wrt property inheritance) and to remove code
duplication.  Also, Babel calls results are no longer treated as Emacs
Lisp values.
2016-06-16 23:15:01 +02:00
Nicolas Goaziou a04752d38c org-element: Small fix
* lisp/org-element.el (org-element-inline-babel-call-parser): Empty
  arguments return nil instead of the empty string, so as to be on par
  with `org-element-babel-call-parser'.
2016-06-16 22:34:12 +02:00
Nicolas Goaziou e3e52a45bb ob-lob: Use lexical binding 2016-06-16 22:34:12 +02:00
Nicolas Goaziou ddd661a783 ob-lob: Use cl-lib 2016-06-16 22:34:12 +02:00
Nicolas Goaziou 758629d6a0 ob-ref: Remove unnecessary function declarations 2016-06-16 22:34:12 +02:00
Nicolas Goaziou 9d448128b7 ox: Fix typo
* lisp/ox.el (org-export-get-reference): Fix typo.
2016-06-16 22:33:21 +02:00
Marco Wahl 2c4e13c56a org-timer: User can always set timer by prefix arg
* lisp/org-timer.el (org-timer-set-timer): The user can always set the
  timer with a numeric prefix argument.

Before, when the effort property has been set, the user lost control to
explicitly set the timer to a different time.
2016-06-14 21:49:44 +02:00
Marco Wahl 1aef73caa4 Fix a compiler warning
* lisp/org-clock.el (org-clock-timestamps-change): Switch to the
  seasonable interface for subtracting times.
2016-06-14 20:49:20 +02:00
Charles Berry dd944fb590 org-babel-goto-named-src-block bugfix
* lisp/ob-core.el (org-babel-goto-named-src-block): The user prompt
  (i.e. `initial-input' arg of `completing-read') will be the name of
  the results block, noweb reference, call reference, or symbol if
  point is in such.

* testing/lisp/test-ob.el (test-ob/goto-named-src-block): Simulate
  interactive use of `org-babel-goto-named-src-block'.
2016-06-14 09:40:35 -07:00
Nicolas Goaziou 65e4370d46 Merge branch 'maint' 2016-06-11 13:40:52 +02:00
Nicolas Goaziou 819cdb3a09 Preserve list visibility when inserting a new item
* lisp/org.el (org-insert-heading): Do not reveal gratuitously too much
  context before inserting an item.
* testing/lisp/test-org.el (test-org/insert-heading): Add test.

Reported-by: Steinar Bang <sb@dod.no>
<http://permalink.gmane.org/gmane.emacs.orgmode/107665>
2016-06-11 13:33:50 +02:00
Nicolas Goaziou 0603f42cb7 org-element: Fix inline src blocks parameter syntax
* lisp/org-element.el (org-element--parse-paired-brackets): New function.
(org-element-inline-babel-call-parser):
(org-element-inline-src-block-parser): Use new function.

* testing/lisp/test-org-element.el (test-org-element/inline-src-block-parser):
Add test.

Reported-by: Charles Millar <millarc@verizon.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/107629>
2016-06-10 23:42:50 +02:00
Nicolas Goaziou b9c64b1ecb Merge branch 'maint' 2016-06-10 18:24:55 +02:00
Nicolas Goaziou c07175bfaa Remove reference to removed function in menu
* lisp/org.el (org-org-menu): Remove reference to
  `org-beamer-insert-options-template'.

Reported-by: Giacomo M <jackjackk@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107658>
2016-06-10 18:22:16 +02:00
Rasmus af463605f1 Document org-block face changes
* doc/org.texi (Editing source code): Document org-block and
  org-block-LANG faces.
* lisp/org-faces.el (org-block): Mention org-block-LANG faces.
* lisp/org.el (org-src-fontify-natively): Add reference to org-block.
* etc/ORG-NEWS: Update entry.
2016-06-10 10:11:03 +02:00
Rasmus b0def38b4b org-src: Allow per language block face
* lisp/org-src.el (org-src-font-lock-fontify-block):
* lisp/org.el (org-fontify-meta-lines-and-blocks-1): Allow per-block
  face.

Suggested-by: Karl Voit <devnull <at> Karl-Voit.at>
<http://thread.gmane.org/gmane.emacs.orgmode/103833/focus=107645
2016-06-10 09:20:30 +02:00
Rasmus 81af689d0f org-src: Src-blocks also inherit org-block face
* lisp/org-src.el (org-src-font-lock-fontify-block): Inherit org-block
  face in addition to language specific faces.
* etc/ORG-NEWS: Add entry.
2016-06-09 16:18:17 +02:00
Marco Wahl 7e57cf5d40 org: Fix tags extraction
* lisp/org.el (org-get-tags-at): Use non-greedy match up to colon to
  match all tags (and not just the last.)
* testing/lisp/test-org.el (test-org/tags-at): One test to cover the
  issue.
2016-06-09 10:06:14 +02:00
Nicolas Goaziou f94df5456f ox-texinfo: Add support for strike-through and underline markup
* lisp/ox-texinfo.el (texinfo): Add transcoders.
(org-texinfo-text-markup-alist): Allow `strike-though' and `underline'
as keys.  Remove unused `comment'.
(org-texinfo-strike-through):
(org-texinfo-underline): New functions.

By default, new markup produce no Texinfo code, but can be customized by
users for specific uses.
2016-06-04 22:40:21 +02:00
Nicolas Goaziou 6daad64277 org-compat: Silence byte-compiler 2016-06-04 22:09:15 +02:00
Nicolas Goaziou 2c70283641 org-colview: Fix docstrings
* lisp/org-colview.el (org-columns--summary-min-age):
(org-columns--summary-max-age):
(org-columns--summary-mean-age): Fix argument name in docstrings.
2016-06-04 21:29:27 +02:00
Don March bd49486db9 Make today's deadlines "close" without lead time
* lisp/org.el (org-deadline-close): A timestamp is close if the days
  between now and the timestamp are less then or equal to the days of
  lead time.

* testing/lisp/test-org.el: Add tests for org-deadline-close.
2016-06-04 20:45:41 +02:00
Don March 42620c1efa Rename org-deadline-is-close to have -p suffix
* lisp/org-agenda.el
  (org-agenda-check-for-timestamp-as-reason-to-ignore-todo-item):
* lisp/org.el (org-deadline-close): Rename to...
  (org-deadline-close-p): ...this.

* testing/lisp/test-org.el (test-org/deadline-close): Rename to...
  (test-org/deadline-close-p): ...this.
2016-06-04 20:39:15 +02:00
Don March 43b5ca1626 Make today's deadlines "close" without lead time
* lisp/org.el (org-deadline-close): A timestamp is close if the days
  between now and the timestamp are less then or equal to the days of
  lead time.

* testing/lisp/test-org.el: Add tests for org-deadline-close.
2016-06-04 20:39:15 +02:00
Nicolas Goaziou 3fd361eb77 Merge branch 'maint' 2016-06-02 13:33:34 +02:00
Yasushi SHOJI 361fa80eba Fix tag width calculation for multi-column chars
* lisp/org.el (org-align-tags-here): Fix tag width calculation for
  multi-column chars.

Some characters have multiple column width.  Calculating string width
with points gives a wrong value than actual display width.  Use
`string-width' instead.

Here is an ECM for this problem.  `M-x org-update-statistics-cookies` or
`C-c #` on bar moves the tag on the headline.

* foo [0/0]								🔤
** child
* bar [0/0]							     :日本語:
** child
12345678901234567890123456789012345678901234567890123456789012345678901234567890
         1         2         3         4         5         6         7         8
2016-06-02 13:31:09 +02:00
Nicolas Goaziou ecf20715e2 Merge branch 'maint' 2016-06-01 14:54:20 +02:00
Nicolas Goaziou 1f3d72e8b4 Fix TODO case-sensitivity in `org-get-heading'
* lisp/org.el (org-get-heading): Prevent removing false-positive TODO
  keywords due to case-insensitivity.
* testing/lisp/test-org.el (test-org/get-heading): New test.
2016-06-01 14:49:59 +02:00
Nicolas Goaziou 319c05f1dc Merge branch 'maint' 2016-06-01 00:44:55 +02:00
Nicolas Goaziou a1df8cfe71 Fix case-sensitivity of TODO keywords in imenu
* lisp/org.el (org-imenu-get-tree): Todo keywords are case-sensitive.

Reported-by: Georgiy Tugai <georgiy.tugai@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107500>
2016-06-01 00:43:28 +02:00
Nicolas Goaziou 11d6ebc60f 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.
2016-05-31 23:34:14 +02:00
Nicolas Goaziou 21ba5f510e 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>
2016-05-31 23:34:00 +02:00
Nicolas Goaziou 3d0ade9571 By default, use relative name for compilation
* lisp/org.el (org-compile-file): %f meant relative name of compiled
  file.  %F is its full name.  Also always set `default-directory' to
  the directory of the source.

Reported-by: Stig Brautaset <stig@brautaset.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/107348>
2016-05-30 00:13:22 +02:00
Nicolas Goaziou cf77060d18 Fix last commit
* lisp/org.el (org-edit-headline): Fix `save-match-data' scope.

`org-trim' modifies match data. `read-string' doesn't.
2016-05-30 00:02:27 +02:00
Marco Wahl 127f86bdc5 org: Fix interactive headline edit
* lisp/org.el (org-edit-headline): Save match-data before calling
  read-string.
2016-05-28 12:01:14 +02:00
Nicolas Goaziou f2c421d3c0 org-compat: Fix last commit
* lisp/org-compat.el (org-with-silent-modifications): Remove spurious
  definition introduced in last commit.
2016-05-26 16:41:17 +02:00
Nicolas Goaziou 0dfb046983 org-compat: Silence byte-compiler 2016-05-26 16:29:40 +02:00
Nicolas Goaziou bf5ebe1fdd Silence byte-compiler in Emacs 25.1
* lisp/org-compat.el (org-get-x-clipboard): Use `gui-get-selection',
  which obsoletes `x-get-selection'.  Define the former as an alias for
  the latter for backward compatibility.
2016-05-26 16:22:20 +02:00
Nicolas Goaziou 770711153d org-macro: Use cl-lib 2016-05-26 16:16:31 +02:00
Nicolas Goaziou 6176357b47 org-table: Add missing "cl-" prefixes
* lisp/org-table.el (org-table--descriptor-line):
(org-table--row-type): Add "cl-" prefixes.
2016-05-26 16:12:42 +02:00
Nicolas Goaziou f9ad16b22a ob-core: Do not require `cl' since `cl-lib' is used
* lisp/ob-core.el (org-babel-merge-params):
(org-babel-noweb-p):
(org-babel--script-escape-inner): Use "cl-" prefix.
2016-05-26 16:11:06 +02:00
Nicolas Goaziou 82f834ea90 ox-icalendar: Do not require `cl' since `cl-lib' is used
* lisp/ox-icalendar.el (org-icalendar-get-categories):
(org-icalendar-entry):
(org-icalendar--vevent): Use "cl-" prefix.
2016-05-26 16:08:15 +02:00
Nicolas Goaziou a169e43a77 org-table: Do not require `cl' since `cl-lib' is used
* lisp/org-table.el (org-table-align):
(org-table-current-column):
(org-table-current-dline):
(org-table-sort-lines):
(org-table-paste-rectangle):
(org-table-analyze):
(org-table-get-range):
(org-table--row-type):
(org-table-recalculate):
(org-table-expand-lhs-ranges):
(org-table-formula-handle-first/last-rc):
(org-table-formula-substitute-names):
(orgtbl-send-table):
(orgtbl-to-generic): Use "cl-" prefix.
2016-05-26 16:06:09 +02:00
Nicolas Goaziou e8120fbd55 ox-beamer: Do not require `cl' since `cl-lib' is used
* lisp/ox-beamer.el (org-beamer--normalize-argument):
(org-beamer-link): Use "cl" prefix.
2016-05-26 15:57:11 +02:00
Nicolas Goaziou 0ac099a6f8 Remove final parts of XEmacs compatibility code
* lisp/org-compat.el: Declare `org-add-hook', `org-decompose-region',
  `org-detach-overlay', `org-file-equal-p', `org-float-time',
  `org-indent-line-to', `org-indent-to-column', `org-looking-at-p',
  `org-looking-back', `org-propertize', `org-re' and
  `org-select-frame-set-input-focus' as obsolete.
(org-overlay-display, org-overlay-before-string, org-find-overlays):
Move to "org.el"
(org-xemacs-key-equivalents, org-xemacs-p): Remove variables.
(org-region-active-p): Drop XEmacs support.
(org-xemacs-without-invisibility): Remove macro.
(org-get-x-clipboard-compat): Remove function.
* lisp/org-macs.el (org-match-string-no-properties): Remove function.

* lisp/ob-core.el:
* lisp/org-agenda.el:
* lisp/org-archive.el:
* lisp/org-clock.el:
* lisp/org-colview.el:
* lisp/org-crypt.el:
* lisp/org-element.el:
* lisp/org-faces.el:
* lisp/org-feed.el:
* lisp/org-footnote.el:
* lisp/org-habit.el:
* lisp/org-id.el:
* lisp/org-indent.el:
* lisp/org-inlinetask.el:
* lisp/org-lint.el:
* lisp/org-list.el:
* lisp/org-mouse.el:
* lisp/org-pcomplete.el:
* lisp/org-src.el:
* lisp/org-table.el:
* lisp/org-timer.el:
* lisp/org.el:
* lisp/ox-ascii.el:
* lisp/ox-odt.el:
* lisp/ox.el:
* contrib/lisp/org-notify.el:
* contrib/lisp/ox-taskjuggler.el:
* contrib/lisp/org-wikinodes.el:
* testing/lisp/test-org-src.el:
* testing/lisp/test-org.el: Silence byte-compiler.
2016-05-26 13:56:25 +02:00
Nicolas Goaziou 4129ae6737 Remove some XEmacs compatibility layer
* lisp/ob-calc.el (calc-trail):
* lisp/ob-python.el (org-babel-python-mode):
* lisp/org-agenda.el (org-agenda-tags-column):
(org-agenda-show-new-time):
* lisp/org-clock.el (org-clock-update-mode-line):
(org-clock-put-overlay):
(org-clock-resolve):
* lisp/org-faces.el (org-faces):
* lisp/org-indent.el (org-indent-mode):
* lisp/org-macs.el (org-load-noerror-mustsuffix):
* lisp/org-table.el (orgtbl-setup):
* lisp/org.el (org-key):
(org-self-insert-cluster-for-undo):
(org-tags-column):
(org-emphasis-alist):
(org-mode):
(org-set-font-lock-defaults):
(org-cycle-internal-local):
(org-tree-to-indirect-buffer):
(org-set-frame-title):
(org-priority):
(org-set-tags):
(org-set-current-tags-overlay):
(org-toggle-time-stamp-overlays):
(org-display-custom-time):
(org-diary-to-ical-string):
(org--format-latex-make-overlay):
(org-dvipng-color):
(org-latex-color):
(org-mode-map):
(org-speed-commands-default):
(org-reload):
(org-display-warning):
(org-end-of-line):
* lisp/ox-man.el (org-man-inline-src-block):
* contrib/lisp/org-vm.el (org-vm-follow-link):
* contrib/lisp/ox-groff.el (org-groff-inline-src-block):
(org-groff-src-block): Remove some XEmacs compatibility layer.
2016-05-26 11:30:11 +02:00
Nicolas Goaziou 84f8c9a226 ox-latex: Use "cl-lib"
* lisp/ox-latex.el (org-latex--label):
(org-latex--caption/label-string):
(org-latex--find-verb-separator):
(org-latex--text-markup):
(org-latex-inline-src-block):
(org-latex-item):
(org-latex-keyword):
(org-latex--inline-image):
(org-latex-link):
(org-latex-plain-text):
(org-latex-matrices):
(org-latex--script-size):
(org-latex--align-string):
(org-latex--table.el-table):
(org-latex-timestamp): Use "cl-" prefix.
2016-05-26 11:03:11 +02:00
Nicolas Goaziou 5ac93681b2 Merge branch 'maint' 2016-05-26 10:55:00 +02:00
Nicolas Goaziou 655fb33967 org-agenda: Effectively preserve persistent bulk marks
* lisp/org-agenda.el (org-agenda-change-all-lines): Preserve bulk mark
  overlay when replacing an entry.

Reported-by: Jesse Johnson <holocronweaver@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107299>
2016-05-26 10:51:58 +02:00
Nicolas Goaziou 4c58ee0a4b org-agenda: Add missing docstring
* lisp/org-agenda.el (org-agenda-bulk-marked-p): Add missing docstring.
2016-05-26 10:51:27 +02:00
Rasmus 9dbeaa278d ox-latex: Fix bug introduced in 888ebfdeaf
* lisp/ox-latex.el (org-latex-footnote-reference): Handle anonymous
  footnotes.

Reported-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
<http://permalink.gmane.org/gmane.emacs.orgmode/107381>
2016-05-25 19:48:51 +02:00
Rasmus 888ebfdeaf ox-latex: More robust repeated footnote references
* lisp/ox-latex.el (org-latex--delayed-footnotes-definitions): Fix typo
  in docstring.
(org-latex-footnote-defined-format): New defcustom.
(org-latex-footnote-reference): Refer to repeated footnotes using
labels.  Format using new defcustom.
* etc/ORG-NEWS: Mention change.
* doc/org.texi (Publishing options): Add new defcustom.
2016-05-25 09:14:52 +02:00
Rasmus 21fa7efa99 ox-org: Add footnote prefix
* lisp/ox-org.el (org-org-section): Add mandatory "fn" prefix to
  footnotes.

Reported-by: Nick Dokos <ndokos@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107366>
2016-05-25 08:51:13 +02:00
Feng Shu 2a8a8b3109 Fix typo
* org.el (org-preview-latex-process-alist): Fix typo in docstring.
2016-05-24 22:23:23 +02:00
Nicolas Goaziou 96cfef229d ox: Small refactoring
* lisp/ox.el (org-export-get-loc): Refactor code.  Speed-up processing
  when the element doesn't require line numbering.
* testing/lisp/test-ox.el (test-org-gen-loc-list): Reformat code.
2016-05-24 21:40:43 +02:00
Brian Carlson af8e3d84ee ox: Provide offset to [+-]n in SRC/EXAMPLE export
* lisp/org-element.el (org-element-example-block-parser): Use cons cell
  for :number-lines specifying offset in addition to type (new/continue).
  ('continue . offset) for :number-lines will add this offset count to
  the last line number. ('new . offset) for :number-lines will reset the
  line number counting starting at offset
(org-element-src-block-parser): same for SRC block as EXAMPLE block

* lisp/ox-html.el (org-html-format-code):
* lisp/ox-latex.el (org-latex-src-block):
* lisp/ox-odt.el (org-odt-format-code):
* lisp/ox.el (org-export-resolve-coderef):
(org-export-get-loc):
(org-export-format-code-default):
* contrib/lisp/ox-groff.el (org-groff-src-block): Use new cons cell
  for :number-lines.

* testing/lisp/test-ox.el  (ert-deftest test-org-export/get-loc): Tests for
changes
(test-org-gen-loc-list): Helper function for `test-org-export/get-loc'.
2016-05-24 21:40:35 +02:00
Feng Shu 6826ccdebc Latex previewing: imagemagick use pdflatex by default
* org.el (org-preview-latex-process-alist): Use "pdflatex" instead of
  "latex".
2016-05-24 19:27:29 +02:00
Trevor Murphy c20f51ccc0 Place `org-clock-heading' outside clock time
* org-clock.el (org-clock-get-clock-string): When `org-clock-effort'
  is nil, arrange the format string components separately, similar to
  how they are arranged when o-c-e is not-nil.
2016-05-23 22:46:54 +02:00
Rasmus 9488d13094 Merge branch 'maint' of orgmode.org:org-mode into maint 2016-05-23 09:06:56 +02:00
Rasmus 58f5def625 ox-latex.el: Format-spec checks Polyglossia
* ox-latex.el (org-latex--format-spec): Also check Polyglossia language.
2016-05-23 09:00:54 +02:00
Rasmus 42bc27b473 Merge branch 'maint' 2016-05-23 08:59:29 +02:00
Rasmus 8c968a9697 ox-latex: Detect languages irrespective of case
* ox-latex.el (org-latex-guess-babel-language):
* ox-latex.el (org-latex--format-spec): Detect languages correctly
  irrespective of case.
2016-05-23 08:45:54 +02:00
Nicolas Goaziou 3c729c7c0b Merge branch 'maint' 2016-05-23 01:20:17 +02:00
Nicolas Goaziou 6105643903 org-table: Fix 4914f89
* lisp/org-table.el (orgtbl-setup): Fix improper key binding
  specification.

Reported-by: Alex <agrambot@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107287>
2016-05-23 01:19:29 +02:00
Nicolas Goaziou dba7652445 Merge branch 'maint' 2016-05-23 01:17:23 +02:00
Nicolas Goaziou f311921ad3 org-list: Fix `org-list-send-list' in LaTeX buffers
* lisp/org-list.el (org-list-send-list): Find correct translator.

Reported-by: Charles Millar <millarc@verizon.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/107290>
2016-05-23 01:12:51 +02:00
Rasmus 9a7bf6d649 Merge branch 'maint' 2016-05-22 15:31:27 +02:00
Rasmus d07fafed4a ox-html: Find preamble-spec case-insensitively
* ox-html.el (org-html--build-pre/postamble): Find the spec based on the
  language case-insensitively.

Note that the default org-html-preamble-format and
org-export-default-language are incompatible.
2016-05-22 15:30:11 +02:00
Nicolas Goaziou 2ed5e64a74 Merge branch 'maint' 2016-05-21 14:41:38 +02:00
Nicolas Goaziou 4914f89644 org-table: Fix DEL using orgtbl minor mode in prog derived mode
* lisp/org-table.el (orgtbl-setup): Hijack DEL key.  We also hijack
  `delete-backward-char' but major modes derived from `prog-mode'
  usually bypass it.

Reported-by: Alex G <agrambot@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107232>
2016-05-21 14:39:26 +02:00
Feng Shu bf93e166be Use dvisvgm to preview latex formulas
* ox-html.el (org-html-with-latex): Add dvisvgm support.
(org-html-with-latex): Add dvisvgm support.
(org-html-format-latex): "ltxpng" -> "ltximg".
(org-html-latex-environment): Add dvisvgm support.
(org-html-latex-fragment): Add dvisvgm support.

* org.el (org-preview-latex-default-process): New variable.
(org-latex-create-formula-image-program): Rename it to `org-preview-latex-default-process'.
(org-latex-preview-ltximg-directory): Rename it to `org-preview-latex-image-directory'.
(org-preview-latex-image-directory): New variable.
(org--format-latex-make-overlay): Add optional image-type, which used to deal with svg.
(org-toggle-latex-fragment): "org-ltxpng" -> "org-ltximg".
(org-format-latex): Add dvisvgm support.
(org-create-formula-image): Big refactor, merge dvipng and imagemagick
backend's feature.  Add dvisvgm feature.
(org-preview-latex-process-alist): Add new variable, which used to set
latex preview processes.
(org-create-formula-image-with-dvipng):
(org-create-formula-image-with-imagemagick): Useless, removed.

* org.texi (@LaTeX{} fragments):
(Previewing @LaTeX{} fragments):
(Math formatting in HTML export):
(Working with @LaTeX{} math snippets): Add dvisvgm information.
2016-05-21 10:50:38 +02:00
Nicolas Goaziou a5f83857c1 Merge branch 'maint' 2016-05-20 23:05:59 +02:00
Nicolas Goaziou 1d2f52f487 org-table: Fix orgtbl-self-insert-command on white spaces
* lisp/org-table.el (orgtbl-self-insert-command): Properly overwrite
  white spaces when there is room for it.  This is on par with what
  `org-self-insert-command' does in Org tables.

Reported-by: Alex <agrambot@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/107112>
2016-05-20 23:03:18 +02:00
Nicolas Goaziou e234643d92 Fix `org-open-at-point-global'
* lisp/org.el (org-open-at-point-global): Handle any external link
  looking like an Org link or time-stamp.

Reported-by: Uwe Brauer <oub@mat.ucm.es>
<http://permalink.gmane.org/gmane.emacs.orgmode/107220>
2016-05-20 22:04:11 +02:00
Nicolas Goaziou 2d846210eb Implement conditional case-fold search in org-occur
* lisp/org.el (org-occur-case-fold-search): New variable.
(org-occur): Use new variable.

* testing/lisp/test-org.el (test-org/occur): Add tests.
2016-05-20 14:04:04 +02:00
Nicolas Goaziou 11e2df8091 ob-exp: Small speed-up
* lisp/ob-exp.el (org-babel-exp-src-block): Refer to block position
  instead of line.

`org-current-line' is costly in large buffers.
2016-05-20 13:41:16 +02:00
Nicolas Goaziou 8eb582b951 ox-texinfo: Allow :options attribute on special blocks
* lisp/ox-texinfo.el (org-texinfo-special-block): Handle :options
  attribute.
* doc/org.texi (Texinfo specific attributes): Add special block section.
2016-05-19 19:15:55 +02:00
Nicolas Goaziou 920cfbd921 org-agenda: Fix agenda filter by empty tag string
* lisp/org-agenda.el (org-agenda-filter-make-matcher-tag-exp): Handle
  empty tag strings.

Reported-by: Eric Abrahamsen <eric@ericabrahamsen.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/107121>
2016-05-19 10:31:27 +02:00
Nicolas Goaziou ea1147a479 Add `org-compile-file' and `org-file-newer-than-p'
* lisp/org.el (org-compile-file):
(org-file-newer-than-p): New functions.

* lisp/ox-latex.el (org-latex-compile): Use new functions.

* lisp/ox-man.el (org-man-compile): Use new functions.
(org-man-collect-errors): Remove it.

* lisp/ox-texinfo.el (org-texinfo-compile): Use new functions.
(org-texinfo-collect-errors): Remove function as it is not accurate
enough (e.g., it doesn't handle internationalization).
2016-05-19 09:44:05 +02:00
Kyle Meyer 14f853dceb ox-publish: Correct docstring typo
* lisp/ox-publish.el (org-publish-project-alist): Correct typo in
  docstring.
2016-05-18 22:05:41 -04:00
Kyle Meyer 4efae4f1ff Adjust function declaration changes from 291938d
* lisp/org-macro.el (org-with-wide-buffer): Remove unnecessary
declaration.
(vc-call): Signal that FN is not a defun.  Match arguments.
2016-05-18 22:05:36 -04:00
Rasmus 291938d0b0 org-macro.el: Allow modification-time from vc.el
* org-macro.el (org-macro--vc-modified-time): New function.
* org-macro.el (org-macro-initialize-templates): Add support for new
  function.
* doc/org.texi (Macro replacement): Document new behavior.
* etc/ORG-NEWS: Mention new behavior.
2016-05-18 21:39:37 +02:00
Rasmus 44ad9ff3e4 ox-publish.el: Document `:recursive'
* ox-publish.el (org-publish-project-alist): Document `:recursive'.
2016-05-18 12:00:17 +02:00
Nicolas Goaziou ad766435dc Merge branch 'maint' 2016-05-16 11:21:05 +02:00
Phil Hudson 5fc351ab78 org-capture: Support all capture template target-file variants in Customize
* lisp/org-capture.el (`org-capture-templates'): Adjust the
  `org-capture-templates' defcustom template to support specifying the capture
  target file using either a literal pathname, a function, a variable or a
  form, as documented.  Previously the Customize UI supported specifying only a
  literal pathname.
  (org-capture-templates): Clarify the documentation for the `function' method
  for setting up the capture target.

* doc/org.texi (Template elements): Clarify the `function' method for setting up
  the capture target.
2016-05-16 11:17:26 +02:00
Kyle Meyer d1fb75bc17 ob-comint: Remove unnecessary function declarations
These aren't needed because tramp is explicitly loaded.
2016-05-15 19:57:17 -04:00
Kyle Meyer d38e91867c Fix remaining declare-function issues on master
* lisp/org-list.el (org-export-create-backend):
Indicate that FN is not a defun.
* lisp/org-list.el (org-export-create-backend):
(org-export-data-with-backend):
(org-export-get-backend):
(org-export-get-environment):
(org-export-get-next-element):
(org-export-with-backend):
Correct source file name.
* lisp/org.el (calendar-check-holidays):
(org-agenda-format-item):
Correct argument list.
2016-05-15 19:16:30 -04:00
Kyle Meyer 4925d5be7b Merge branch 'maint' 2016-05-15 19:00:30 -04:00
Kyle Meyer 19cf68da90 Fix remaining declare-function issues
* lisp/ob-shell.el (org-babel-comint-in-buffer):
(org-babel-comint-with-output):
* lisp/org-table.el (org-export-create-backend):
* lisp/org.el (org-babel-do-in-edit-buffer): Indicate that FN is not a
defun.
* lisp/ob-tangle.el (org-string-nw-p):
* lisp/org-table.el (org-export-create-backend):
(org-export-data-with-backend):
(org-export-filter-apply-functions):
(org-export-first-sibling-p):
(org-export-get-backend):
(org-export-get-environment):
(org-export-install-filters):
(org-export-table-has-special-column-p):
(org-export-table-row-is-special-p): Correct source file name.
* lisp/ob-R.el (ess-wait-for-process):
* lisp/org-clock.el (calendar-iso-to-absolute):
* lisp/org-list.el (org-previous-line-empty-p):
* lisp/org-pcomplete.el (org-entry-properties):
* lisp/org-table.el (org-export-data-with-backend):
(org-export-get-environment):
* lisp/org.el (org-element-interpret-data): Correct argument list.
2016-05-15 18:59:20 -04:00
Kyle Meyer e712f17822 org-compat: Quiet font-lock-fontify-buffer warning
* lisp/org-compat.el (org-font-lock-ensure): Quiet byte compiler warning
  about font-lock-fontify-buffer.
2016-05-15 18:59:19 -04:00
Kyle Meyer 3b8fc502b9 org-compat: Check for w32-focus-frame
* lisp/org-compat.el (org-select-frame-set-input-focus): Check for
  w32-focus-frame to quiet byte compiler.

Don't use declare-function because this function was marked obsolete in
Emacs 23.1 (44fe0f6).
2016-05-15 18:59:19 -04:00
Kyle Meyer 0e0963acbf org-gnus: Check nnimap-group-overview-filename
* lisp/org-gnus.el (org-gnus-nnimap-cached-article-number): Check that
  nnimap-group-overview-filename, which was removed from Emacs in 2010,
  is defined before calling.
2016-05-15 18:59:19 -04:00
Kyle Meyer 1c9bb0dba8 Fix up last backport
* lisp/org.el (org-export-backend-options): Add back removed
declare-function call.
* lisp/ob-awk.el (orgtbl-to-generic):
* lisp/ob-core.el (orgtbl-to-generic):
* lisp/ob-gnuplot.el (orgtbl-to-generic): Remove BACKEND argument from
declare-function calls.

The last backport added this argument to match orgtbl-to-generic's
signature in Emacs's version of Org, but the BACKEND argument to
orgtbl-to-generic was later removed in 9209aa3 (org-table: Use "ox.el"
internally for radio tables, 2014-08-24).
2016-05-15 18:59:19 -04:00
Paul Eggert 1f046ea4b1 Backport commit 65c8c7c from Emacs
* lisp/ob-awk.el (orgtbl-to-generic):
* lisp/ob-core.el (orgtbl-to-generic):
* lisp/ob-exp.el (org-element-context):
* lisp/ob-gnuplot.el (org-time-string-to-time)
(orgtbl-to-generic):
* lisp/ob-haskell.el (org-export-to-file):
* lisp/ob-latex.el (org-create-formula-image)
(org-latex-compile):
* lisp/ob-python.el (run-python):
* lisp/ob-tangle.el (org-link-escape, org-back-to-heading):
* lisp/org-colview.el (org-agenda-redo):
* lisp/org-feed.el (url-retrieve-synchronously):
* lisp/org-info.el (Info-find-node):
* lisp/org-list.el (org-previous-line-empty-p):
* lisp/org-macs.el (org-string-match-p):
* lisp/org.el (org-beamer-mode):
Fix prototype to match current definition.
* lisp/ob-comint.el (tramp-flush-directory-property):
* lisp/ob-tangle.el (org-babel-update-block-body):
* lisp/org-bibtex.el (org-babel-trim):
* lisp/org-pcomplete.el (org-export-backend-options):
* lisp/org-protocol.el (org-publish-get-project-from-filename):
Fix file name in declare-function.
* lisp/ob-comint.el (with-parsed-tramp-file-name)
* lisp/ob-core.el (with-parsed-tramp-file-name):
* lisp/org.el (org-beamer-mode):
Append ‘t’ to declare-function, since the declaration isn’t a defun.
* lisp/ob-core.el (org-save-outline-visibility):
Remove; not needed.
* lisp/ob-scheme.el (run-geiser, geiser-mode)
(geiser-eval-region, geiser-repl-exit):
* lisp/ox-org.el (htmlize-buffer):
Prepend "ext:" to file name, since it is not part of Emacs.
* lisp/org-gnus.el (nnimap-group-overview-filename):
Remove decl, since function was removed.
* lisp/org-macro.el (org-with-wide-buffer):
Omit unnecessary (and mismatching) decl.
* lisp/org-clock.el (calendar-iso-to-absolute):
Declare calendar-iso-to-absolute instead, since it is the
non-obsolete version of this function.
* lisp/org-compat.el (w32-focus-frame):
Remove decl, since function is now obsolete.

Pacify ‘make check-declare’
65c8c7cb96c14f9c6accd03cc8851b5a3459049e
Paul Eggert
Sat May 14 19:57:44 2016 -0700
2016-05-15 18:59:16 -04:00
Nicolas Goaziou e4eebe97ec ox-org: Handle export blocks
* lisp/ox-org.el (org-org-export-block): New function.
2016-05-13 17:57:11 +02:00
Nicolas Goaziou a540e894b6 org-element: Properly unescape data in export blocks
* lisp/org-element.el (org-element-export-block-parser): Remove commas
  in export blocks.
* testing/lisp/test-org-element.el (test-org-element/export-block-parser):
  Add test.
2016-05-13 17:55:30 +02:00
Nicolas Goaziou 1c923b9ae7 org-src: Allow writing remote edit buffers to file
* lisp/org-src.el (org-src-mode-configure-edit-buffer): Do not treat
  each save as meant to save source buffer.

Reported-by: David Dynerman <david@block-party.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/106998>
2016-05-11 23:18:38 +02:00
Nicolas Goaziou 702bab9ee2 Merge branch 'maint' 2016-05-11 22:50:38 +02:00
Nicolas Goaziou 34dc298869 org-agenda: Fix `org-agenda-bulk-custom-functions' supported Customize type
* org-agenda.el (`org-agenda-bulk-custom-functions'): Change the defcustom
  template to recognize that the code expects this alist's elements to be
  two-element lists like (?a b), not conses like (?a . b).

The Customize UI previously incorrectly presented the latter.  When
saved, this led to the agenda bulk-commands menu correctly presenting
the accelerator key 'a' but then erroring when it tried to execute the
associated command 'b'.
2016-05-11 22:49:25 +02:00
Nicolas Goaziou b687cf37a5 Merge branch 'maint' 2016-05-11 18:46:28 +02:00
Nicolas Goaziou ee5d40b001 org-clock: Fix `org-clock-drawer-name'
* lisp/org-clock.el (org-clock-drawer-name): When
  `org-clock-into-drawer' is a number and `org-log-into-drawer' is t,
  default to "LOGBOOK".

* testing/lisp/test-org-clock.el (test-org-clock/into-drawer):
(test-org-clock/drawer-name): New tests.
2016-05-11 18:44:02 +02:00
Charles Berry 779222eba5 ob-comint.el: Require `tramp' and declare tramp functions
* ob-comint.el (org-babel-comint-eval-invisibly-and-wait-for-file):
  The tramp macro `with-parsed-tramp-file-name' invokes a bunch of
  tramp functions.  These are now declared and tramp is explicitly
  required.
2016-05-10 18:22:03 -07:00
Nicolas Goaziou 9210300260 Merge branch 'maint' 2016-05-10 23:08:34 +02:00
Nicolas Goaziou d1786a0908 org-clock: Fix generated drawer when `org-clock-into-drawer' is numerical
* lisp/org-clock.el (org-clock-find-position): Create a default
  "LOGBOOK" drawer when `org-clock-into-drawer' is a numeric value.

Reported-by: Carlos Noguera <carlos.francisco.noguera@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106886>
2016-05-10 22:42:38 +02:00
Robert Klein 59237bc028 ox-html: Support more programming languages in CSS
* lisp/ox-html.el (org-html-style-default): Add languages.

The standard CSS for HTML export only supported a couple of
programming languages to have a language name "hover" on src
blocks.  This patch adds all languages supported per Org
manual, those from org.el's org-babel-load-languages-alist,
additional language identifiers in ob-*.el and languages
which have a) an emacs mode and b) are supported by the LaTeX
listings package.  Additional a language "conf" is supported
for generic configuraiton files; an emacs mode exists for
this, but for LaTeX listings a language " " has to be faked.
As this patch is for HTML, this is no impediment.

Thanks for reporting the missing support to Tianxian XIONG.
2016-05-10 22:21:21 +02:00
Nicolas Goaziou 8127b3c30d Merge branch 'maint' 2016-05-05 13:15:34 +02:00
Nicolas Goaziou 83e373f109 Fix `org-occur' when regexp matches a single char
* lisp/org.el (org-occur): Fix infloop when regexp matches a single
  char.  Improve docstring.

(org-check-before-date):
(org-check-after-date):
(org-check-dates-range): Match correct object since point may be at the
beginning of the next one.

* testing/lisp/test-org.el (test-org/occur): New test.
2016-05-05 12:59:46 +02:00
Nicolas Goaziou 1ca1d52e92 Fix `org-occur' when called non-interactively
* lisp/org.el (org-first-headline-recenter): Check if current buffer is
  actually displayed in a window before trying to recenter view.
2016-05-05 11:55:00 +02:00
Nicolas Goaziou 3308a5ecfe Merge branch 'maint' 2016-05-04 14:23:57 +02:00
Nicolas Goaziou 8638c14fbd org-agenda: Fix error on empty headlines
* lisp/org-agenda.el (org-agenda-get-timestamps):
(org-agenda-get-deadlines):
(org-agenda-get-scheduled):
(org-agenda-get-blocks): Handle empty headlines.
2016-05-04 14:20:09 +02:00
Chunyang Xu b46527a8ba org-capture: Adapt user-error for aborting by user
* lisp/org-capture.el (org-capture):
(org-mks): Replace `error' with `user-error'.

When `org-capture` is aborted by user with 'q' or 'C-g', `user-error' is
better than `error' when exiting.

TINYCHANGE
2016-05-03 19:17:34 +02:00
Rainer M. Krug d87bf07ea6 ob-plantuml: Add new output formats
* lisp/ob-paltuml (org-babel-execute:plantuml): add new output formats
  of plantuml:
  - pdf : this needs extra java mudules to run which are mentioned on the
    plantml website (http://fr.plantuml.com/pdf.html)
  - vdx
  - xmi
  - scxml
  - html
  - txt (ascii art)
  - utxt (ascii art using unicode)

  The output format is based on the extension of the output file.
2016-05-03 19:13:50 +02:00
Nicolas Goaziou 36dbdb9465 Fix keywords in defcustom
* lisp/org.el (org-show-context-detail): Fix keywords according to
  commit c112f40.
2016-05-01 01:32:16 +02:00
Nicolas Goaziou 590cb1227a Merge branch 'maint' 2016-05-01 01:30:57 +02:00
Nicolas Goaziou af853dd3aa Fix `org-flag-drawer' with optional argument
* lisp/org.el (org-flag-drawer): Do not require point to be at a drawer
  in order to call the function with an optional argument.

* testing/lisp/test-org.el (test-org/flag-drawer): Narrow test.
2016-05-01 01:27:30 +02:00
Nicolas Goaziou bb034dfe04 `org-show-context' always displays point
* lisp/org.el (org-show-set-visibility): Always show point, even when it
  is hidden in a block or a drawer.

* testing/lisp/test-org.el (test-org/show-set-visibility): Add tests.

Reported-by: Derek Feichtinger <dfeich@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106744>
2016-05-01 01:14:10 +02:00
Nicolas Goaziou c112f40d51 org-agenda: Remove unnecessary visibility modification
* lisp/org.el (org-show-context-detail): Change default visibility span
  for agenda context.

* lisp/org-agenda.el (org-agenda-goto):
(org-agenda-todo):
(org-agenda-add-note):
(org-agenda-priority):
(org-agenda-set-tags):
(org-agenda-set-property):
(org-agenda-set-effort):
(org-agenda-toggle-archive-tag):
(org-agenda-clock-in): Special visibility is taken care of by
`org-show-context'.  Do not hard-code anything else.

* contrib/lisp/org-contacts.el (org-contacts-gnus-article-from-goto):
Special visibility is taken care of by `org-show-context'.  Do not
hard-code anything else.
2016-04-29 11:35:49 +02:00
Nicolas Goaziou 39cbbca8b6 ox-beamer: Fix "apply: Wrong number of arguments: max, 0"
* lisp/ox-beamer.el (org-beamer-select-environment): Use variable
  introduced in 4743d43.

Reported-by: Jarmo Hurri <jarmo.hurri@iki.fi>
<http://permalink.gmane.org/gmane.emacs.orgmode/106705>
2016-04-28 23:29:17 +02:00
Nicolas Goaziou 3baf246f4f Handle correctly `shift-select-mode'
* lisp/org.el (org-beginning-of-line): Handle correctly `shift-select-mode'.

Reported-by: Mathieu Marques <mathieumarques78@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106783>
2016-04-28 23:28:15 +02:00
Nicolas Goaziou 6ed60a797a Merge branch 'maint' 2016-04-28 22:08:01 +02:00
Nicolas Goaziou c8c2d2b1f7 Fix multiple groups of mutually exclusive tags
* lisp/org.el (org-set-tags): Use a subtler mechansim to remove
  duplicate tags.  This fixes a bug introduced in 77b4fad.

Reported-by: Christoph LANGE <math.semantic.web@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106763>
2016-04-28 22:04:49 +02:00
Nicolas Goaziou ec615b192d Fix `org-export-babel-evaluate' handling
* lisp/ob-exp.el (org-babel-exp-process-buffer): Handle
  `org-export-babel-evaluate' handling.
(org-babel-exp-results): Ignore `org-export-babel-evaluate' since it is
handled as a higher level.

* lisp/ox.el (org-export-as): Allow to short-circuit babel evaluation if
  `org-export-babel-evaluate' is nil.

* testing/lisp/test-ob-exp.el (ob-export/babel-evaluate): New test.

Reported-by: Nicolas Richard <nrichard@ulb.ac.be>
<http://permalink.gmane.org/gmane.emacs.orgmode/106767>
2016-04-28 17:29:14 +02:00
Nicolas Goaziou f227c2f1af Silence byte-compiler 2016-04-28 17:02:29 +02:00
Nicolas Goaziou 9508dc9af2 ox: Internal references are always 10 character long
* lisp/ox.el (org-export-format-reference): Internal references are
  always 10 character long.

This reduces further possible reference clashes with user-defined
labels.
2016-04-26 21:04:41 +02:00
Nicolas Goaziou 1daac70fc5 Merge branch 'maint' 2016-04-26 21:03:45 +02:00
Nicolas Goaziou e818699113 Fix storing links to headlines containing multiple links
* lisp/org.el (org-store-link): Fix storing links to headlines
  containing multiple links.

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

Reported-by: Georgiy Tugai <georgiy.tugai@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106606>
2016-04-26 20:59:33 +02:00
Nicolas Goaziou 00a8275c62 Fix links to elements with a name
* lisp/org.el (org-store-link): Properly handle elements with a NAME
  keyword.
2016-04-26 18:58:01 +02:00
Nicolas Goaziou ce748a7ed5 Merge branch 'maint' 2016-04-26 18:47:43 +02:00
Nicolas Goaziou 91ea3920df ox-ascii: Fix spurious links
* lisp/ox-ascii.el (org-ascii--unique-links): Fix spurious links.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106667>
2016-04-26 18:46:34 +02:00
Charles Berry da4db33132 ob-comint.el: Revert yet another change
* ob-comint.el (org-babel-comint-eval-invisibly-and-wait-for-file):
  Remove the `(ignore v)'.  This creates a byte-compiler warning for
  supposedly unused `v', but allows remote execution.
2016-04-23 17:03:26 -07:00
Charles Berry e1d6a43c8e ob-comint.el: Reinstate let-bound variable from last commit.
* ob-comint.el (org-babel-comint-eval-invisibly-and-wait-for-file):
  Reinstate `let (v)' which `org-babel-evaluate-session' relies on.
2016-04-23 16:33:39 -07:00
Charles Berry e42454088f ob-comint.el: Fix bug and remove unused let binding
* ob-comint.el: (tramp-flush-directory-property declaration): The
  file is now "tramp-cache".

* ob-comint.el (org-babel-comint-eval-invisibly-and-wait-for-file):
  Remove unused let binding for `v' (which is let bound by
  `with-parsed-tramp-file-name').

Bug reported by Vikas Rawal
Subject: Using tramp to run R source code blocks on remote server
Archived-At: <http://permalink.gmane.org/gmane.emacs.orgmode/106557>
2016-04-23 16:07:46 -07:00
Kyle Meyer dfafc869a3 Merge branch 'maint' 2016-04-23 17:40:16 -04:00
Kyle Meyer ae73c75fa6 org-yank: Correct docstring
* lisp/org.el (org-yank): Update docstring for change in default value
  of org-yank-adjusted-subtrees.

The default value was changed to nil in 2949012 (Change default values
of some variables., 2009-02-01).

Reported-by: Jorge Peixoto de Morais Neto <jorge13515@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106610>
2016-04-23 17:38:45 -04:00
Nicolas Goaziou 7e320e2f1b ob-emacs-lisp: Defaut binding is dynamic
* lisp/ob-emacs-lisp.el (org-babel-default-header-args:emacs-lisp):
  Change default value.

<http://permalink.gmane.org/gmane.emacs.orgmode/106530>
2016-04-20 23:45:32 +02:00
Nicolas Goaziou 466d044a9b org-bibtex: Fix curly braces removal
* lisp/org-bibtex.el (org-bibtex-read): Only remove one level of curly
  braces when parsing an entry.

Reported-by: timor <timor.dd@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106495>
2016-04-20 22:59:55 +02:00
Oleh Krehel 7dd0d7a567 Avoid "Marker points into wrong buffer"
* lisp/org-indent.el (org-indent-initialize-buffer): Add a check.  The
bug occurred when trying to capture before any Org buffers were open.
2016-04-20 17:22:09 +02:00
Oleh Krehel 8614a2476f Add detailed location to "org-mode fontification error"
* lisp/org.el (org-fontify-meta-lines-and-blocks): Update.
2016-04-20 17:22:09 +02:00
Oleh Krehel e85f80e2f8 lisp/org-agenda.el (org-agenda-run-series): Prettify 2016-04-20 17:22:09 +02:00
John Kitchin 516bbf417c ob-emacs-lisp: Make lexical eval default for elisp src blocks
* lisp/ob-emacs-lisp.el (org-babel-header-args:emacs-lisp):
(org-babel-default-header-args:emacs-lisp): New variables.
(org-babel-execute:emacs-lisp): Add an optional argument to the eval
function.
2016-04-19 21:40:21 +02:00
Nicolas Goaziou b2411769cf Merge branch 'maint' 2016-04-19 21:31:30 +02:00
Nicolas Goaziou 21ef130752 ox-odt: Fix styles location
* lisp/ox-odt.el (org-odt-styles-dir-list): Point to correct location
  for styles.

Reported-by: Colin Baxter <m43cap@yandex.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106209>
2016-04-19 21:30:39 +02:00
Nicolas Goaziou dbda42010c org-agenda: Fix "Void variable org-clock-current-task"
* lisp/org-agenda.el (org-agenda-mark-clocking-task):
(org-agenda-clock-goto): `org-clock-current-task' may not be defined, so
check that first.

Reported-by: Kyle Meyer <kyle@kyleam.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106504>
2016-04-19 21:14:54 +02:00
Nicolas Goaziou 7894129841 Merge branch 'maint' 2016-04-19 01:37:50 +02:00
Nicolas Goaziou 77b4fad528 Remove duplicate candidates when setting tags
* lisp/org.el (org-set-tags): Remove duplicate candidates from menu.
2016-04-19 01:34:27 +02:00
Nicolas Goaziou 2a49038fd6 org-pcomplete: Fix TAGS completion
* lisp/org-pcomplete.el (pcomplete/org-mode/file-option/tags):
(pcomplete/org-mode/tag): Use new `org-current-tag-alist' instead of
`org-tag-alist' so as to take `org-tag-persistent-alist' into
consideration.
2016-04-18 19:34:08 +02:00
Nicolas Goaziou 9297757fc0 Fix tag related defcustoms
* lisp/org.el (org-tag-alist):
(org-tag-persistent-alist): Improve docstring. Fix values.
2016-04-18 18:08:53 +02:00
Nicolas Goaziou 4743d43dd8 Properly handle `org-tag-persistent-alist'
* lisp/org.el (org-current-tag-alist): New variable.
(org-set-tags):
(org-global-tags-completion-table):
(org-agenda-prepare-buffers): Use new variable.
(org-set-regexps-and-options): Use new variable.  Handle STARTUP early
so that "#+STARTUP: noptag" is taken into consideration.

* lisp/org-agenda.el (org-agenda-bulk-action): Use new variable.

* lisp/org-mobile.el (org-mobile-create-index-file): `org-tag-alist' is
  no longer buffer-local.

* testing/lisp/test-org.el (test-org/set-regexps-and-options): Add
  tests.
2016-04-18 18:07:40 +02:00
Nicolas Goaziou 74d3bd484f Factorize tags parsing
* lisp/org.el (org-tag-string-to-alist):
(org-tag-alist-to-string):
(org-tag-alist-to-groups): New functions.
(org-set-regexps-and-options): Use new functions.

(org--setup-process-tags): Remove function.

(org--setup-collect-keywords): Return tag groups as a string instead of
a list so as to be compatible with new functions.

* lisp/org-mobile.el (org-mobile-create-index-file): Use new functions.

* lisp/org-pcomplete.el (pcomplete/org-mode/file-option/tags): Use new
  functions.
(pcomplete/org-mode/tag): Small refactoring.

* testing/lisp/test-org.el (test-org/tag-string-to-alist):
(test-org/tag-alist-to-string):
(test-org/tag-alist-to-groups): New tests.
2016-04-18 17:40:15 +02:00
Nicolas Goaziou d87158ba2a Merge branch 'maint' 2016-04-16 11:38:25 +02:00
Nicolas Goaziou e0acd8a15a Fix "Invalid time zone specification" error
* lisp/org.el (org-timestamp-change): Correctly handle `encode-time'
  parameters.

Suggested-by: Derek Feichtinger <dfeich@gmail.com>
Reported-by: Eric Abrahamsen <eric@ericabrahamsen.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/106344>
2016-04-16 11:35:43 +02:00
Nicolas Goaziou 9314380284 Merge branch 'maint' 2016-04-14 09:18:00 +02:00
Nicolas Goaziou 846467b718 Fix typo
* lisp/org.el (org-property--local-values): Fix typo in doc string.
2016-04-14 09:17:34 +02:00
Nicolas Goaziou 3135d24239 ox-ascii: Small refactoring
* lisp/ox-ascii.el (org-ascii--describe-links): Small refactoring.
2016-04-13 23:50:15 +02:00
Nicolas Goaziou 602fca424d Merge branch 'maint' 2016-04-13 23:48:27 +02:00
Nicolas Goaziou 297315c46a org-capture: Fix invalid table line specification
* lisp/org-capture.el (org-capture-place-table-line): Move point in
  front of the table before trying to analyze it.

Reported-by: Christian Moe <mail@christianmoe.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106356>
2016-04-13 23:47:36 +02:00
Nicolas Goaziou 2aa7c34bb5 ob-lisp: Fix error when evaluating a lisp src-block
* lisp/ob-lisp.el (org-babel-lisp-eval-fn): Change values to functions
  instead of strings.
(org-babel-execute:lisp): Apply change.
2016-04-13 23:29:41 +02:00
Nicolas Goaziou a57a93e3f6 Merge branch 'maint' 2016-04-13 23:18:29 +02:00
Nicolas Goaziou 9b5f2a03ea ox-ascii: Fix export of links in headlines
* lisp/ox-ascii.el (org-ascii--unique-links):
(org-ascii-headline):
(org-ascii-section): Fix export of links in headlines.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106338>
2016-04-13 23:16:25 +02:00
Nicolas Goaziou 1581da82be ob-lisp: Default evaluator is SLIME
* lisp/ob-lisp.el (org-babel-lisp-eval-fn): Set default value to
  "slime-eval".
2016-04-12 22:12:11 +02:00
Nick Dokos 476211ac73 ob-lisp: Fix typo in doc string
* lisp/ob-lisp.el (org-babel-lisp-eval-fn): Fix typo.
2016-04-12 22:10:54 +02:00
Kyle Meyer 634e12a31e Merge branch 'maint' 2016-04-11 00:32:43 -04:00
Kyle Meyer acfd411193 Update format-time-string calls for argument change
* lisp/org.el (org-timestamp-format):
* lisp/ox-icalendar.el (org-icalendar-convert-timestamp): Specify t for
  the ZONE argument of format-time-string to indicate UTC.

As of Emacs's af32fa9 (New optional ZONE arg for format-time-string
etc., 2015-07-26), UTC is indicated by passing t as the third argument
to format-time-string rather than any non-nil value.

This change is in place of a backport of Emacs's b787d55 (More
format-time-string change fixups, 2016-04-02), which would not work for
earlier versions of Emacs.
2016-04-11 00:32:08 -04:00
Nicolas Goaziou 492d68c936 Add ODT to default export back-ends
* lisp/org.el (org-export-backends): Add `odt' to default value.

Reported-by: Uwe Brauer <oub@mat.ucm.es>
<http://permalink.gmane.org/gmane.emacs.orgmode/106198>
2016-04-10 10:22:38 +02:00
Erik Hetzner f97317abcb org-attach: Use relative path for git annex
* lisp/org-attach.el (org-attach-annex-get-maybe): Use relative path as
  argument for git annex.  Fixes error in test with version 3 of git
  annex.
2016-04-10 10:13:57 +02:00
stardiviner d79835a821 ob-lisp: Add SLY support
* ob-lisp.el (org-babel-lisp-eval-fn): New variable.
(org-babel-execute:lisp): Support using SLY to evaluate lisp src block.

Let user can evaluate Lisp src block with SLY.

Modified from a patch proposal by stardiviner.

TINYCHANGE
2016-04-10 10:07:38 +02:00
Michael Strey 0fac70ea89 org.el: Fix bug from switch to lexical binding
* lisp/org.el (org-check-dates-range): Fix a bug introduces with the
  switch to lexical binding in commit
  1f49e9fdfd.

This change fixed the following bug:  C-c \ D leads to error message "Symbol's value as variable is void: start-date".

TINYCHANGE
2016-04-08 23:12:42 +02:00
Nicolas Goaziou 4bc07758a5 Merge branch 'maint' 2016-04-06 22:28:16 +02:00
Nicolas Goaziou 9c6811b9d4 ox-texinfo: Fix erroneous count of blank lines in menu
* lisp/ox-texinfo.el (org-texinfo-section):
(org-texinfo--build-menu): Normalize empty lines in generated menu.

Reported-by: Jonas Bernoulli <jonas@bernoul.li>
<http://permalink.gmane.org/gmane.emacs.orgmode/106145>
2016-04-06 22:26:42 +02:00
Nicolas Goaziou 716e339c96 Allow angular links within link descriptions
* lisp/org-element.el (org-element-object-restrictions):
(org-element--object-lex): Allow angular links as equivalent to plain
links in description.

* testing/lisp/test-org-element.el (test-org-element/link-parser): Add
  test.
2016-04-06 11:08:53 +02:00
Nicolas Goaziou 64ca6f2c24 Keep headlines named like current one in refile targets
* lisp/org.el (org-refile-get-targets): Change signature.
(org-refile-get-location): Change signature.  Also apply change above.
(org-goto):
(org-refile): Apply change above.

Reported-by: Samuel Wales <samologist@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/106051>
2016-04-05 23:45:37 +02:00
Nicolas Goaziou 0e0a72443a org-agenda: Fix Invalid Function 4 error
* lisp/org-agenda.el (org-tags-view): Fix wrong conversion introduced in
  commit a02a83793b.

Reported-by: Ian Dunn <dunni@gnu.org>
<http://permalink.gmane.org/gmane.emacs.orgmode/106080>
2016-04-05 23:31:21 +02:00
Nicolas Goaziou f07580066e ox-html: Silence byte-compiler 2016-03-30 17:18:47 +02:00
Nicolas Goaziou 3149a01513 Merge branch 'maint' 2016-03-30 17:17:51 +02:00
Nicolas Goaziou cb683e3a56 ox-html: Fix planning info export
* lisp/ox-html.el (org-html-planning): Properly escape angle brackets in
  time-stamps.

Reported-by: Keith Sutton <kesutt@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/105945>
2016-03-30 17:17:07 +02:00
John Kitchin d5b9c74430 ox-html: Add html attributes to special blocks
* lisp/ox-html.el (org-html-special-block): enables #+attr_html and puts
  an id in when the special block is named.
2016-03-30 17:01:12 +02:00
John Kitchin 8f4f7dfd14 ox-html: Add html attributes to quote-block
* lisp/ox-html.el (org-html-quote-block): Enables #+attr_html: and puts
  a id attribute when the block is named into the html element.
2016-03-30 16:38:53 +02:00
John Kitchin 2ce1fc2c0d ox-html: Add id attribute to example-block on html export
* lisp/ox-html.el (org-html-example-block): Add "id" attribute according
  to name.

This allows you to hyperlink to the block.
2016-03-30 16:16:12 +02:00
Richard Kim 8e1c2a39f3 org-info.el: Generate HTML links to gnu.org
* lisp/org-info.el (org-info-export): Convert info links to HTML URL's
that point to appropriate gnu.org or other pages.  User's can customize
the behavior using `org-info-emacs-documents' and
`org-info-other-documets' new variables.

TINYCHANGE
2016-03-30 15:56:02 +02:00
Nicolas Goaziou ff236e5c85 Merge branch 'maint' 2016-03-30 15:36:16 +02:00
Nicolas Goaziou 954103dd9b Fix indentation bug
* lisp/org.el (org--get-expected-indentation): Return correct columns
  when at the end of an empty item.
* testing/lisp/test-org.el (test-org/indent-line): Add test.
2016-03-30 15:34:24 +02:00
Nicolas Goaziou 0f512848ea Merge branch 'maint' 2016-03-28 11:07:27 +02:00
Nicolas Goaziou a94147535a ox-html: Fix Usenet links
* lisp/ox-html.el (org-html-link): Properly export Usenet links.

Reported-by: Michael Welle <mwe012008@gmx.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/105915>
2016-03-28 11:06:56 +02:00
Thierry Banel 9438ac6014 ob-C: Add :libs to babel C++
* lisp/ob-C.el (org-babel-C-execute): add support for :libs header
  parameter to specify libraries to link with.
2016-03-26 00:32:56 +01:00
Nicolas Goaziou 6cddbe8493 Merge branch 'maint' 2016-03-26 00:29:20 +01:00
Thierry Banel f9464d2678 ob-C: use size_t in babel D
* lisp/ob-C.el (org-babel-C-header-to-C): change ulong to size_t for
  indexing a table as mandated by the latest version of the D language
  (thanks to Chris Andrews)
2016-03-26 00:27:39 +01:00
Nicolas Goaziou 6f543959ed Merge branch 'maint' 2016-03-26 00:20:47 +01:00
Nicolas Goaziou 28a8d2e24e org-table: Fix docstrings
* lisp/org-table.el (org-table-eval-formula): Nowadays, Calc is
  installed with Emacs, so there is no need to specify this.  Also
  remove hard-coded "C-u".
(org-table-recalculate): Fix code typo.
2016-03-25 23:11:34 +01:00
Nicolas Goaziou 0b077de733 org-table: Fix #ERROR in table formula with "@>"
* lisp/org-table.el (org-table-eval-formula): Expand first and last
  references into proper fields coordinates before replacing ranges.

Reported-by: Pablo S. Casas <pabloscasas@gmail.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/105895>
2016-03-25 22:33:06 +01:00
Nicolas Goaziou 2afce8b22f Merge branch 'maint' 2016-03-24 22:13:27 +01:00
Nicolas Goaziou 6d070db91c org-table: Silence byte-compiler 2016-03-24 22:12:58 +01:00
Nicolas Goaziou 0fd7fd072e Merge branch 'maint' 2016-03-24 14:00:44 +01:00
Nicolas Goaziou a5623bc502 org-table: Fix LaTeX snippets in radio tables
* lisp/org-table.el (orgtbl-to-generic): Call back-end specific filters.
* testing/lisp/test-org-table.el (test-org-table/to-latex): Add test.

Reported-by: Uwe Brauer <oub@mat.ucm.es>
<http://permalink.gmane.org/gmane.emacs.orgmode/105876>
2016-03-24 13:59:29 +01:00
Oleh Krehel 809a838844 org-agenda.el (org-agenda-to-appt): Don't echo already added
`appt-add' returns nil when the event was already added previously.
2016-03-18 15:23:52 +01:00
Marcin Borkowski ebd68ae499 Enhance year handling
* lisp/org.el (org-read-date-analyze): Handle two-digit years with
`org-small-year-to-year' instead of just adding 2000
2016-03-18 14:31:07 +01:00
Nicolas Goaziou bf40aba6cd Merge branch 'maint' 2016-03-17 16:51:43 +01:00
Nicolas Goaziou 261eadb9d4 Fix indentation bug
* lisp/org.el (org--get-expected-indentation): Fix indentation.
* testing/lisp/test-org.el (test-org/indent-line): Add test.
2016-03-17 16:50:54 +01:00
Nicolas Goaziou 1d781b3365 Use Babel cache when exporting src blocks
* lisp/ob-core.el (org-babel-process-params): Normalize return value.
* testing/lisp/test-ob.el (test-ob/process-params-no-duplicates): Fix
  test.
2016-03-17 00:23:02 +01:00
Nicolas Goaziou 99e12cbf92 Merge branch 'maint' 2016-03-16 22:08:35 +01:00
Nicolas Goaziou 9c2e8a7988 org-agenda: Fix bulk re-scheduling
* lisp/org-agenda.el (org-agenda-bulk-action): Fix rescheduling TODO items with `org-log-reschedule' set to `note'.

Reported-by: Allen Li <darkfeline@felesatra.moe>
<http://permalink.gmane.org/gmane.emacs.orgmode/105591>
2016-03-16 22:07:16 +01:00
Nicolas Goaziou dcfe011998 org-element: Fix inline src block parsing
* lisp/org-element.el (org-element--pair-curly-table): Fix typo.
* testing/lisp/test-org-element.el (test-org-element/inline-src-block-parser):
Add tests.

Reported-by: William Denton <wtd@pobox.com>
<http://permalink.gmane.org/gmane.emacs.orgmode/105748>
2016-03-16 18:15:39 +01:00
Nicolas Goaziou 1795d505e8 ox-html: Fix code comment
* lisp/ox-html.el (org-html-link): Radio-targets are not meant to be
  resolved through cross-referencing.
2016-03-12 23:18:55 +01:00
Nicolas Goaziou 5563682ca6 ox-publish: Keep code within 80 columns
* lisp/ox-publish.el (org-publish-write-cache-file):
(org-publish-initialize-cache): Keep code within 80 columns.
2016-03-12 23:18:55 +01:00
Nicolas Goaziou bef3fc6f82 ox-publish: Better handling of cross-references
* lisp/ox-publish.el (org-publish--collect-references): Renamed...
(org-publish--store-crossrefs): ... to this.
(org-publish-org-to): Use previous function.  Small refactoring.

(org-publish-resolve-external-link): Use tight integration with
`org-export-get-reference' so as to provide reliable cross references.

* lisp/ox.el (org-export-get-reference): Conversely, take into
  consideration references suggested by
  `org-publish-resolve-external-link'.
2016-03-12 23:18:55 +01:00
Nicolas Goaziou 32c3f33d00 ox: Use a new scheme for internal references
* lisp/ox.el (org-export-get-reference): Use randomly generated labels.
(org-export-new-reference):
(org-export-format-reference): New functions.

* testing/lisp/test-ox.el (test-org-export/get-reference): New test.

The new scheme is better when datum type cannot be known ahead of time
or when references are not created sequentially, e.g., during
a publishing process where a reference to a file can be require before
the file is published.
2016-03-12 23:18:55 +01:00
Nicolas Goaziou 6ec06dcff9 ox: Abstract fuzzy link searches with search cells
* lisp/ox.el (org-export-search-cells):
(org-export-string-to-search-cell):
(org-export-match-search-cell-p): New functions.

(org-export-resolve-fuzzy-link): Use new functions.

* testing/lisp/test-ox.el (test-org-export/fuzzy-link): Tiny
  refactoring.
(test-org-export/resolve-fuzzy-link): Fix failing test.
2016-03-12 23:18:55 +01:00
Kyle Meyer 015d971f48 Merge branch 'maint' 2016-03-12 11:12:08 -05:00
Kyle Meyer dd9be3a6ea Fix docstring typo
* lisp/org.el (org-align-all-tags): Fix typo in docstring.
2016-03-12 11:11:18 -05:00
Kyle Meyer dade0d5b28 Merge branch 'maint' 2016-03-11 22:51:07 -05:00
Kaushal Modi ebacca39b4 Display quotes in key-bindings as straight quotes
* lisp/org-agenda.el (org-agenda-show-the-flagging-note):
* lisp/org-footnote.el (org-footnote-goto-definition):
* lisp/org-table.el (org-table-edit-formulas): Fix straight quotes
  rendered as curvy quotes in echoes messages (in emacs 25.1).
* lisp/org-table.el (org-table-align): Fix straight quotes rendered as
  curvy quotes in help echo (in emacs 25.1).

* lisp/org-protocol.el (org-protocol-create-for-org):
* lisp/org-table.el (org-table-sum): Minor reformatting.

The below thread discusses why these changes were needed especially when
using emacs 25.1 or newer emacsen (that added support for rendering
back-quotes and straight quotes as left/right curvy quotes by default):
http://thread.gmane.org/gmane.emacs.orgmode/105594

Fix the quote style displayed when key-bindings are shown in
the echo via (message .. (substitute-command-keys ..)).

So below will render that single quote as curly.

(message "C-c '")

The fix (Reference:
https://lists.gnu.org/archive/html/bug-gnu-emacs/2015-10/msg00234.html)
is to print that quote verbatim using the "%s" modifier:

(message "%s" "C-c '")

Also an help-echo text property value was fixed in `org-table-align'.
`substitute-command-keys' should not be used in that.  Instead \\[COMMAND]
should be used directly in the string.
2016-03-11 22:40:30 -05:00
Nicolas Goaziou 0b59a5994e Merge branch 'maint' 2016-03-10 10:11:24 +01:00
Nicolas Goaziou 5a735b0b80 ox: Fix smart quotes within tables
* lisp/ox.el (org-export--smart-quote-status): Handle smart quotes
  within objects.

* testing/lisp/test-ox.el (test-org-export/activate-smart-quotes): Add
  tests.

Reported-by: Philipp Middendorf <pmi@hacon.de>
<http://permalink.gmane.org/gmane.emacs.orgmode/105586>
2016-03-10 10:10:29 +01:00
Nicolas Goaziou d5a603db1f Merge branch 'maint' 2016-03-10 09:54:52 +01:00