Use completing-read' in
org-insert-src-block'
This commit is contained in:
parent
d53b28317b
commit
b428de5668
15
README.org
15
README.org
@ -2507,14 +2507,15 @@ When called twice, replace the previously inserted \\(\\) by one $."
|
||||
#+caption[Setup =org-mode-map= 2]:
|
||||
#+caption: Setup =org-mode-map= 2.
|
||||
#+name: lst:setup-org-mode-map-2
|
||||
#+begin_src emacs-lisp :results silent
|
||||
#+begin_src emacs-lisp -n :results silent
|
||||
(with-eval-after-load 'emacs
|
||||
;; Stolen from `org-insert-structure-template'.
|
||||
;; Note: `org-tempo' does not require `tempo' at all.
|
||||
(defcustom org-insert-source-block-default '("emacs-lisp -n :results silent"
|
||||
"python -i -n :results silent"
|
||||
"org")
|
||||
"Default value for `org-insert-source-block' (`M-n' and `M-p')."
|
||||
(defcustom org-insert-source-block-defaults '("emacs-lisp -n :results silent"
|
||||
"latex -n"
|
||||
"org -n"
|
||||
"python -i -n :results silent")
|
||||
"Default values for `org-insert-source-block'."
|
||||
:group 'org)
|
||||
|
||||
(defun org-insert-source-block ()
|
||||
@ -2522,8 +2523,8 @@ When called twice, replace the previously inserted \\(\\) by one $."
|
||||
Prompt for the source block SPEC. With an active region, the
|
||||
region becomes the block BODY. Otherwise, insert an empty block."
|
||||
(interactive)
|
||||
(let* ((spec (read-string "Block spec: " nil nil
|
||||
org-insert-source-block-default))
|
||||
(let* ((spec (completing-read
|
||||
"Block spec: " org-insert-source-block-defaults nil 'confirm))
|
||||
(region? (use-region-p))
|
||||
(region-start (and region? (region-beginning)))
|
||||
(region-end (and region? (copy-marker (region-end)))))
|
||||
|
Loading…
Reference in New Issue
Block a user