From 17edaf8c14e9999f87b2a038ababb8d9dcf887d3 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 20 Sep 2018 11:23:49 +0200 Subject: [PATCH] "src block" -> "source block" in documentation and comments * etc/ORG-NEWS (Maxima: new headers ~:prologue~ and ~:epilogue~): (Texinfo exports inline source blocks as ~@code{}~): (Default lexical evaluation of emacs-lisp source blocks): * lisp/ob-clojure.el (org-babel-clojure-default-ns): * lisp/ob-core.el (org-babel-named-src-block-regexp-for-name): (org-babel-current-src-block-location): (org-babel-mark-block): (org-babel-insert-result): * lisp/ob-emacs-lisp.el (org-babel-default-header-args:emacs-lisp): * lisp/ob-exp.el (org-babel-exp-process-buffer): * lisp/ob-lob.el (org-babel-lob-ingest): * lisp/ob-ref.el: * lisp/org-element.el (org-element-object-restrictions): (org-element-src-block-parser): (org-element-inline-src-block-parser): * lisp/org-lint.el: (org-lint--checkers): * lisp/org-pcomplete.el (pcomplete/org-mode/block-option/src): * lisp/org-src.el (org-edit-inline-src-code): * lisp/org.el (org-ctrl-c-ctrl-c): (org-in-src-block-p): (org-fill-element): * lisp/ox-html.el (org-html--textarea-block): (org-html-format-code): * lisp/ox-latex.el (org-latex-minted-options): (org-latex-custom-lang-environments): * lisp/ox-md.el: * lisp/ox-odt.el (org-odt-format-code): * lisp/ox.el (org-export-collect-listings): * testing/lisp/test-ob-exp.el (ob-exp/src-block-with-affiliated-keyword): * testing/lisp/test-ob.el (test-ob/preserve-results-indentation): Correct "src block" occurrences when they do not specifically refer to the element type `src-block'. --- etc/ORG-NEWS | 8 ++++---- lisp/ob-clojure.el | 2 +- lisp/ob-core.el | 10 +++++----- lisp/ob-emacs-lisp.el | 2 +- lisp/ob-exp.el | 6 +++--- lisp/ob-lob.el | 2 +- lisp/ob-ref.el | 4 ++-- lisp/org-element.el | 11 ++++++----- lisp/org-lint.el | 6 +++--- lisp/org-pcomplete.el | 5 +++-- lisp/org-src.el | 2 +- lisp/org.el | 8 ++++---- lisp/ox-html.el | 8 ++++---- lisp/ox-latex.el | 19 ++++++++++--------- lisp/ox-md.el | 2 +- lisp/ox-odt.el | 2 +- lisp/ox.el | 4 ++-- testing/lisp/test-ob-exp.el | 2 +- testing/lisp/test-ob.el | 2 +- 19 files changed, 54 insertions(+), 51 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index 2a22be0d5..6d83ae571 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -609,7 +609,7 @@ value of the code will be displayed in the results section. **** Maxima: new headers ~:prologue~ and ~:epilogue~ Babel options ~:prologue~ and ~:epilogue~ have been implemented for -Maxima src blocks which prepend and append, respectively, the given +Maxima source blocks which prepend and append, respectively, the given code strings. This can be useful for specifying formatting settings which would add clutter to exported code. For instance, you can use this ~:prologue "fpprintprec: 2; linel: 50;"~ for presenting Maxima @@ -891,7 +891,7 @@ is now obsolete. Now ~=...=~ markup uses ~@samp{}~ instead of ~@verb{}~. You can use ~@verb{}~ again by customizing the variable. *** Texinfo exports example blocks as ~@example~ -*** Texinfo exports inline src blocks as ~@code{}~ +*** Texinfo exports inline source blocks as ~@code{}~ *** Texinfo default table markup is ~@asis~ It used to be ~@samp~ but ~@asis~ is neutral and, therefore, more suitable as a default value. @@ -1708,9 +1708,9 @@ docstring for more information. ** New features -*** Default lexical evaluation of emacs-lisp src blocks +*** Default lexical evaluation of emacs-lisp source blocks -Emacs-lisp src blocks in babel are now evaluated using lexical +Emacs-lisp source blocks in Babel are now evaluated using lexical scoping. There is a new header to control this behavior. The default results in an eval with lexical scoping. diff --git a/lisp/ob-clojure.el b/lisp/ob-clojure.el index 98bed1287..d5b918b01 100644 --- a/lisp/ob-clojure.el +++ b/lisp/ob-clojure.el @@ -80,7 +80,7 @@ If the value is nil, timeout is disabled." (const :tag "SLIME" slime))) (defcustom org-babel-clojure-default-ns "user" - "Default Clojure namespace for src block when all find ns ways failed." + "Default Clojure namespace for source block when finding ns failed." :type 'string :group 'org-babel) diff --git a/lisp/ob-core.el b/lisp/ob-core.el index 42360d618..32de18e77 100644 --- a/lisp/ob-core.el +++ b/lisp/ob-core.el @@ -521,7 +521,7 @@ to raise errors for all languages.") "Hook for functions to be called after `org-babel-execute-src-block'") (defun org-babel-named-src-block-regexp-for-name (&optional name) - "This generates a regexp used to match a src block named NAME. + "This generates a regexp used to match a source block named NAME. If NAME is nil, match any name. Matched name is then put in match group 9. Other match groups are defined in `org-babel-src-block-regexp'." @@ -555,7 +555,7 @@ Remove final newline character and spurious indentation." ;;; functions (defvar org-babel-current-src-block-location nil - "Marker pointing to the src block currently being executed. + "Marker pointing to the source block currently being executed. This may also point to a call line or an inline code block. If multiple blocks are being executed (e.g., in chained execution through use of the :var header argument) this marker points to @@ -1855,7 +1855,7 @@ With optional prefix argument ARG, jump backward ARG many source blocks." ;;;###autoload (defun org-babel-mark-block () - "Mark current src block." + "Mark current source block." (interactive) (let ((head (org-babel-where-is-src-block-head))) (when head @@ -2216,10 +2216,10 @@ code ---- the results are extracted in the syntax of the source optional LANG argument. list ---- the results are rendered as a list. This option not - allowed for inline src blocks. + allowed for inline source blocks. table --- the results are rendered as a table. This option not - allowed for inline src blocks. + allowed for inline source blocks. INFO may provide the values of these header arguments (in the `header-arguments-alist' see the docstring for diff --git a/lisp/ob-emacs-lisp.el b/lisp/ob-emacs-lisp.el index 8ea2ec127..f6750469e 100644 --- a/lisp/ob-emacs-lisp.el +++ b/lisp/ob-emacs-lisp.el @@ -34,7 +34,7 @@ (defvar org-babel-default-header-args:emacs-lisp '((:lexical . "no")) "Default arguments for evaluating an emacs-lisp source block. -A value of \"yes\" or t causes src blocks to be eval'd using +A value of \"yes\" or t causes source blocks to be eval'd using lexical scoping. It can also be an alist mapping symbols to their value. It is used as the optional LEXICAL argument to `eval', which see.") diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el index 9ab93ecb4..482649e5c 100644 --- a/lisp/ob-exp.el +++ b/lisp/ob-exp.el @@ -209,9 +209,9 @@ this template." (progn (goto-char end) (skip-chars-forward " \t") (point))) - ;; Otherwise: remove inline src block but - ;; preserve following white spaces. Then - ;; insert value. + ;; Otherwise: remove inline source block + ;; but preserve following white spaces. + ;; Then insert value. (delete-region begin end) (insert replacement))))) ((or `babel-call `inline-babel-call) diff --git a/lisp/ob-lob.el b/lisp/ob-lob.el index 9bf6858ef..734d7d0a4 100644 --- a/lisp/ob-lob.el +++ b/lisp/ob-lob.el @@ -62,7 +62,7 @@ should not be inherited from a source block.") (cons (cons source info) (assq-delete-all source org-babel-library-of-babel)))) (cl-incf lob-ingest-count)))) - (message "%d src block%s added to Library of Babel" + (message "%d source block%s added to Library of Babel" lob-ingest-count (if (> lob-ingest-count 1) "s" "")) lob-ingest-count)) diff --git a/lisp/ob-ref.el b/lisp/ob-ref.el index 78cf7df0f..095c420f3 100644 --- a/lisp/ob-ref.el +++ b/lisp/ob-ref.el @@ -37,8 +37,8 @@ ;; - resource-id :: the id or name of the resource -;; So an example of a simple src block referencing table data in the -;; same file would be +;; So an example of a simple source block referencing table data in +;; the same file would be ;; #+NAME: sandbox ;; | 1 | 2 | 3 | diff --git a/lisp/org-element.el b/lisp/org-element.el index d757e65fa..cdb574e17 100644 --- a/lisp/org-element.el +++ b/lisp/org-element.el @@ -307,8 +307,9 @@ Don't modify it, set `org-element-affiliated-keywords' instead.") (strike-through ,@standard-set) (subscript ,@standard-set) (superscript ,@standard-set) - ;; Ignore inline babel call and inline src block as formulas are - ;; possible. Also ignore line breaks and statistics cookies. + ;; Ignore inline babel call and inline source block as formulas + ;; are possible. Also ignore line breaks and statistics + ;; cookies. (table-cell bold code entity export-snippet footnote-reference italic latex-fragment link macro radio-target strike-through subscript superscript target timestamp underline verbatim) @@ -2399,7 +2400,7 @@ containing `:closed', `:deadline', `:scheduled', `:begin', ;;;; Src Block (defun org-element-src-block-parser (limit affiliated) - "Parse a src block. + "Parse a source block. LIMIT bounds the search. AFFILIATED is a list of which CAR is the buffer position at the beginning of the first affiliated @@ -2455,7 +2456,7 @@ Assume point is at the beginning of the block." (string-match "-l +\"\\([^\"\n]+\\)\"" switches) (match-string 1 switches))) ;; Should labels be retained in (or stripped from) - ;; src blocks? + ;; source blocks? (retain-labels (or (not switches) (not (string-match "-r\\>" switches)) @@ -2929,7 +2930,7 @@ When at an inline source block, return a list whose car is `:language', `:value', `:parameters' and `:post-blank' as keywords. Otherwise, return nil. -Assume point is at the beginning of the inline src block." +Assume point is at the beginning of the inline source block." (save-excursion (catch :no-object (when (let ((case-fold-search nil)) diff --git a/lisp/org-lint.el b/lisp/org-lint.el index 1b969f0d2..a311b1d02 100644 --- a/lisp/org-lint.el +++ b/lisp/org-lint.el @@ -69,13 +69,13 @@ ;; - duplicate footnote definitions ;; - orphaned affiliated keywords ;; - obsolete affiliated keywords -;; - missing language in src blocks +;; - missing language in source blocks ;; - missing back-end in export blocks ;; - invalid Babel call blocks ;; - NAME values with a colon ;; - deprecated export block syntax ;; - deprecated Babel header properties -;; - wrong header arguments in src blocks +;; - wrong header arguments in source blocks ;; - misuse of CATEGORY keyword ;; - "coderef" links with unknown destination ;; - "custom-id" links with unknown destination @@ -162,7 +162,7 @@ :trust 'low) (make-org-lint-checker :name 'missing-language-in-src-block - :description "Report missing language in src blocks" + :description "Report missing language in source blocks" :categories '(babel)) (make-org-lint-checker :name 'missing-backend-in-export-block diff --git a/lisp/org-pcomplete.el b/lisp/org-pcomplete.el index 2653658c2..a10a6a2f2 100644 --- a/lisp/org-pcomplete.el +++ b/lisp/org-pcomplete.el @@ -346,8 +346,9 @@ This needs more work, to handle headings with lots of spaces in them." (substring pcomplete-stub 1))) (defun pcomplete/org-mode/block-option/src () - "Complete the arguments of a begin_src block. -Complete a language in the first field, the header arguments and switches." + "Complete the arguments of a source block. +Complete a language in the first field, the header arguments and +switches." (pcomplete-here (mapcar (lambda(x) (symbol-name (nth 3 x))) diff --git a/lisp/org-src.el b/lisp/org-src.el index 42e1225ed..9c462b7e7 100644 --- a/lisp/org-src.el +++ b/lisp/org-src.el @@ -1037,7 +1037,7 @@ name of the sub-editing buffer." (org-src--construct-edit-buffer-name (buffer-name) lang) lang-f (lambda () - ;; Inline src blocks are limited to one line. + ;; Inline source blocks are limited to one line. (while (re-search-forward "\n[ \t]*" nil t) (replace-match " ")) ;; Trim contents. (goto-char (point-min)) diff --git a/lisp/org.el b/lisp/org.el index affac0b53..ebe928bcc 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -20241,7 +20241,7 @@ This command does many different things, depending on context: ;; Act according to type of element or object at point. ;; ;; Do nothing on a blank line, except if it is contained in - ;; a src block. Hence, we first check if point is in such + ;; a source block. Hence, we first check if point is in such ;; a block and then if it is at a blank line. (pcase type ((or `inline-src-block `src-block) @@ -21226,8 +21226,8 @@ If there is no description, use the link target." (defun org-in-src-block-p (&optional inside) "Whether point is in a code source block. -When INSIDE is non-nil, don't consider we are within a src block -when point is at #+BEGIN_SRC or #+END_SRC." +When INSIDE is non-nil, don't consider we are within a source +block when point is at #+BEGIN_SRC or #+END_SRC." (let ((case-fold-search t)) (or (and (eq (get-char-property (point) 'src-block) t)) (and (not inside) @@ -22030,7 +22030,7 @@ a footnote definition, try to fill the first paragraph within." ;; First check if point is in a blank line at the beginning of ;; the buffer. In that case, ignore filling. (cl-case (org-element-type element) - ;; Use major mode filling function is src blocks. + ;; Use major mode filling function is source blocks. (src-block (org-babel-do-key-sequence-in-edit-buffer (kbd "M-q"))) ;; Align Org tables, leave table.el tables as-is. (table-row (org-table-align) t) diff --git a/lisp/ox-html.el b/lisp/ox-html.el index 90fa54f4e..c5b6369c8 100644 --- a/lisp/ox-html.el +++ b/lisp/ox-html.el @@ -1706,7 +1706,7 @@ object unless a different class is specified with an attribute." (defun org-html--textarea-block (element) "Transcode ELEMENT into a textarea block. -ELEMENT is either a src block or an example block." +ELEMENT is either a source or an example block." (let* ((code (car (org-export-unravel-code element))) (attr (org-export-read-attribute :attr_html element))) (format "

\n\n

" @@ -2250,14 +2250,14 @@ line of code." (defun org-html-format-code (element info) "Format contents of ELEMENT as source code. -ELEMENT is either an example block or a src block. INFO is -a plist used as a communication channel." +ELEMENT is either an example or a source block. INFO is a plist +used as a communication channel." (let* ((lang (org-element-property :language element)) ;; Extract code and references. (code-info (org-export-unravel-code element)) (code (car code-info)) (refs (cdr code-info)) - ;; Does the src block contain labels? + ;; Does the source block contain labels? (retain-labels (org-element-property :retain-labels element)) ;; Does it have line numbers? (num-start (org-export-get-loc element info))) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 7191a39b8..3f5d2eeeb 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1027,7 +1027,7 @@ value. For example, (setq org-latex-minted-options \\='((\"bgcolor\" \"bg\") (\"frame\" \"lines\"))) -will result in src blocks being exported with +will result in source blocks being exported with \\begin{minted}[bgcolor=bg,frame=lines]{} @@ -1048,12 +1048,13 @@ block-specific options, you may use the following syntax: (defcustom org-latex-custom-lang-environments nil "Alist mapping languages to language-specific LaTeX environments. -It is used during export of src blocks by the listings and minted -latex packages. The environment may be a simple string, composed of -only letters and numbers. In this case, the string is directly the -name of the latex environment to use. The environment may also be -a format string. In this case the format string will be directly -exported. This format string may contain these elements: +It is used during export of source blocks by the listings and +minted latex packages. The environment may be a simple string, +composed of only letters and numbers. In this case, the string +is directly the name of the latex environment to use. The +environment may also be a format string. In this case the format +string will be directly exported. This format string may contain +these elements: %s for the formatted source %c for the caption @@ -1075,7 +1076,7 @@ would have the effect that if Org encounters a Python source block during LaTeX export it will produce \\begin{pythoncode} - + \\end{pythoncode} and if Org encounters an Ocaml source block during LaTeX export it @@ -1083,7 +1084,7 @@ will produce \\begin{listing} \\begin{minted}[]{ocaml} - + \\end{minted} \\caption{} \\label{