[SOLUTION] See PDF page numbers in mood-line #16

Open
opened 2025-01-08 04:51:52 +00:00 by g-gundam · 0 comments

This isn't a bug, but I'm posting this here in case anyone wants to see what page number they're on when reading a PDF.

(defun mood-line-segment-scroll-pdf ()
  "This is a drop in replacement for mood-line-segment-scroll that displays the
current page number of the PDF when in pdf-view-mode and falls back to
mood-line-segment-scroll when in any other mode."
  (if (equal major-mode 'pdf-view-mode)
      (format "  P%d/%d "
              (or (eval `(pdf-view-current-page)) 0)
              (pdf-cache-number-of-pages))
    (mood-line-segment-scroll)))

It's based on code from https://www.reddit.com/r/emacs/comments/1f1chxt/comment/lk066yb/ .

This isn't a bug, but I'm posting this here in case anyone wants to see what page number they're on when reading a PDF. ```lisp (defun mood-line-segment-scroll-pdf () "This is a drop in replacement for mood-line-segment-scroll that displays the current page number of the PDF when in pdf-view-mode and falls back to mood-line-segment-scroll when in any other mode." (if (equal major-mode 'pdf-view-mode) (format " P%d/%d " (or (eval `(pdf-view-current-page)) 0) (pdf-cache-number-of-pages)) (mood-line-segment-scroll))) ``` It's based on code from https://www.reddit.com/r/emacs/comments/1f1chxt/comment/lk066yb/ .
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: jessieh/mood-line#16
No description provided.