Files
memex/projects/dotemacs/modules/emacs-media.org
Amr Gharbeia cc6c552d5a refactor: Move Emacs config from system/ to projects/dotemacs/
- Delete deprecated system/ configuration files
- Update projects/dotemacs/modules/ with reorganized config
- Add .opencode/ directory for agent state
- Clean up attachments and unused documentation files
2026-04-25 18:41:20 -04:00

3.3 KiB

Media and Books Configuration

Read ebooks (calibredb)

  (use-package calibredb
    :defer t
    :config
    (setq calibredb-format-all-the-icons t)
    (setq calibredb-format-icons-in-terminal t))
  (defvar calibredb-root-dir (expand-file-name "~/memex/library/books"))
  (defvar calibredb-db-dir (expand-file-name "metadata.db" calibredb-root-dir))
  (defvar calibredb-id-width 6)
  (defvar calibredb-title-width 100)

PDF Tools

  (use-package pdf-tools
    :mode ("\\.pdf\\'" . pdf-view-mode)
    :config
    (pdf-tools-install :no-query)
    (setq-default pdf-view-display-size 'fit-page)
    (setq pdf-annot-activate-created-annotations t))

Annotate PDFs and EPUBs (org-noter)

  (use-package org-noter
    :config
    (setq org-noter-notes-search-path (list (expand-file-name "~/memex/library/books")))
    (setq org-noter-default-notes-file-names '("books.org")))
  (setq org-noter-notes-search-path (list (concat org-directory "/library/books")))
  (setq org-noter-default-notes-file-names '("books.org"))

Link PDFs (org-noter-pdftools)

  (use-package org-noter-pdftools
    :after org-noter
    :config
    ;; Add a function to ensure precise note is inserted
    (defun org-noter-pdftools-insert-precise-note (&optional toggle-no-questions)
      (interactive "P")
      (org-noter--with-valid-session
       (let ((org-noter-insert-note-no-questions (if toggle-no-questions
  						   (not org-noter-insert-note-no-questions)
                                                   org-noter-insert-note-no-questions))
             (org-pdftools-use-isearch-link t)
             (org-pdftools-use-freepointer-annot t))
         (org-noter-insert-note (org-noter--get-precise-info)))))

    ;; fix https://github.com/weirdNox/org-noter/pull/93/commits/f8349ae7575e599f375de1be6be2d0d5de4e6cbf
    (defun org-noter-set-start-location (&optional arg)
      "When opening a session with this document, go to the current location.
  With a prefix ARG, remove start location."
      (interactive "P")
      (org-noter--with-valid-session
       (let ((inhibit-read-only t)
             (ast (org-noter--parse-root))
             (location (org-noter--doc-approx-location (when (called-interactively-p 'any) 'interactive))))
         (with-current-buffer (org-noter--session-notes-buffer session)
           (org-with-wide-buffer
            (goto-char (org-element-property :begin ast))
            (if arg
                (org-entry-delete nil org-noter-property-note-location)
              (org-entry-put nil org-noter-property-note-location
                             (org-noter--pretty-print-location location))))))))
    (with-eval-after-load 'pdf-annot
      (add-hook 'pdf-annot-activate-handler-functions #'org-noter-pdftools-jump-to-note)
      )
    )

View EPUBs (nov.el)

  (use-package nov
    :config
    (add-to-list 'auto-mode-alist '("\\.epub\\'" . nov-mode))
    )

Zotero (helm-bibtex)

  (use-package helm-bibtex)
  (setq bibtex-completion-bibliography '("~/bibliography/zotero.bib"))