(const reorganize-frame)))
(defvar org-src-mode-hook nil
- "Hook run after Org switched a source code snippet to its Emacs mode.
+ "Hook run after Org switched a source code snippet to its Emacs mode.
This hook will run
-- when editing a source code snippet with \"C-c '\".
+- when editing a source code snippet with `\\[org-src-mode-map]'.
- When formatting a source code snippet for export with htmlize.
You may want to use this hook for example to turn off `outline-minor-mode'
(define-minor-mode org-src-mode
"Minor mode for language major mode buffers generated by org.
This minor mode is turned on in two situations:
-- when editing a source code snippet with \"C-c '\".
+- when editing a source code snippet with `\\[org-src-mode-map]'.
- When formatting a source code snippet for export with htmlize.
There is a mode hook, and keybindings for `org-edit-src-exit' and
`org-edit-src-save'")
(setq beg (move-marker beg (nth 0 info))
end (move-marker end (nth 1 info))
msg (if allow-write-back-p
- (substitute-command-keys
- "Edit, then exit with C-c ' (C-c and single quote) -- C-c C-k to abort")
+ "Edit, then exit with C-c ' (C-c and single quote) -- C-c C-k to abort"
"Exit with C-c ' (C-c and single quote) -- C-c C-k to abort")
code (or code (buffer-substring-no-properties beg end))
lang (or (cdr (assoc (nth 2 info) org-src-lang-modes))
(let ((line (org-current-line))
(col (current-column))
(case-fold-search t)
- (msg (substitute-command-keys
- "Edit, then exit with C-c ' (C-c and single quote) -- C-c C-k to abort"))
+ (msg "Edit, then exit with C-c ' (C-c and single quote) -- C-c C-k to abort")
(org-mode-p (derived-mode-p 'org-mode))
(beg (make-marker))
(end (make-marker))
"Save parent buffer with current state source-code buffer."
(interactive)
(if (string-match "Fixed Width" (buffer-name))
- (user-error "Use C-c ' to save and exit, C-c C-k to abort editing")
+ (user-error "%s" "Use C-c ' to save and exit, C-c C-k to abort editing")
(org-src-in-org-buffer (save-buffer))))
(declare-function org-babel-tangle "ob-tangle" (&optional arg target-file lang))
with language major mode bindings. To bind it to C-c @ in all
language major modes, you could use
- (add-hook 'org-src-mode-hook
+ (add-hook \\='org-src-mode-hook
(lambda () (define-key org-src-mode-map \"\\C-c@\"
- 'org-src-do-key-sequence-at-code-block)))
+ \\='org-src-do-key-sequence-at-code-block)))
In that case, for example, C-c @ t issued in code edit buffers
would tangle the current Org code block, C-c @ e would execute