aboutsummaryrefslogtreecommitdiff
path: root/emacs/.emacs.d/lisp
diff options
context:
space:
mode:
authorYuchen Pei <id@ypei.org>2025-02-02 15:46:32 +1100
committerYuchen Pei <id@ypei.org>2025-02-02 15:46:32 +1100
commita747aa540809b018f5e87a812a4d88b0b2e2da8f (patch)
tree2fd7aa03def15da2ea7b44c0520b94a1be2a6c8f /emacs/.emacs.d/lisp
parent618fe180a68331ddf58b2a9679f2f6a088d9fecd (diff)
[emacs] Fix nov margin/fringe widths
And do not show temp files in belf
Diffstat (limited to 'emacs/.emacs.d/lisp')
-rw-r--r--emacs/.emacs.d/lisp/my/belf.el8
-rw-r--r--emacs/.emacs.d/lisp/my/my-nov.el12
2 files changed, 14 insertions, 6 deletions
diff --git a/emacs/.emacs.d/lisp/my/belf.el b/emacs/.emacs.d/lisp/my/belf.el
index d9392c9..84cf184 100644
--- a/emacs/.emacs.d/lisp/my/belf.el
+++ b/emacs/.emacs.d/lisp/my/belf.el
@@ -51,12 +51,12 @@
(let ((buf (get-buffer-create "*Bookshelf*")))
(with-current-buffer buf
(belf-mode)
- (belf-list-refresh-contents)
- (tabulated-list-print))
+ (belf-list-refresh-contents))
(pop-to-buffer-same-window buf)))
(defun belf-list-refresh-contents (&rest _)
- (setq-local tabulated-list-entries (belf-parse-all-file-names)))
+ (setq-local tabulated-list-entries (belf-parse-all-file-names))
+ (tabulated-list-print))
(defvar belf-dir "~/Documents" "Directory of books.")
@@ -68,7 +68,7 @@
(when-let ((parsed (belf-parse-file-name f)))
(let-alist parsed
(list f (vector .authors .title .year)))))
- (directory-files belf-dir t))))
+ (directory-files belf-dir t "[^#]$"))))
(defun belf-parse-file-name (file-name)
(let ((base (file-name-base file-name)))
diff --git a/emacs/.emacs.d/lisp/my/my-nov.el b/emacs/.emacs.d/lisp/my/my-nov.el
index 1bc8eca..816afc6 100644
--- a/emacs/.emacs.d/lisp/my/my-nov.el
+++ b/emacs/.emacs.d/lisp/my/my-nov.el
@@ -65,8 +65,16 @@ chapter title."
nov-file-name dest staging)))
(defun my-nov-set-margins ()
- (set-window-margins nil 3 2)
- (set-window-fringes nil 0 0))
+ ;; Does not work as well as setq left- and right-margin-width
+ ;; (set-window-margins nil 3 2)
+ (setq left-margin-width 3)
+ (setq right-margin-width 2)
+ ;; Does not work as well as setq left- and right-fringe-width
+ ;; (set-window-fringes nil 0 0)
+ (setq left-fringe-width 0)
+ (setq right-fringe-width 0)
+ (visual-line-mode)
+ )
(provide 'my-nov)
;;; my-nov.el ends here