diff options
author | Stefan Kangas <stefan@marxist.se> | 2021-09-26 14:13:03 +0200 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2021-09-26 14:55:19 +0200 |
commit | a0d5de4fb9de82dfda741c5cf39d87cee955cc46 (patch) | |
tree | 7b102a9c6a377284dd3b26eddbcfdcf2593706a1 /lisp/emacs-lisp | |
parent | 6e1de14e51f692684ccaffb7113ca0e6c135ba41 (diff) | |
download | emacs-a0d5de4fb9de82dfda741c5cf39d87cee955cc46.tar.gz emacs-a0d5de4fb9de82dfda741c5cf39d87cee955cc46.tar.bz2 emacs-a0d5de4fb9de82dfda741c5cf39d87cee955cc46.zip |
Add test for lm-website
* lisp/emacs-lisp/lisp-mnt.el (lm-website): Use rx.
* test/lisp/emacs-lisp/lisp-mnt-tests.el
(lm--tests-lm-website): New test.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/lisp-mnt.el | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/emacs-lisp/lisp-mnt.el b/lisp/emacs-lisp/lisp-mnt.el index b27c7e78a88..96ac054a7d7 100644 --- a/lisp/emacs-lisp/lisp-mnt.el +++ b/lisp/emacs-lisp/lisp-mnt.el @@ -501,9 +501,9 @@ absent, return nil." (defun lm-website (&optional file) "Return the website in file FILE, or current buffer if FILE is nil." (let ((page (lm-with-file file - (lm-header "\\(?:x-\\)?\\(?:url\\|homepage\\)")))) - (if (and page (string-match "^<.+>$" page)) - (substring page 1 -1) + (lm-header (rx (? "x-") (or "url" "homepage")))))) + (if (and page (string-match (rx bol "<" (+ nonl) ">" eol) page)) + (substring page 1 -1) page))) (defalias 'lm-homepage 'lm-website) ; for backwards-compatibility |