forked from mirrors/org-mode
ob-core: Add org-babel-uppercase-example-markers option
* lisp/ob-core.el (org-babel-capitalize-example-region-markers): Mark as obsolete. (org-babel-uppercase-example-markers): New defcustom to replace defvar org-babel-capitalize-example-region-markers. (org-babel-examplify-region): Use new option. Rather than moving org-babel-capitalize-example-region-markers to a defcustom, give the option a new name that makes it clearer that all characters, not just the first, will be in upper case. Suggested-by: Vicente Vera <vicentemvp@gmail.com> <http://permalink.gmane.org/gmane.emacs.orgmode/111656>
This commit is contained in:
parent
0ba5e35082
commit
9c111f63d3
|
@ -218,6 +218,13 @@ document with ~org-mark-ring-goto~ (default binding =C-c &=).
|
||||||
*** ~org-get-heading~ accepts two more optional arguments
|
*** ~org-get-heading~ accepts two more optional arguments
|
||||||
|
|
||||||
See docstring for details.
|
See docstring for details.
|
||||||
|
|
||||||
|
*** New option ~org-babel-uppercase-example-markers~
|
||||||
|
|
||||||
|
This variable is a ~defcustom~ and replaces the variable
|
||||||
|
~org-babel-capitalize-example-region-markers~, which is a ~defvar~ and
|
||||||
|
is now obselete.
|
||||||
|
|
||||||
* Version 9.0
|
* Version 9.0
|
||||||
|
|
||||||
** Incompatible changes
|
** Incompatible changes
|
||||||
|
|
|
@ -179,6 +179,14 @@ This string must include a \"%s\" which will be replaced by the results."
|
||||||
:package-version '(Org . "9.0")
|
:package-version '(Org . "9.0")
|
||||||
:safe #'booleanp)
|
:safe #'booleanp)
|
||||||
|
|
||||||
|
(defcustom org-babel-uppercase-example-markers nil
|
||||||
|
"When non-nil, begin/end example markers will be inserted in upper case."
|
||||||
|
:group 'org-babel
|
||||||
|
:type 'boolean
|
||||||
|
:version "26.1"
|
||||||
|
:package-version '(Org . "9.1")
|
||||||
|
:safe #'booleanp)
|
||||||
|
|
||||||
(defun org-babel-noweb-wrap (&optional regexp)
|
(defun org-babel-noweb-wrap (&optional regexp)
|
||||||
(concat org-babel-noweb-wrap-start
|
(concat org-babel-noweb-wrap-start
|
||||||
(or regexp "\\([^ \t\n].+?[^ \t]\\|[^ \t\n]\\)")
|
(or regexp "\\([^ \t\n].+?[^ \t]\\|[^ \t\n]\\)")
|
||||||
|
@ -2435,15 +2443,12 @@ file's directory then expand relative links."
|
||||||
result)
|
result)
|
||||||
(if description (concat "[" description "]") ""))))
|
(if description (concat "[" description "]") ""))))
|
||||||
|
|
||||||
(defvar org-babel-capitalize-example-region-markers nil
|
|
||||||
"Make true to capitalize begin/end example markers inserted by code blocks.")
|
|
||||||
|
|
||||||
(defun org-babel-examplify-region (beg end &optional results-switches inline)
|
(defun org-babel-examplify-region (beg end &optional results-switches inline)
|
||||||
"Comment out region using the inline `==' or `: ' org example quote."
|
"Comment out region using the inline `==' or `: ' org example quote."
|
||||||
(interactive "*r")
|
(interactive "*r")
|
||||||
(let ((maybe-cap
|
(let ((maybe-cap
|
||||||
(lambda (str)
|
(lambda (str)
|
||||||
(if org-babel-capitalize-example-region-markers (upcase str) str))))
|
(if org-babel-uppercase-example-markers (upcase str) str))))
|
||||||
(if inline
|
(if inline
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char beg)
|
(goto-char beg)
|
||||||
|
|
|
@ -195,6 +195,9 @@ Counting starts at 1."
|
||||||
'org-agenda-today-p "Org 9.0")
|
'org-agenda-today-p "Org 9.0")
|
||||||
(define-obsolete-function-alias 'org-babel-examplize-region
|
(define-obsolete-function-alias 'org-babel-examplize-region
|
||||||
'org-babel-examplify-region "Org 9.0")
|
'org-babel-examplify-region "Org 9.0")
|
||||||
|
(define-obsolete-variable-alias 'org-babel-capitalize-example-region-markers
|
||||||
|
'org-babel-uppercase-example-markers "Org 9.1")
|
||||||
|
|
||||||
(define-obsolete-function-alias 'org-babel-trim 'org-trim "Org 9.0")
|
(define-obsolete-function-alias 'org-babel-trim 'org-trim "Org 9.0")
|
||||||
(define-obsolete-variable-alias 'org-html-style 'org-html-head "24.4")
|
(define-obsolete-variable-alias 'org-html-style 'org-html-head "24.4")
|
||||||
(define-obsolete-function-alias 'org-insert-columns-dblock
|
(define-obsolete-function-alias 'org-insert-columns-dblock
|
||||||
|
|
Loading…
Reference in New Issue