* lisp/org-src.el (org-src--content-indentation): Introduce
permanently buffer-local variable for storing away the potentially
buffer-local value of `org-edit-src-content-indentation' in the source
buffer.
(org-src--contents-for-write-back): Use `org-src--content-indentation'
instead of `org-edit-src-content-indentation' in the edit buffer.
(org-src--edit-element): Set `org-src--content-indentation' in editing
buffer. For greater clarity and consistency, rename already existing
let-bound variable `ind' to `block-ind'.
* lisp/org-timer.el (org-timer--get-timer-title): If the current
buffer is not an Org buffer, use the buffer name as the timer title.
Currently all of the `org-timer-' operations work from any buffer
except `org-timer-set-timer' which must be run from an Org buffer.
This is because `org-timer-set-timer' sets a timer name based on an
Org heading or filename. By setting the timer title to the current
buffer name we can use `org-timer-set-timer' from any buffer and
preserve the timer naming convention of using the buffer name if there
isn't an Org header.
TINYCHANGE
A bug was squashed where newlines after insertion of document property
drawers wasn't handled correctly.
* testing/lisp/test-org.el (test-org/insert-property-drawer):
Add test to verify that the document property drawer is
inserted above keyword lines. Also fix the specification for
document property drawer so it doesn't remove existing blank
rows if inserted at the top of a buffer.
* lisp/org.el (org-insert-property-drawer): Make sure to add
newline after document property drawers.
* lisp/org.el (org-display-inline-images): Introduce error-handling to
ignore image display if the attachment link cannot be expanded for
whatever reason. For example if attachments are relative to the
buffer, but the buffer is temporary and lacks filesystem location.
* lisp/org-agenda.el (org-agenda-check-type): Mention also 'component'
in the error message since it could be just the unallowed component
in a composed agenda buffer from which some action has been
triggered.
* doc/org-manual.org (Attachment options)
* etc/ORG-NEWS (Org-Attach has been refactored and extended)
(New ID method based on timestamp)
* lisp/org-attach.el (org-attach-id-uuid-folder-format)
(org-attach-id-ts-folder-format)
(org-attach-id-to-path-function-list, org-attach-dir)
(org-attach-dir-from-id): Better handling of id to path
functionality. At the same time adding an id-to-path function
for timestamp-based ID that easily can be promoted to the
primary function by customization of the user.
Add functionality to define property-blocks on document level, in
addition to at headline level.
* doc/org-manual.org:
* etc/ORG-NEWS: Document new functionality.
* lisp/org.el (org-keyword-regexp): Define constant instead of
hardcoding.
(org-file-properties): Renamed, see next line.
(org-keyword-properties): Renamed from above. Due to the fact that
properties can be defined for the whole document using property
drawers this local variable needs a rename to make its name less
ambigous.
(org-refresh-properties, org-refresh-property, org-entry-properties)
(org-refresh-category-properties, org-get-property-block)
(org-entry-get-with-inheritance, org-entry-put)
(org-insert-property-drawer, org-end-of-subtree): Made to work before
first headline.
(org-at-property-block-p): New function to validate if point is at the
start of a property block.
(org-property-global-value): Renamed, see next line.
(org-property-global-or-keyword-value): Renamed from above to match
its functionality better.
(org-back-to-heading-or-point-min): New function to make a document
work as a level 0 node in the outline.
(org-at-keyword-p): Predicate function to answer to if we're currently
at a keyword line or not.
(org-up-heading-or-point-min): New function to make a document work as
a level 0 node in the outline.
* lisp/org-element.el (org-element--current-element): Can now detect
property-blocks before first headline according to it's positional
rules.
* lisp/org-attach.el (org-attach): Make it possible to call the
attachment dispatcher also before the first headline, since document
property drawers make attachments possible for the whole document
now.
* lisp/org-capture.el: Modified only due to rename of function in
org.el.
* lisp/org-compat.el (org-file-properties)
(org-property-global-value): Renamed functions declared obsolete.
* testing/lisp/test-org.el (org/insert-property-drawer)
(org/set-property, org/delete-property, org/delete-property-globally):
Additions of tests to check if they work before first headline.
(org/at-property-p, org/at-property-block-p, org/get-property-block)
(org/entry-get, org/refresh-properties): New tests
* testing/examples/property-inheritance.org: Switch from
property-keywords to a property-drawer in the testfile.
Functionality should be the same, but now using a document drawer
instead of property-keywords.
Reason for switching is that I'd like us to slowly depricate
property-keywords.
* testing/lisp/test-org-element.el:
* contrib/lisp/ox-taskjuggler.el: A comment is modified only due to
rename of function in org.el.
* lisp/ob-ocaml.el (org-babel-execute:ocaml): Support for
pretty-printed outputs.
E.g. the following snippet produces multiple lines of output, due to
pretty-printing
#+BEGIN_SRC ocaml :exports code :eval no-export :results verbatim
(* Note, no need to have parentheses around sqrt, as
application binds the tightest *)
let rec gamma n = if n = 0
then (1.0 +. sqrt 5.0) /. 2.0
else 1.0 /. (gamma (n-1) -. 1.0)
let nums = List.map gamma (List.init 5 (fun x -> x))
#+END_SRC
#+NAME: gamma-tbl
#+RESULTS[1fd6a3e846afdef51350eb6d7ba15c6844ccc14e]:
: val gamma : int -> float = <fun>
: val nums : float list =
: [1.6180339887498949; 1.61803398874989468; 1.61803398874989535;
: 1.61803398874989357; 1.61803398874989823]
(In reality this would have 50 or so outputs, point being mathematically
it shouldn't change, but due to floating point errors it does.)
The regexp has the following problems:
- The "." in group 5 (as-was) doesn't match new-lines, so it only
matches the first line, e.g. as a list
: - [1.6180339887498949, 1.61803398874989468, 1.61803398874989535,
- When using "\\(.\\|\n\\)", it includes the starting indentation of the
list, which makes org-babel-script-escape choke (called from
org-babel-ocaml-read-list, from org-babel-ocaml-parse-output, from
org-babel-execute:ocaml, the code being modified.
TINYCHANGE
* lisp/ox-html.el (org-html-format-code, org-html-do-format-code):
Use new export option :html-wrap-src-lines with variable
org-html-wrap-src-lines to control whether source code lines should
be wrapped in code elements or not.
* doc/org-manual.org: Document the new option
* lisp/ox-publish.el (org-publish-resolve-external-link): Signal
`org-link-broken' when `org-link-search' fails to resolve a link.
Without this change, a broken fuzzy link will always abort the export
even when `org-export-with-broken-links' is non-nil.
* lisp/org.el (org-doi-server-url): Prefer https: to http: un URLs.
Update some URLs
946a56a10fed769646a8b7c4ebc53f53c84be896
Paul Eggert
Mon Sep 23 00:12:52 2019 -0700
Notes(km):
- It's not mentioned in 946a56a10's message, but that commit also
drops the dx subdomain, an "earlier syntax which continues to be
supported" according to https://www.doi.org/factsheets/DOI_PURL.html.
- 946a56a10 replaced a link in the manual with https://api.uva.nl/
(which the previous link redirects to). Here we instead use the
replacement link from master's f4083eefd (manual: Fix URL,
2019-06-01).
* org.el (org-activate-links): `match-beginning' and `match-end` should
be called shortly after `re-search-forward'. Otherwise, they may return
values corresponding to a different invocation of `re-search-forward'.
TINYCHANGE
* lisp/org-macs.el (org-do-remove-indentation): Handle full-width characters.
When the least indented line in buffer begins from fullwidth character
like 'あ', a Japanese character, `org-do-remove-indentation' doesn't
remove indentation at all or removes improperly.
e.g. 'あ' with 2 spaces indent
-----[buffer begin]-----
あ
-----[buffer end]-----
`org-do-remove-indentation' does nothing in this buffer.
Expected result is:
-----[buffer begin]-----
あ
-----[buffer end]-----
Reported-by: Yuichiro Hakozaki <sankaku.git@gmail.com>
<http://lists.gnu.org/r/emacs-orgmode/2019-09/msg00075.html>
* lisp/ob-lisp.el (org-babel-execute:lisp): Make sure that when
a singular string value is returned, it has no quotation marks around
it.
Before this change, the code below would produce an incorrect result:
#+BEGIN_SRC lisp :results file
"plot.png"
#+END_SRC
#+RESULTS:
[[file:"plot.png"]]
After the change:
#+BEGIN_SRC lisp :results file
"plot.png"
#+END_SRC
#+RESULTS:
[[file:plot.png]]
TINYCHANGE