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

Loading…
Cancel
Save