[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dash a6b16ea 286/316: Localize 'nil -> '() replacement
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dash a6b16ea 286/316: Localize 'nil -> '() replacement in Texinfo |
Date: |
Mon, 15 Feb 2021 15:58:18 -0500 (EST) |
branch: externals/dash
commit a6b16ea5bf244ebfde2014b6bdeefb1207a33d52
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>
Localize 'nil -> '() replacement in Texinfo
* dev/examples-to-info.el (create-info-file): Move 'nil -> '()
replacement from here...
(dash--print-lisp-as-texi): ...to here.
(example-to-string): Disable case folding to be on the safe side.
(dash--replace-all): Remove regexp argument; no longer used.
---
dev/examples-to-info.el | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/dev/examples-to-info.el b/dev/examples-to-info.el
index b896e13..ecb1f62 100644
--- a/dev/examples-to-info.el
+++ b/dev/examples-to-info.el
@@ -33,6 +33,7 @@
(save-excursion (prin1 obj))
(while (re-search-forward (rx (| (group "\\?")
(group (in "{}"))
+ (group ?\' symbol-start "nil" symbol-end)
(not (in ?\n print))))
nil 'move)
(cond ((match-beginning 1)
@@ -43,13 +44,16 @@
(backward-char)
(insert ?@)
(forward-char))
+ ;; Don't let '() be printed as 'nil.
+ ((match-beginning 3) (replace-match "'()" t t))
+ ;; Translate unprintable characters such as ?\^A.
((let ((desc (text-char-description (preceding-char))))
- ;; Translate unprintable characters such as ?\^A.
(replace-match (concat "\\" desc) t t))))))
(defun example-to-string (example)
(pcase-let* ((`(,actual ,err ,expected) example)
- (err (eq err '!!>)))
+ (err (eq err '!!>))
+ (case-fold-search nil))
(and err (consp expected)
(setq expected (error-message-string expected)))
(with-output-to-string
@@ -135,12 +139,10 @@ Based on `describe-function-1'."
(concat "\n@node " function "\n@section " function))
(_ (concat "\n" function))))
-(defun dash--replace-all (old new &optional regexp)
- "Replace occurrences of OLD with NEW in current buffer.
-If REGEXP is non-nil, interpret OLD as a regexp."
- (or regexp (setq old (regexp-quote old)))
+(defun dash--replace-all (old new)
+ "Replace occurrences of OLD with NEW in current buffer."
(goto-char (point-min))
- (while (re-search-forward old nil t)
+ (while (search-forward old nil t)
(replace-match new t t)))
(defun create-info-file ()
@@ -162,8 +164,6 @@ If REGEXP is non-nil, interpret OLD as a regexp."
"\n"))
(dash--replace-all "@c [[ function-docs ]]"
- (mapconcat #'function-to-info functions "\n"))
-
- (dash--replace-all (rx (or "'nil" "(quote nil)")) "'()" t))))
+ (mapconcat #'function-to-info functions "\n")))))
;;; examples-to-info.el ends here
- [elpa] externals/dash 525ede2 265/316: Improve docstring Markdown formatting, (continued)
- [elpa] externals/dash 525ede2 265/316: Improve docstring Markdown formatting, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 4a32a5d 257/316: Write -remove-last in terms of --remove-last, ELPA Syncer, 2021/02/15
- [elpa] externals/dash cbd3b29 268/316: * .elpaignore: Exclude dev/ from GNU ELPA tarball., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 2a10547 271/316: Fix handling nils of -some-->, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 0789fd0 273/316: Fix -some--> docstring and Edebug spec, ELPA Syncer, 2021/02/15
- [elpa] externals/dash e0254c5 274/316: * dash.el (-doto): Fix Edebug spec., ELPA Syncer, 2021/02/15
- [elpa] externals/dash 46e43c0 277/316: Fix long-standing typo in Texinfo generation, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 65eeaf6 278/316: Fix long-standing typo in examples, ELPA Syncer, 2021/02/15
- [elpa] externals/dash dbbf617 281/316: Remove dead code from examples-to-info.el, ELPA Syncer, 2021/02/15
- [elpa] externals/dash ee9bceb 284/316: Leave Texinfo docstring indentation as is, ELPA Syncer, 2021/02/15
- [elpa] externals/dash a6b16ea 286/316: Localize 'nil -> '() replacement in Texinfo,
ELPA Syncer <=
- [elpa] externals/dash 56db327 287/316: Fix printing in Emacs < 27, ELPA Syncer, 2021/02/15
- [elpa] externals/dash d76505d 289/316: Use dash--replace-all in Texinfo format-docstring, ELPA Syncer, 2021/02/15
- [elpa] externals/dash c38b06f 291/316: Port some recent manual changes to README, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 47114ca 290/316: Make manual generation more consistent with README, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 3fa27c4 295/316: Make README's def-example-group more like manual's, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 4043f4e 305/316: Consolidate duplicated change logs in new NEWS.md, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 51d81a5 308/316: Avoid using dash.el functions in macro bodies, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 41b5681 310/316: Merge pull request #369 from blc/gut, ELPA Syncer, 2021/02/15
- [elpa] externals/dash cec8c0d 311/316: Rename approx-equal to more accurate approx=, ELPA Syncer, 2021/02/15
- [elpa] externals/dash 4d40317 313/316: Update list of contributors, ELPA Syncer, 2021/02/15