emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/dash 4f3238b 300/316: Strip leading zeros from octal es


From: ELPA Syncer
Subject: [elpa] externals/dash 4f3238b 300/316: Strip leading zeros from octal escapes in Emacs 26
Date: Mon, 15 Feb 2021 15:58:21 -0500 (EST)

branch: externals/dash
commit 4f3238be8ad95f51ffe72b5511d3f4c741264a8c
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>

    Strip leading zeros from octal escapes in Emacs 26
    
    * dev/examples-to-info.el (dash--print-lisp-as-texi):
    * dev/examples-to-docs.el (dash--print-lisp-as-md): Strip leading
    zeros from octal escapes in Emacs 26, for consistency with Emacs
    27+.
    (example-to-string): Remove redundant print-quoted binding.
---
 dev/examples-to-docs.el | 14 ++++++++------
 dev/examples-to-info.el |  9 +++++----
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/dev/examples-to-docs.el b/dev/examples-to-docs.el
index 983f8fb..b2a073e 100644
--- a/dev/examples-to-docs.el
+++ b/dev/examples-to-docs.el
@@ -36,14 +36,16 @@
   (let ((print-quoted t)
         (print-escape-control-characters t))
     (save-excursion (prin1 obj)))
-  (while (re-search-forward
-          (rx (| (group ?\' symbol-start "nil" symbol-end) "\\?")) nil 'move)
-    ;; 'nil -> (), `-any\?' -> `-any?'.
-    (replace-match (if (match-beginning 1) "()" "?") t t)))
+  (while (re-search-forward (rx (| (group ?\' symbol-start "nil" symbol-end)
+                                   (group "\\00") "\\?"))
+                            nil 'move)
+    (replace-match (cond ((match-beginning 1) "()") ; 'nil -> ().
+                         ((match-beginning 2) "\\") ; \00N -> \N.
+                         ("?"))                     ; `-any\?' -> `-any?'.
+                   t t)))
 
 (defun example-to-string (example)
-  (pcase-let ((`(,actual ,sym ,expected) example)
-              (print-quoted t))
+  (pcase-let ((`(,actual ,sym ,expected) example))
     (cond ((eq sym '!!>)
            ;; Print actual error message.
            (setq expected (error-message-string (-list expected))))
diff --git a/dev/examples-to-info.el b/dev/examples-to-info.el
index 4ff86fc..a32ca5f 100644
--- a/dev/examples-to-info.el
+++ b/dev/examples-to-info.el
@@ -34,11 +34,12 @@
         (print-escape-control-characters t))
     (save-excursion (prin1 obj)))
   (while (re-search-forward (rx (| (group ?\' symbol-start "nil" symbol-end)
-                                   (group "\\?") (in "{}")))
+                                   (group "\\?") (group "\\00") (in "{}")))
                             nil 'move)
-    (replace-match (cond ((match-beginning 1) "'()") ; 'nil -> '().
-                         ((match-beginning 2) "?")   ; `-any\?' -> `-any?'.
-                         ("@\\&"))                   ; { -> @{.
+    (replace-match (cond ((match-beginning 1) "'()")  ; 'nil -> '().
+                         ((match-beginning 2) "?")    ; `-any\?' -> `-any?'.
+                         ((match-beginning 3) "\\\\") ; \00N -> \N.
+                         ("@\\&"))                    ; { -> @{.
                    t)))
 
 (defun example-to-string (example)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]