From cf0b0983b4e97abd5cfd56119a233cc38ac308ac Mon Sep 17 00:00:00 2001 From: j4nk Date: Thu, 23 Jan 2025 21:21:02 -0500 Subject: [PATCH] Fixed unknown type 'listp errors --- blog/feed.xml | 2 +- md4tj.el | 20 ++++++++++---------- test_file.html | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/blog/feed.xml b/blog/feed.xml index a8feadd..e612c8c 100644 --- a/blog/feed.xml +++ b/blog/feed.xml @@ -1,4 +1,4 @@ -RSS Testhttp://example.comAn example blog for testing RSS capability of md4tj.en-USTue, 10 Jun 2003 04:00:00 GMTeditor@example.comwebmaster@example.comhttps://www.rssboard.org/rss-specificationmd4tj-rss.elSat, 30 Mar 2024 21:59:21 GMTBlog Post 2https://example.com/blog/blogpost2.htmlhttps://example.com/blog/blogpost2.html +RSS Testhttp://example.comAn example blog for testing RSS capability of md4tj.en-USTue, 10 Jun 2003 04:00:00 GMTeditor@example.comwebmaster@example.comhttps://www.rssboard.org/rss-specificationmd4tj-rss.elThu, 23 Jan 2025 21:20:24 GMTBlog Post 2https://example.com/blog/blogpost2.htmlhttps://example.com/blog/blogpost2.html <br> diff --git a/md4tj.el b/md4tj.el index 0ebcb92..28b4967 100644 --- a/md4tj.el +++ b/md4tj.el @@ -37,7 +37,7 @@ (defun md4tj-util-zip (ls) "Turn list of lists LS into list of tuples." - (cl-labels ((zip-help (ll) (if (not (car ll)) nil (cons (cl-map 'listp #'car ll) (zip-help (cl-map 'listp 'cdr ll)))))) + (cl-labels ((zip-help (ll) (if (not (car ll)) nil (cons (cl-map 'list #'car ll) (zip-help (cl-map 'list 'cdr ll)))))) (zip-help ls))) ;; End basic utilities @@ -45,7 +45,7 @@ (defun md4tj-begin-tag (tag &optional attrs) "Return beginning html tag for TAG with optional ATTRS." (concat "<" tag - (mapconcat 'identity (cl-map 'listp (lambda (l) (concat " " (nth 0 l) "=" "\"" (nth 1 l) "\"")) attrs) "") + (mapconcat 'identity (cl-map 'list (lambda (l) (concat " " (nth 0 l) "=" "\"" (nth 1 l) "\"")) attrs) "") ">")) (defun md4tj-end-tag (tag) @@ -319,15 +319,15 @@ ;; (defun md4tj-blog-names () ;; "Find all blogs on blog page." -;; (cl-map #'listp (lambda (l) (nth 1 l)) (cl-map #'listp 'split-string (cl-remove-if-not (lambda (s) (string-match "^@@BLOGPOST" s)) (split-string (buffer-string) "\n"))))) +;; (cl-map 'list (lambda (l) (nth 1 l)) (cl-map 'list 'split-string (cl-remove-if-not (lambda (s) (string-match "^@@BLOGPOST" s)) (split-string (buffer-string) "\n"))))) (defun md4tj-blog-names () "Get all blogs names from buffer." - (cl-map 'listp (lambda (s) (string-replace (md4tj-blog-base-dir) "" s)) (cl-map 'listp (lambda (s) (replace-regexp-in-string "\\.md4tj$" "" s)) (md4tj-blog-files)))) + (cl-map 'list (lambda (s) (string-replace (md4tj-blog-base-dir) "" s)) (cl-map 'list (lambda (s) (replace-regexp-in-string "\\.md4tj$" "" s)) (md4tj-blog-files)))) (defun md4tj-blog-links () "Get all links on the blog page." (let ((base-url (md4tj-blog-base-url))) - (cl-map #'listp (lambda (s) (concat base-url s ".html")) (md4tj-blog-names)))) + (cl-map 'list (lambda (s) (concat base-url s ".html")) (md4tj-blog-names)))) (defun md4tj-blog-file (name) "Get full filename from NAME." @@ -335,8 +335,8 @@ (defun md4tj-blog-files () "Get all blog .md4tj files." - (cl-map 'listp (lambda (s) (concat (md4tj-blog-base-dir) s)) (cl-remove-if-not (lambda (s) (string-match ".*\\.md4tj$" s)) (directory-files (md4tj-blog-base-dir))))) - ;(cl-map #'listp 'md4tj-blog-file (md4tj-blog-names))) + (cl-map 'list (lambda (s) (concat (md4tj-blog-base-dir) s)) (cl-remove-if-not (lambda (s) (string-match ".*\\.md4tj$" s)) (directory-files (md4tj-blog-base-dir))))) + ;(cl-map 'list 'md4tj-blog-file (md4tj-blog-names))) (defun md4tj-blog-title (f) "Get blog title from file F." @@ -349,7 +349,7 @@ (defun md4tj-blog-titles () "Get all blog titles in current file." - (cl-map #'listp 'md4tj-blog-title (md4tj-blog-files))) + (cl-map 'list 'md4tj-blog-title (md4tj-blog-files))) (defun md4tj-blog-time (f) "Get blog time (unix time) from file F." @@ -362,7 +362,7 @@ (defun md4tj-blog-times () "Get all blog times in current file." - (cl-map #'listp 'md4tj-blog-time (md4tj-blog-files))) + (cl-map 'list 'md4tj-blog-time (md4tj-blog-files))) ;; triple of @@ -427,7 +427,7 @@ (defun md4tj-rss-get-channel-statements () "Get all channel statements from current buffer." - (cl-remove-if-not #'md4tj-rss-is-valid-channel-statement (cl-map 'listp (lambda (toks) (cons (string-replace "@@RSSCHANNEL" "" (car toks)) (cdr toks))) (cl-map 'listp #'split-string (cl-remove-if-not (lambda (line) (string-match "^@@RSSCHANNEL.*" line)) (split-string (buffer-string) "\n")))))) + (cl-remove-if-not #'md4tj-rss-is-valid-channel-statement (cl-map 'list (lambda (toks) (cons (string-replace "@@RSSCHANNEL" "" (car toks)) (cdr toks))) (cl-map 'list #'split-string (cl-remove-if-not (lambda (line) (string-match "^@@RSSCHANNEL.*" line)) (split-string (buffer-string) "\n")))))) (defun md4tj-rss-channel-statement-toks-to-rss (toks) "Generate RSS syntax for RSS channel statement tokenized to TOKS." diff --git a/test_file.html b/test_file.html index 3032f70..4787da3 100644 --- a/test_file.html +++ b/test_file.html @@ -77,7 +77,7 @@ int main() {

This is a div that has monospace text.

-

Last updated: Sun 31 Mar 2024 01:59 UTC

+

Last updated: Fri 24 Jan 2025 02:20 UTC