mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-04 22:42:59 +00:00
org-edit-src-code: Setup Org Src buffer context before running `org-src-mode-hook'
* lisp/org-src.el (org-edit-src-code): Make sure that `org-coderef-label-format' and `org-src--babel-info' are set before `org-src-mode-hook' is executed. Earlier, `org-src-babel-configure-edit-buffer' that is by default present in the hook would do nothing as it relies upon `org-src--babel-info' being set.
This commit is contained in:
parent
b4687fcd69
commit
c10a079a2c
|
@ -1310,16 +1310,18 @@ name of the sub-editing buffer."
|
|||
element
|
||||
(or edit-buffer-name
|
||||
(org-src--construct-edit-buffer-name (buffer-name) lang))
|
||||
lang-f
|
||||
(lambda ()
|
||||
(when lang-f (funcall lang-f))
|
||||
(setq-local org-coderef-label-format
|
||||
(or (org-element-property :label-fmt element)
|
||||
org-coderef-label-format))
|
||||
(when (eq type 'src-block)
|
||||
(setq org-src--babel-info babel-info)))
|
||||
(and (null code)
|
||||
(lambda () (org-escape-code-in-region (point-min) (point-max))))
|
||||
(and code (org-unescape-code-in-string code)))
|
||||
;; Finalize buffer.
|
||||
(setq-local org-coderef-label-format
|
||||
(or (org-element-property :label-fmt element)
|
||||
org-coderef-label-format))
|
||||
(when (eq type 'src-block)
|
||||
(setq org-src--babel-info babel-info)
|
||||
(let ((edit-prep-func (intern (concat "org-babel-edit-prep:" lang))))
|
||||
(when (fboundp edit-prep-func)
|
||||
(funcall edit-prep-func babel-info))))
|
||||
|
|
Loading…
Reference in a new issue