mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-17 10:27:41 +00:00
Simplify regexp in make-news-html-file
* admin/admin.el (make-news-html-file): Simplify regexp. Suggested by Mattias Engdegård <mattiase@acm.org>.
This commit is contained in:
parent
069ffbda09
commit
5dbe4fa64a
1 changed files with 11 additions and 24 deletions
|
|
@ -883,30 +883,17 @@ $Date: %s $
|
||||||
|
|
||||||
;; Use Org-mode markers for 'symbols', 'C-x k', etc.
|
;; Use Org-mode markers for 'symbols', 'C-x k', etc.
|
||||||
(replace-regexp-in-region
|
(replace-regexp-in-region
|
||||||
(rx-let ((key (seq
|
(rx (or (: (group (in " \t\n("))
|
||||||
;; Modifier (optional)
|
"'"
|
||||||
(? (any "ACHMSs") "-")
|
(group (+ (or (not (in "'\n"))
|
||||||
(or
|
(: "'" (not (in " .,\t\n)"))))))
|
||||||
;; single key
|
"'"
|
||||||
(not (any " \n"))
|
(group (in ",.;:!? \t\n)")))
|
||||||
;; "<return>" and "<remap> <foo>"
|
;; Buffer names, e.g. "*scratch*".
|
||||||
(seq "<"
|
(: "\""
|
||||||
(+ (any "A-Za-z-"))
|
(group-n 2 "*" (+ (not (in "*\""))) "*")
|
||||||
(+ (seq " " (+ (any "A-Za-z-"))))
|
"\"")))
|
||||||
">")
|
"\\1~\\2~\\3" (point-min) (point-max))
|
||||||
"NUL" "RET" "LFD" "TAB"
|
|
||||||
"ESC" "SPC" "DEL")))
|
|
||||||
(email (seq (+ (not (any " @\n")))
|
|
||||||
"@"
|
|
||||||
(+ (not (any " @\n")))))
|
|
||||||
(lisp-symbol (regexp lisp-mode-symbol-regexp)))
|
|
||||||
(rx "'" (group
|
|
||||||
(or lisp-symbol
|
|
||||||
email
|
|
||||||
(seq "M-x " lisp-symbol)
|
|
||||||
(seq key (+ " " key))))
|
|
||||||
"'"))
|
|
||||||
"~\\1~" (point-min) (point-max))
|
|
||||||
|
|
||||||
;; Format code blocks.
|
;; Format code blocks.
|
||||||
(while (re-search-forward "^ " nil t)
|
(while (re-search-forward "^ " nil t)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue