1

I recently update my org to the version 9.2 (to be precise: Org mode version 9.2.3 (9.2.3-4-g6ec402-elpaplus @ /home/nanounanue/.emacs.d/elpa/org-plus-contrib-20190408/)

I did it because I replaced the ob-ipython with emacs-jupyter (more stable, more features and now I am very happy)

Now, I am experimenting the following hiccups:

(a) When I try to insert a code block using the new keybinding C-c C-, I got:

Warning (org):
Please update the entries of `org-structure-template-alist'.

In Org 9.2 the format was changed from something like

("s" "#+BEGIN_SRC ?\n#+END_SRC")

to something like

("s" . "src")

Please refer to the documentation of `org-structure-template-alist'.

The following entries must be updated:

(("n" "#+BEGIN_NOTES\n?\n#+END_NOTES")
("Q" "#+BEGIN_SRC sql-mode ?\n\n#+END_SRC" "#+BEGIN_SRC sql-mode ?\n\n#+END_SRC"))

I searched in my =.emacs= and I don't find those lines, actually my templates are:

(add-to-list 'org-structure-template-alist
'("el" . "src emacs-lisp"))

(add-to-list 'org-structure-template-alist
'("sh" . "src shell"))

(add-to-list 'org-structure-template-alist
'("Q" . "src sql"))

(add-to-list 'org-structure-template-alist
'("py" . "src jupyter-python"))

(add-to-list 'org-structure-template-alist
'("md" . "src markdown"))

(add-to-list 'org-structure-template-alist
'("sr" . "src R"))

(add-to-list 'org-structure-template-alist
'("l" . "src lisp"))

(add-to-list 'org-structure-template-alist
'("cl" . "src clojure"))

So, I am kind of lost here.

(b) My sql babel blocks now throw the following error everytime that the cursor enters the block

Debugger entered--Lisp error: (wrong-type-argument stringp 5434)
#f(compiled-function (elem) #<bytecode 0x1563983c7e95>)((:dbport . 5434))
mapconcat(#f(compiled-function (elem) #<bytecode 0x1563983c7e95>) ((:results . "drawer table replace") (:exports . "both") (:cmdline . "-q") (:eval . "no-export") (:database . "food") (:dbpassword . "some_password") (:dbuser . "food_user") (:dbport . 5434) (:dbhost . "0.0.0.0") (:engine . "postgresql") (:tangle . "no") (:hlines . "no") (:noweb . "no") (:cache . "no") (:session . "none")) " ")
org-eldoc-get-src-header()
org-eldoc-documentation-function()
eldoc-print-current-symbol-info()
#f(compiled-function () #<bytecode 0x1feb98d89639>)()
apply(#f(compiled-function () #<bytecode 0x1feb98d89639>) nil)
timer-event-handler([t 0 0 100000 t #f(compiled-function () #<bytecode 0x1feb98d89639>) nil idle 0])

(c) If I try to refresh the headers of an org-mode buffer using C-c C-c I got the following error:

Debugger entered--Lisp error: (void-function org-outline-overlay-data)
org-outline-overlay-data(use-markers)
org-ctrl-c-ctrl-c(nil)
funcall-interactively(org-ctrl-c-ctrl-c nil)
call-interactively(org-ctrl-c-ctrl-c nil nil)
#f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x1feb98d60d25>)(org-ctrl-c-ctrl-c nil nil nil)
ad-Advice-command-execute(#f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x1feb98d60d25>) org-ctrl-c-ctrl-c)
apply(ad-Advice-command-execute #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x1feb98d60d25>) org-ctrl-c-ctrl-c)
command-execute(org-ctrl-c-ctrl-c)

All these behaviour showed up with the upgrade to org 9.2. Could someone give me pointers or help?

(Originally posted in https://www.reddit.com/r/orgmode/comments/bcjl8u/help_cant_find_the_errors/)

closed as too broad by Drew, DoMiNeLa10 Apr 21 at 11:28

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    The structure template error might also stem from not yet updated packages. The Elisp-code from another answer gives you the old structure templates back. It coexists with the new format. It just does the right thing instead of issuing an error. Make sure you inject the code as early as possible in your init files. – Tobias Apr 20 at 20:35
  • Could it be that once upon a time you byte-compiled your init file. That is a no-go! Remove ~/.emacs.elc if it exists. – Tobias Apr 20 at 20:42
  • 1
    This should be closed as too broad. You've asked two lengthy questions in one. Please delete this question and ask two separate questions (split it in two). – Drew Apr 21 at 3:22
  • As usual, rather than try to deal with your entire init file when debugging, narrow it down. Do a binary search to narrow it down by commenting out 1/2, then 3/4, 7/8, 15/16 etc. of it. If the answer is not obvious after you've narrowed the causing code down then post a question with the narrowed problematic code. That helps others help you, and it makes the Q&A more useful for other users who might have a similar problem/question. – Drew Apr 21 at 3:25
  • @Drew The right title for this question would be: "What is wrong with the version 9.2 of Org-mode." I already answered two questions there and there about the incompatible changes in Org 9.2. Now, both problems hit user nanounanue in a way which leaves an not so much experienced user no chance to do anything about it. – Tobias Apr 22 at 12:47
2

The ob-sql-mode package is not updated for org-mode 9.2 yet. There you find as of 2019-04-20 the following lines in master:

(eval-after-load "org"
  '(progn
     (add-to-list 'org-src-lang-modes '("sql-mode" . sql))
     (add-to-list 'org-structure-template-alist
                  `(,org-babel-sql-mode-template-selector
                    "#+BEGIN_SRC sql-mode ?\n\n#+END_SRC"
                    "#+BEGIN_SRC sql-mode ?\n\n#+END_SRC"))))

Thereby the value of org-babel-sql-mode-template-selector is Q as the second update-requirement in your first error message says.

To cure this special problem you can add back the old behavior of org-structure-template-alist with the compatibility Elisp code given at the answer to another question. Note that eval-after-load adds its form argument at the end of after-load-alist. To load the compatibility Elisp code before the package ob-sql-mode is loaded you must call the compatibility code before ob-sql-mode. If you do not explicitly load ob-sql-mode in your init file it should be sufficient to put the compatibility Elisp code into your init file.

Yor error case (b) is also connected to sql org babel blocks (that way it receives the eldoc-messages). If you are lucky, the error will disappear after re-compiling the package directory.

Lunaryhorn recommends the following user-input for recompiling all packages:

M-: (byte-recompile-directory package-user-dir nil 'force)

That may take a while...


I also found a reference for your note block update message: It seems to be hydra and there is already a fix there. If you have installed hydra you should update the hydra package.


Now to your problem (c). That is also an already known problem. The functions org-outline-overlay-data and org-set-outline-overlay-data have been removed from org-mode without adequate replacement.

My edit of another answer shows you what you need to get these functions back.

Note that the the proposed org-save-outline-visibility is not a solution to all problems that occur because of the removal of org-outline-overlay-data and org-set-outline-overlay-data. For an instance org-save-outline-visibility cannot be used with before-revert-hook and after-revert-hook.

  • For the ob-sql-mode problem, I opened an issue. – NickD Apr 21 at 0:54
  • 1
    Thanks for the ob-sql-mode issue, I've just committed a fix, which should show up on MELPA shortly. – Nik Apr 21 at 15:44
  • Thank you so much! After following your advice I am getting this warning: Warning (emacs): Duplicated keys in ‘org-structure-template-alist’ and ‘org-tempo-keywords-alist’ – nanounanue Apr 21 at 17:00
  • @nanounanue You get duplicated entries with your setup. For an instance Q is defined in the ob-sql-mode package and in your init file. You can ignore those warning if everything works like expected. Usually the first definition is used if some key is doubly defined. – Tobias Apr 22 at 2:37
  • @nanounanue I removed the phrase "At least a partial answer" since I believe that I address all problems from your question now. Do you agree? Does everything work now as good as possible with the new Org version? – Tobias Apr 22 at 12:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.