mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2025-02-02 20:55:13 +00:00
Avoid error and unnecessary message in transient use of code edit buffer
* ob.el (org-babel-do-in-edit-buffer): Suppress message and check that org-src buffer is current before attempting exit * org-src.el (org-edit-src-code): New argument quietlyp allows message to be suppressed
This commit is contained in:
parent
76790e1aa8
commit
4ac8294020
@ -486,9 +486,11 @@ of the source block to the kill ring."
|
||||
"Evaluate BODY in edit buffer if there is a code block at point.
|
||||
Return t if a code block was found at point, nil otherwise."
|
||||
`(let ((org-src-window-setup 'switch-invisibly))
|
||||
(when (org-edit-src-code)
|
||||
(when (org-edit-src-code nil nil nil 'quietly)
|
||||
,@body
|
||||
(org-edit-src-exit) t)))
|
||||
(if (org-bound-and-true-p org-edit-src-from-org-mode)
|
||||
(org-edit-src-exit))
|
||||
t)))
|
||||
|
||||
(defun org-babel-do-key-sequence-in-edit-buffer (key)
|
||||
"Read key sequence and execute the command in edit buffer.
|
||||
|
@ -194,7 +194,7 @@ This minor mode is turned on in two situations:
|
||||
There is a mode hook, and keybindings for `org-edit-src-exit' and
|
||||
`org-edit-src-save'")
|
||||
|
||||
(defun org-edit-src-code (&optional context code edit-buffer-name)
|
||||
(defun org-edit-src-code (&optional context code edit-buffer-name quietp)
|
||||
"Edit the source code example at point.
|
||||
The example is copied to a separate buffer, and that buffer is switched
|
||||
to the correct language mode. When done, exit with \\[org-edit-src-exit].
|
||||
@ -298,7 +298,7 @@ the edited version. Optional argument CONTEXT is used by
|
||||
(set-buffer-modified-p nil)
|
||||
(and org-edit-src-persistent-message
|
||||
(org-set-local 'header-line-format msg)))
|
||||
(message "%s" msg)
|
||||
(unless quietp (message "%s" msg))
|
||||
t)))
|
||||
|
||||
(defun org-edit-src-continue (e)
|
||||
|
Loading…
x
Reference in New Issue
Block a user