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]:
|
||||||
#+caption: Setup =org-mode-map= 2.
|
#+caption: Setup =org-mode-map= 2.
|
||||||
#+name: lst: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
|
(with-eval-after-load 'emacs
|
||||||
;; Stolen from `org-insert-structure-template'.
|
;; Stolen from `org-insert-structure-template'.
|
||||||
;; Note: `org-tempo' does not require `tempo' at all.
|
;; Note: `org-tempo' does not require `tempo' at all.
|
||||||
(defcustom org-insert-source-block-default '("emacs-lisp -n :results silent"
|
(defcustom org-insert-source-block-defaults '("emacs-lisp -n :results silent"
|
||||||
"python -i -n :results silent"
|
"latex -n"
|
||||||
"org")
|
"org -n"
|
||||||
"Default value for `org-insert-source-block' (`M-n' and `M-p')."
|
"python -i -n :results silent")
|
||||||
|
"Default values for `org-insert-source-block'."
|
||||||
:group 'org)
|
:group 'org)
|
||||||
|
|
||||||
(defun org-insert-source-block ()
|
(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
|
Prompt for the source block SPEC. With an active region, the
|
||||||
region becomes the block BODY. Otherwise, insert an empty block."
|
region becomes the block BODY. Otherwise, insert an empty block."
|
||||||
(interactive)
|
(interactive)
|
||||||
(let* ((spec (read-string "Block spec: " nil nil
|
(let* ((spec (completing-read
|
||||||
org-insert-source-block-default))
|
"Block spec: " org-insert-source-block-defaults nil 'confirm))
|
||||||
(region? (use-region-p))
|
(region? (use-region-p))
|
||||||
(region-start (and region? (region-beginning)))
|
(region-start (and region? (region-beginning)))
|
||||||
(region-end (and region? (copy-marker (region-end)))))
|
(region-end (and region? (copy-marker (region-end)))))
|
||||||
|
Loading…
Reference in New Issue
Block a user