From 3b92ec31f83a4d210d8031cec37015bbdea68978 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 27 Jul 2023 01:10:10 -0700 Subject: [PATCH] =?UTF-8?q?Add=20dependency=20on=20=E2=80=98dash=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Emacs 28.2 doesn't yet have the ‘take’ function. That's a 29.1 thing. The ‘dash’ library has the same function though. --- literate-build.org | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/literate-build.org b/literate-build.org index 69967af..915fe0a 100644 --- a/literate-build.org +++ b/literate-build.org @@ -358,6 +358,8 @@ PROPS is used as an aid in getting the right information from the file." Finally the last function mushes it all together and actually generates an =index.org= file. I just looks through the =posts/= directory and finds any files that start with a date. It compares the last modification time of the =index.org= and that of the latest modified post, and skips generating if the =index.org= is newer. Then it takes the 30 latest posts and extracts the necessary information from them and writes it all into =index.org=. #+begin_src emacs-lisp +(require 'dash) + (defun publish-generate-index (props) "Generate an index from my posts. Argument PROPS @@ -380,7 +382,7 @@ Argument PROPS (insert "\n") (apply 'insert (mapcar (lambda (file) (publish-extract-summary-from-file file props)) - (take 30 (reverse files)))) + (-take 30 (reverse files)))) (write-file "posts/index.org")))))) #+end_src