Skip to content

Instantly share code, notes, and snippets.

@alphapapa
Created July 25, 2017 04:49
Show Gist options
  • Save alphapapa/cd412077b09d422207c49199e61a4de9 to your computer and use it in GitHub Desktop.
Save alphapapa/cd412077b09d422207c49199e61a4de9 to your computer and use it in GitHub Desktop.
Checklist for upgrading to Org 9.0

UNDERWAY Upgrade org

  • State “UNDERWAY” from [2017-04-23 Sun 01:05]

Upgrade to Org 8.3

[#A] Properties drawers syntax changes
  • State “DONE” from “TODO” [2017-04-10 Mon 05:38]

Properties drawers are now required to be located right after a headline and its planning line, when applicable.

It will break some documents as TODO states changes were sometimes logged before the property drawer.

The following function will repair them:

(defun org-repair-property-drawers ()
  "Fix properties drawers in current buffer.
     Ignore non Org buffers."
  (when (eq major-mode 'org-mode)
    (org-with-wide-buffer
     (goto-char (point-min))
     (let ((case-fold-search t)
           (inline-re (and (featurep 'org-inlinetask)
                           (concat (org-inlinetask-outline-regexp)
                                   "END[ \t]*$"))))
       (org-map-entries
        (lambda ()
          (unless (and inline-re (org-looking-at-p inline-re))
            (save-excursion
              (let ((end (save-excursion (outline-next-heading) (point))))
                (forward-line)
                (when (org-looking-at-p org-planning-line-re) (forward-line))
                (when (and (< (point) end)
                           (not (org-looking-at-p org-property-drawer-re))
                           (save-excursion
                             (and (re-search-forward org-property-drawer-re end t)
                                  (eq (org-element-type
                                       (save-match-data (org-element-at-point)))
                                      'drawer))))
                  (insert (delete-and-extract-region
                           (match-beginning 0)
                           (min (1+ (match-end 0)) end)))
                  (unless (bolp) (insert "\n"))))))))))))

(cl-loop for filename in (f-glob  "*.org" org-directory)
         ;; [2017-04-10 Mon 05:34] Worked fine.
         unless (s-matches? "#" filename)
         do (with-current-buffer (find-file-noselect filename)
              (message "Processing %s" filename)
              (org-remove-readonly)
              (ignore-errors (org-repair-property-drawers))
              (org-mark-readonly)
              (save-buffer)))
[#B] New option org-export-with-title
  • State “DONE” from “TODO” [2017-04-10 Mon 05:40]
    Disabled it.

It is possible to suppress the title insertion with #+OPTIONS: title:nil or globally using the variable org-export-with-title.

Probably want to turn this on, although I rarely export.

[#C] New variable to control visibility when revealing a location

org-show-following-heading, org-show-siblings, org-show-entry-below and org-show-hierarchy-above no longer exist. Instead, visibility is controlled through a single variable: org-show-context-detail, which see.

[#C] Drawers do not need anymore to be referenced in #+DRAWERS

One can use a drawer without listing it in the #+DRAWERS keyword, which is now obsolete. As a consequence, this change also deprecates org-drawers variable.

I wonder if this would be useful for me…

[#C] Removed function org-translate-time

Use org-timestamp-translate instead.

Dunno if I use this…

Table of contents can be local to a section

The TOC keywords now accepts an optional local parameter. See manual for details.

Viewport support in html export

Viewport for mobile-optimized website is now automatically inserted when exporting to html. See org-html-viewport for details.

Remotely edit a footnote definition

Calling org-edit-footnote-reference (C-c ‘) on a footnote reference allows to edit its definition, as long as it is not anonymous, in a dedicated buffer. It works even if buffer is currently narrowed.

New function org-delete-indentation bound to M-^

Work as delete-indentation unless at heading, in which case text is added to headline text.

Removed function org-end-of-meta-data-and-drawers

The function is superseded by org-end-of-meta-data, called with an optional argument.

This might be useful in rifle…

org-list-empty-line-terminates-plain-lists is deprecated

It will be kept in code base until next release, for backward compatibility.

If you need to separate consecutive lists with blank lines, always use two of them, as if this option was nil (default value).

Footnotes in included files are now local to the file

As a consequence, it is possible to include multiple Org files with footnotes in a master document without being concerned about footnote labels colliding.

This seems pretty significant to me! (Although it hasn’t ever affected me.)

QUOTE keywords do not exist anymore

QUOTE keywords have been deprecated since Org 8.2.

I think this means TODO-style keywords.

Upgrade to Org 9.0.x

org-eww has been moved into core

I wonder what this is…

New org-protocol key=value syntax

Org-protocol can now handle query-style parameters such as:

org-protocol://store-link?url=http:%2F%2Flocalhost%2Findex.html&title=The%20title org-protocol://capture?template=x&title=Hello&body=World&url=http:%2F%2Fexample.com

Old-style links such as

org-protocol://store-link:/http:%2F%2Flocalhost%2Findex.html/The%20title

continue to be supported.

If you have defined your own handler functions for org-protocol-protocol-alist, change them to accept either a property list (for new-style links) or a string (for old-style links). Use org-protocol-parse-parameters to convert old-style links into property lists.

This needs to be updated in org-protocol-capture-html.

Clear non-repeated SCHEDULED upon repeating a task
  • State “DONE” from [2017-04-10 Mon 05:42]

If the task is repeated, and therefore done at least one, scheduling information is no longer relevant. It is therefore removed.

See commit message for more information.

New Org linter library

org-lint can check syntax and report common issues in Org documents.

[#C] Preview LaTeX snippets in buffers not visiting files

I wonder if this would let me fix that request in rifle…

[#C] New option org-attach-commit

When non-nil, commit attachments with git, assuming the document is in a git repository.

Allow conditional case-fold searches in org-occur

When set to smart, the new variable org-occur-case-fold-search allows to mimic isearch.el: if the regexp searched contains any upper case character (or character class), the search is case sensitive. Otherwise, it is case insensitive.

[#B] Links are now customizable

Links can now have custom colors, tooltips, keymaps, display behavior, etc. Links are now centralized in org-link-parameters.

This might be useful in org-quick-peek.

[#C] New function org-show-children

It is a faster implementation of outline-show-children.

org-babel-get-header is removed.

Use org-babel–get-vars or assq instead, as applicable.

I don’t think I’ve used this in org-fitness, but just in case…

org-babel-trim is deprecated.

Use org-trim instead.

What is this…?

[#C] org-on-heading-p is deprecated

A comment to this effect was in the source code since 7.8.03, but now a byte-compiler warning will be generated as well.

This seems useful, I wonder what is supposed to be used…?

Secure placeholders in capture templates

Placeholders in capture templates are no longer expanded recursively. However, %(…) constructs are expanded very late, so you can fill the contents of the S-exp with the replacement text of non-interactive placeholders. As before, interactive ones are still expanded as the very last step, so the previous statement doesn’t apply to them.

Note that only %(…) placeholders initially present in the template, or introduced using a file placeholder, i.e., %[…] are expanded. This prevents evaluating potentially malicious code when another placeholder, e.g., %i expands to a S-exp.

This is very cool, a definite improvement.

SOMEDAY [#C] Repeaters with a ++ interval and a time can be shifted to later today
  • State “SOMEDAY” from “TODO” [2017-07-24 Mon 18:04]

Previously, if a recurring task had a timestamp of 2016-01-01 Fri 20:00 ++1d and was completed on 2016-01-02 at 08:00, the task would skip 2016-01-02 and would be rescheduled for 2016-01-03. Timestamps with ++ cookies and a specific time will now shift to the first possible future occurrence, even if the occurrence is later the same day the task is completed. (Timestamps already in the future are still shifted one time further into the future.)

I don’t know about this…

[#C] Old Babel header properties are no longer supported

Using header arguments as property names is no longer possible. As such, the following

 Headline
:PROPERTIES:
:exports: code
:var: a=1 b=2
:var+: c=3
:END:

should be written instead

 Headline
:PROPERTIES:
:header-args: :exports code
:header-args: :var a=1 b=2
:header-args+: :var c=3
:END:

Please note that, however, old properties were defined at the source block definition. Current ones are defined where the block is called.

Dunno if I have used this in org-fitness…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment