diff options
author | Arun Isaac | 2020-03-13 20:56:05 +0530 |
---|---|---|
committer | Arun Isaac | 2020-03-13 20:56:05 +0530 |
commit | c3b27f55cf0556e1fd451eb20e879609a90721f1 (patch) | |
tree | 8cd16f1f2daa9ab822680cafe72831d51d2d691a | |
parent | d0c7b3114734765165be773945a14eec58faf352 (diff) | |
download | ennum-c3b27f55cf0556e1fd451eb20e879609a90721f1.tar.gz ennum-c3b27f55cf0556e1fd451eb20e879609a90721f1.tar.lz ennum-c3b27f55cf0556e1fd451eb20e879609a90721f1.zip |
Simplify picking of default settings.
* ennu.el (ennu-setting): Combine picking of all default settings into
one clause.
-rw-r--r-- | ennu.el | 42 |
1 files changed, 16 insertions, 26 deletions
@@ -270,38 +270,28 @@ last form in BODY." (defun ennu-setting (property) (pcase property - (:blog-scheme - (or (plist-get ennu-blog :blog-scheme) - "https")) - (:atom-feed-file - (or (plist-get ennu-blog :atom-feed-file) - "blog.atom")) - (:index-posts-per-page - (or (plist-get ennu-blog :index-posts-per-page) - 12)) - (:atom-feed-number-of-posts - (or (plist-get ennu-blog :atom-feed-number-of-posts) - 12)) - (:thumbnail-image-width - (or (plist-get ennu-blog :thumbnail-image-width) - 320)) - (:default-image-width - (or (plist-get ennu-blog :default-image-width) - 640)) - (:image-link-width - (or (plist-get ennu-blog :image-link-width) - 1024)) - (:tag-directory - (or (plist-get ennu-blog :tag-directory) - "tag")) ((or :blog-domain :blog-license :blog-title :images-directory :output-directory :posts-directory :static-directory :tag-directory :video-directory :working-directory) (or (plist-get ennu-blog property) (user-error "Property %s not defined" property))) - (:other-files-directory - (plist-get ennu-blog property)) + ((or :atom-feed-number-of-posts :atom-feed-file + :blog-scheme :default-image-width + :image-link-width :index-posts-per-page + :other-files-directory :tag-directory + :thumbnail-image-width) + (plist-get (org-combine-plists + (list :atom-feed-number-of-posts 12 + :atom-feed-file "blog.atom" + :blog-scheme "https" + :default-image-width 640 + :image-link-width 1024 + :index-posts-per-page 12 + :tag-directory "tag" + :thumbnail-image-width 320) + ennu-blog) + property)) (_ (error "Unknown property %s" property)))) (defun ennu-image-output-filename (image width) |