Move case-fold-search binding to where it's used

* dev/examples-to-info.el (example-to-string): Move case-fold-search
binding from here...
(dash--print-lisp-as-texi): ...to here, where it's needed.
master
Basil L. Contovounesios 5 years ago
parent 4f3238be8a
commit 6c41b327be
No known key found for this signature in database
GPG Key ID: 205AB54A5D5D8CFF
  1. 24
      dev/examples-to-info.el

@ -31,21 +31,21 @@
(defun dash--print-lisp-as-texi (obj)
"Print Lisp OBJ suitably for Texinfo."
(let ((print-quoted t)
(print-escape-control-characters t))
(save-excursion (prin1 obj)))
(while (re-search-forward (rx (| (group ?\' symbol-start "nil" symbol-end)
(group "\\?") (group "\\00") (in "{}")))
nil 'move)
(replace-match (cond ((match-beginning 1) "'()") ; 'nil -> '().
((match-beginning 2) "?") ; `-any\?' -> `-any?'.
((match-beginning 3) "\\\\") ; \00N -> \N.
("@\\&")) ; { -> @{.
t)))
(print-escape-control-characters t)
(case-fold-search nil))
(save-excursion (prin1 obj))
(while (re-search-forward (rx (| (group ?\' symbol-start "nil" symbol-end)
(group "\\?") (group "\\00") (in "{}")))
nil 'move)
(replace-match (cond ((match-beginning 1) "'()") ; 'nil -> '().
((match-beginning 2) "?") ; `-any\?' -> `-any?'.
((match-beginning 3) "\\\\") ; \00N -> \N.
("@\\&")) ; { -> @{.
t))))
(defun example-to-string (example)
(pcase-let* ((`(,actual ,err ,expected) example)
(err (eq err '!!>))
(case-fold-search nil))
(err (eq err '!!>)))
(and err (consp expected)
(setq expected (error-message-string expected)))
(with-output-to-string

Loading…
Cancel
Save