emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Escape single left quotes in docstrings
@ 2022-06-14  9:32 Robert Pluim
  2022-06-16 12:55 ` Ihor Radchenko
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Pluim @ 2022-06-14  9:32 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 105 bytes --]


The emacs-29 byte compiler now complains about unescaped single left
quote. Patch attached.

Robert
-- 

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Escape-single-left-quotes-in-docstrings.patch --]
[-- Type: text/x-diff, Size: 11620 bytes --]

From d86ba4e5522a33f6960207327f6a84b58caa3d04 Mon Sep 17 00:00:00 2001
From: Robert Pluim <rpluim@gmail.com>
Date: Tue, 14 Jun 2022 11:29:12 +0200
Subject: [PATCH] Escape single left quotes in docstrings

* lisp/ob-core.el (org-babel-default-header-args):
* lisp/ob-julia.el (org-babel-julia-evaluate-external-process):
(org-babel-julia-evaluate-session):
* lisp/ob-lua.el (org-babel-lua-read-string):
* lisp/ob-table.el (org-sbe):
* lisp/oc-basic.el (org-cite-basic--shorten-names):
* lisp/org-agenda.el (org-agenda-sorting-strategy):
(org-agenda--mark-blocked-entry):
(org-agenda-set-restriction-lock):
* lisp/org-fold-core.el (org-fold-core--specs):
(org-fold-core-remove-folding-spec):
(org-fold-core-get-folding-spec):
(org-fold-core--isearch-overlays):
* lisp/org-plot.el (org--plot/prime-factors):
* lisp/org-table.el (org-table-collapse-header):
* lisp/org.el (org-special-ctrl-o):
(org-latex-to-html-convert-command):
* lisp/ox-html.el (org-html--unlabel-latex-environment):
* lisp/ox-publish.el (org-publish-find-property):
Use \\=' when there's a need for a single left quote in a docstring.

The emacs-29 byte compiler complains about such usage.
---
 lisp/ob-core.el       | 2 +-
 lisp/ob-julia.el      | 8 ++++----
 lisp/ob-lua.el        | 2 +-
 lisp/ob-table.el      | 2 +-
 lisp/oc-basic.el      | 2 +-
 lisp/org-agenda.el    | 6 +++---
 lisp/org-fold-core.el | 8 ++++----
 lisp/org-plot.el      | 2 +-
 lisp/org-table.el     | 2 +-
 lisp/org.el           | 4 ++--
 lisp/ox-html.el       | 2 +-
 lisp/ox-publish.el    | 2 +-
 12 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/lisp/ob-core.el b/lisp/ob-core.el
index 09d6adfe0..bfb263cfb 100644
--- a/lisp/ob-core.el
+++ b/lisp/ob-core.el
@@ -484,7 +484,7 @@ (defvar org-babel-default-header-args
 evaluates to a string.  The closure is evaluated when the source
 block is being evaluated (e.g. during execution or export), with
 point at the source block.  It is not possible to use an
-arbitrary function symbol (e.g. 'some-func), since org uses
+arbitrary function symbol (e.g. \\='some-func), since org uses
 lexical binding.  To achieve the same functionality, call the
 function within a closure (e.g. (lambda () (some-func))).
 
diff --git a/lisp/ob-julia.el b/lisp/ob-julia.el
index abddca361..be0110f48 100644
--- a/lisp/ob-julia.el
+++ b/lisp/ob-julia.el
@@ -250,8 +250,8 @@ (defun org-babel-julia-evaluate
 (defun org-babel-julia-evaluate-external-process
     (body result-type result-params column-names-p)
   "Evaluate BODY in external julia process.
-If RESULT-TYPE equals 'output then return standard output as a
-string.  If RESULT-TYPE equals 'value then return the value of the
+If RESULT-TYPE equals \\='output then return standard output as a
+string.  If RESULT-TYPE equals \\='value then return the value of the
 last statement in BODY, as elisp."
   (cl-case result-type
     (value
@@ -274,8 +274,8 @@ (defun org-babel-julia-evaluate-external-process
 (defun org-babel-julia-evaluate-session
     (session body result-type result-params column-names-p)
   "Evaluate BODY in SESSION.
-If RESULT-TYPE equals 'output then return standard output as a
-string.  If RESULT-TYPE equals 'value then return the value of the
+If RESULT-TYPE equals \\='output then return standard output as a
+string.  If RESULT-TYPE equals \\='value then return the value of the
 last statement in BODY, as elisp."
   (cl-case result-type
     (value
diff --git a/lisp/ob-lua.el b/lisp/ob-lua.el
index 48de0dbad..c8c28498e 100644
--- a/lisp/ob-lua.el
+++ b/lisp/ob-lua.el
@@ -395,7 +395,7 @@ (defun org-babel-lua-evaluate-session
         (org-babel-lua-table-or-string results)))))
 
 (defun org-babel-lua-read-string (string)
-  "Strip 's from around Lua string."
+  "Strip single quotes from around Lua string."
   (org-unbracket-string "'" "'" string))
 
 (provide 'ob-lua)
diff --git a/lisp/ob-table.el b/lisp/ob-table.el
index 2f092998d..0f6d41c5e 100644
--- a/lisp/ob-table.el
+++ b/lisp/ob-table.el
@@ -84,7 +84,7 @@ (defmacro org-sbe (source-block &rest variables)
  #+end_src
 
 NOTE: The quotation marks around the function name,
-'source-block', are optional.
+\\='source-block\\=', are optional.
 
 NOTE: By default, string variable names are interpreted as
 references to source-code blocks, to force interpretation of a
diff --git a/lisp/oc-basic.el b/lisp/oc-basic.el
index 873986d07..a937f7513 100644
--- a/lisp/oc-basic.el
+++ b/lisp/oc-basic.el
@@ -329,7 +329,7 @@ (defun org-cite-basic--shorten-names (names)
   "Return a list of family names from a list of full NAMES.
 
 To better accomomodate corporate names, this will only shorten
-personal names of the form 'family, given'."
+personal names of the form \"family, given\"."
   (when (stringp names)
     (mapconcat
      (lambda (name)
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 0479a0e1f..2a8c10d48 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1628,7 +1628,7 @@ (defcustom org-agenda-sorting-strategy
 
 The different possibilities will be tried in sequence, and testing stops
 if one comparison returns a \"not-equal\".  For example, the default
-    '(time-up category-keep priority-down)
+    \\='(time-up category-keep priority-down)
 means: Pull out all entries having a specified time of day and sort them,
 in order to make a time schedule for the current day the first thing in the
 agenda listing for the day.  Of the entries without a time indication, keep
@@ -4138,7 +4138,7 @@ (defun org-agenda--mark-blocked-entry (entry)
 
 If the header at `org-hd-marker' is blocked according to
 `org-entry-blocked-p', then if `org-agenda-dim-blocked-tasks' is
-'invisible and the header is not blocked by checkboxes, set the
+\\='invisible and the header is not blocked by checkboxes, set the
 text property `org-todo-blocked' to `invisible', otherwise set it
 to t."
   (when (get-text-property 0 'todo-state entry)
@@ -7857,7 +7857,7 @@ (defun org-agenda-set-restriction-lock (&optional type)
 When in a restricted subtree, remove it.
 
 The restriction will span over the entire file if TYPE is `file',
-or if type is '(4), or if the cursor is before the first headline
+or if type is \\='(4), or if the cursor is before the first headline
 in the file.  Otherwise, only apply the restriction to the current
 subtree."
   (interactive "P")
diff --git a/lisp/org-fold-core.el b/lisp/org-fold-core.el
index 939702c5c..ca4b6f05b 100644
--- a/lisp/org-fold-core.el
+++ b/lisp/org-fold-core.el
@@ -381,7 +381,7 @@ (defvar-local org-fold-core--specs '((org-fold-visible
                       using isearch.
 - :isearch-open     :: non-nil means that isearch can reveal text hidden
                       using this spec.  This property does nothing
-                      when 'isearch-ignore property is non-nil.
+                      when \\='isearch-ignore property is non-nil.
 - :front-sticky     :: non-nil means that text prepended to the folded text
                       is automatically folded.
 - :rear-sticky      :: non-nil means that text appended to the folded text
@@ -708,7 +708,7 @@ (defun org-fold-core-remove-folding-spec (spec &optional buffer)
 SPEC must be a symbol.
 
 BUFFER can be a buffer to remove SPEC in, nil to remove SPEC in current
-buffer, or 'all to remove SPEC in all open `org-mode' buffers and all
+buffer, or \\='all to remove SPEC in all open `org-mode' buffers and all
 future org buffers."
   (org-fold-core--check-spec spec)
   (when (eq buffer 'all)
@@ -777,7 +777,7 @@ (defun org-fold-core-get-folding-spec (&optional spec-or-alias pom)
 Return nil if there is no folding at point or POM.
 If SPEC-OR-ALIAS is nil, return a folding spec with highest priority
 among present at `point' or POM.
-If SPEC-OR-ALIAS is 'all, return the list of all present folding
+If SPEC-OR-ALIAS is \\='all, return the list of all present folding
 specs.
 If SPEC-OR-ALIAS is a valid folding spec or a spec alias, return the
 corresponding folding spec (if the text is folded using that spec)."
@@ -1005,7 +1005,7 @@ (defvar org-fold-core--isearch-overlays nil
 This is used to allow searching in regions hidden via text properties.
 As for [2020-05-09 Sat], Isearch only has special handling of hidden overlays.
 Any text hidden via text properties is not revealed even if `search-invisible'
-is set to 't.")
+is set to `t'.")
 
 (defvar-local org-fold-core--isearch-local-regions (make-hash-table :test 'equal)
   "Hash table storing temporarily shown folds from isearch matches.")
diff --git a/lisp/org-plot.el b/lisp/org-plot.el
index f238bfbc6..c6bae4b62 100644
--- a/lisp/org-plot.el
+++ b/lisp/org-plot.el
@@ -280,7 +280,7 @@ (defun org--plot/item-frequencies (values &optional normalise)
 	     collect (cons n (/ (length m) normaliser)))))
 
 (defun org--plot/prime-factors (value)
-  "Return the prime decomposition of VALUE, e.g. for 12, '(3 2 2)."
+  "Return the prime decomposition of VALUE, e.g. for 12, \\='(3 2 2)."
   (let ((factors '(1)) (i 1))
     (while (/= 1 value)
       (setq i (1+ i))
diff --git a/lisp/org-table.el b/lisp/org-table.el
index b160dc97c..cbc2ce061 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -5466,7 +5466,7 @@ (defun org-table-to-lisp (&optional txt)
         (nreverse table)))))
 
 (defun org-table-collapse-header (table &optional separator max-header-lines)
-  "Collapse the lines before 'hline into a single header.
+  "Collapse the lines before \\='hline into a single header.
 
 The given TABLE is a list of lists as returned by `org-table-to-lisp'.
 The leading lines before the first `hline' symbol are considered
diff --git a/lisp/org.el b/lisp/org.el
index 8e7aadde5..f3315252b 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -1509,7 +1509,7 @@ (defcustom org-ctrl-k-protect-subtree nil
 	  (const :tag "Never kill a hidden subtree with C-k" error)))
 
 (defcustom org-special-ctrl-o t
-  "Non-nil means, make `C-o' insert a row in tables."
+  "Non-nil means, make `open-line' (\\[open-line]) insert a row in tables."
   :group 'org-edit-structure
   :type 'boolean)
 
@@ -3120,7 +3120,7 @@ (defcustom org-latex-to-html-convert-command nil
 %i:     The LaTeX fragment to be converted.
 
 For example, this could be used with LaTeXML as
-\"latexmlc 'literal:%i' --profile=math --preload=siunitx.sty 2>/dev/null\"."
+\"latexmlc \\='literal:%i\\=' --profile=math --preload=siunitx.sty 2>/dev/null\"."
   :group 'org-latex
   :package-version '(Org . "9.4")
   :type '(choice
diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index 81ef002a0..32c0699a6 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2909,7 +2909,7 @@ (defun org-html--latex-environment-numbered-p (element)
 
 (defun org-html--unlabel-latex-environment (latex-frag)
   "Change environment in LATEX-FRAG string to an unnumbered one.
-For instance, change an 'equation' environment to 'equation*'."
+For instance, change an \\='equation\\=' environment to \\='equation*\\='."
   (replace-regexp-in-string
    "\\`[ \t]*\\\\begin{\\([^*]+?\\)}"
    "\\1*"
diff --git a/lisp/ox-publish.el b/lisp/ox-publish.el
index 86166e94b..0744a6f00 100644
--- a/lisp/ox-publish.el
+++ b/lisp/ox-publish.el
@@ -839,7 +839,7 @@ (defun org-publish-find-property (file property project &optional backend)
 latter case, optional argument BACKEND has to be set to the
 back-end where the option is defined, e.g.,
 
-  (org-publish-find-property file :subtitle 'latex)
+  (org-publish-find-property file :subtitle \\='latex)
 
 Return value may be a string or a list, depending on the type of
 PROPERTY, i.e. \"behavior\" parameter from `org-export-options-alist'."
-- 
2.35.1.607.gf01e51a7cf


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-16 13:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-14  9:32 [PATCH] Escape single left quotes in docstrings Robert Pluim
2022-06-16 12:55 ` Ihor Radchenko

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).