I was looking through my .emacs.el file and saw that Customize has put the following in it:

    (#[0 "\300\301\302\303\304$\207"
     [add-hook change-major-mode-hook org-show-block-all append local]
     #[0 "\300\301\302\303\304$\207"
     [add-hook change-major-mode-hook org-babel-show-result-all append local]
     org-babel-result-hide-spec org-babel-hide-all-hashes org-bullets-mode org-sticky-header-mode org-ac org-autolist-mode)))

What do the first two lines between (quote and org-babel-result-hide-spec... do?


Someone (possibly you; but maybe org-mode itself -- I've seen it in the past) is adding lambda forms to a hook variable.

What you're seeing is the byte-code for the compiled function. This makes the hook var horrible to read, which is one of the many reasons why you shouldn't put lambdas in hooks (and should instead create named functions and add the function symbol to the hook).

In this case I believe the offending code would be along the lines of:

(add-hook 'org-mode-hook (lambda () (add-hook 'change-major-mode-hook 'org-babel-show-result-all 'append 'local)))


(add-hook 'org-mode-hook (lambda () (add-hook 'change-major-mode-hook 'org-show-block-all 'append 'local)))

If it's your code, then don't do that.

If it's not you, then I would raise a bug report for whichever code is doing it.

Edit: Looks like org's fault to me.


;; Remove overlays when changing major mode
(add-hook 'org-mode-hook
          (lambda () (add-hook 'change-major-mode-hook
                               'org-show-block-all 'append 'local)))


;; Remove overlays when changing major mode
(add-hook 'org-mode-hook
          (lambda () (add-hook 'change-major-mode-hook
                               'org-babel-show-result-all 'append 'local)))

I think there might be an existing bug report for this, and so it might have been fixed upstream already, but have a hunt and see what you can find.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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