;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\303\304\305\306\307\310%\207" [require pdf-view pdf-util custom-declare-group pdf-history nil "A simple stack-based history." :group pdf-tools] 6) #@29 The stack of history items. (defvar pdf-history-stack nil (#$ . 273)) (make-variable-buffer-local 'pdf-history-stack) #@49 The current index into the `pdf-history-stack'. (defvar pdf-history-index nil (#$ . 397)) (make-variable-buffer-local 'pdf-history-index) #@42 Keymap used in `pdf-history-minor-mode'. (defvar pdf-history-minor-mode-map (byte-code "\300 \301\302\303#\210\301\304\305#\210\207" [make-sparse-keymap define-key "B" pdf-history-backward "N" pdf-history-forward] 5) (#$ . 541)) #@113 Non-nil if Pdf-History minor mode is enabled. Use the command `pdf-history-minor-mode' to change this variable. (defvar pdf-history-minor-mode nil (#$ . 779)) (make-variable-buffer-local 'pdf-history-minor-mode) #@811 Keep a history of previously visited pages. This is a minor mode. If called interactively, toggle the `Pdf-History minor mode' mode. If the prefix argument is positive, enable the mode, and if it is zero or negative, disable the mode. If called from Lisp, toggle the mode if ARG is `toggle'. Enable the mode if ARG is nil, omitted, or is a positive number. Disable the mode if ARG is a negative number. To check whether the minor mode is enabled in the current buffer, evaluate `pdf-history-minor-mode'. The mode's hook is called both when the mode is enabled and when it is disabled. This is a simple stack-based history. Turning the page or following a link pushes the left-behind page on the stack, which may be navigated with the following keys. \{pdf-history-minor-mode-map} (fn &optional ARG) (defalias 'pdf-history-minor-mode #[256 "\302 \303=\203 ?\202\247\203\304W\203\305\202\306\307\301!\2031\310\300 \"\2031\300 B\311 \210\312 \210\203H\313 \210\314\315\316\305\306$\210\202N\317\315\316\306#\210\320\321\203X\322\202Y\323\"\210\324\325!\203{\302 \203m\211\302 \232\203{\326\327\203w\330\202x\331\332#\210\210\333 \210\207" [pdf-history-minor-mode local-minor-modes current-message toggle 1 nil t boundp delq pdf-util-assert-pdf-buffer pdf-history-clear pdf-history-push add-hook pdf-view-after-change-page-hook pdf-history-before-change-page-hook remove-hook run-hooks pdf-history-minor-mode-hook pdf-history-minor-mode-on-hook pdf-history-minor-mode-off-hook called-interactively-p any message "Pdf-History minor mode %sabled%s" "en" "dis" " in current buffer" force-mode-line-update] 7 (#$ . 998) (byte-code "\203\n\301!\202 \302C\207" [current-prefix-arg prefix-numeric-value toggle] 2)]) (defvar pdf-history-minor-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\303\301\305\306#\210\303\301\307\310C#\210\311\312\310\313\300!\205#\310\211%\207" [pdf-history-minor-mode-map pdf-history-minor-mode-hook variable-documentation put "Hook run after entering or leaving `pdf-history-minor-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" custom-type hook standard-value nil add-minor-mode pdf-history-minor-mode boundp] 6) #@48 Push a history item, before leaving this page. (defalias 'pdf-history-before-change-page-hook #[0 "\205\302\301!\205 ?\205\303\304\305\"\205\306 \207" [pdf-history-minor-mode pdf-isearch-active-mode boundp image-mode-window-get page nil pdf-history-push] 3 (#$ . 3290)]) #@125 Push the current page on the stack. This function does nothing, if current stack item already represents the current page. (defalias 'pdf-history-push #[0 "\302 \205 8\232?\205\303\211G Z\"\304\211B\211\207" [pdf-history-stack pdf-history-index pdf-history-create-item last 0] 5 (#$ . 3577) nil]) #@27 Remove all history items. (defalias 'pdf-history-clear #[0 "\302\303\304 \207" [pdf-history-stack pdf-history-index nil 0 pdf-history-push] 1 (#$ . 3893) nil]) #@54 Create a history item representing the current page. (defalias 'pdf-history-create-item #[0 "\300\301\302\"C\207" [image-mode-window-get page nil] 3 (#$ . 4061)]) #@47 Return t, if at the beginning of the history. (defalias 'pdf-history-beginning-of-history-p #[0 "\301U\207" [pdf-history-index 0] 2 (#$ . 4230)]) #@41 Return t, if at the end of the history. (defalias 'pdf-history-end-of-history-p #[0 " GSU\207" [pdf-history-index pdf-history-stack] 2 (#$ . 4383)]) #@45 Go N-times backward in the history. (fn N) (defalias 'pdf-history-backward #[257 "\211\302V\203\303 \203\304\305!\207\211\302W\203\306 \203\304\307!\207\211\302U\2047\302\\] GS^\\Z\310!\210\207\302\207" [pdf-history-index pdf-history-stack 0 pdf-history-end-of-history-p error "End of history" pdf-history-beginning-of-history-p "Beginning of history" pdf-history-goto] 5 (#$ . 4539) "p"]) #@44 Go N-times forward in the history. (fn N) (defalias 'pdf-history-forward #[257 "\300[!\207" [pdf-history-backward] 3 (#$ . 4951) "p"]) #@38 Go to item N in the history. (fn N) (defalias 'pdf-history-goto #[257 "\204\302\303!\210\211GY\203\302\304!\207\211\305W\203\302\306!\207\211\3078@!\207" [pdf-history-stack pdf-history-index error "The history is empty" "End of history" 0 "Beginning of history" pdf-view-goto-page] 4 (#$ . 5094) "p"]) #@43 Visualize the history in the header-line. (defalias 'pdf-history-debug #[0 "\301\211\207" [header-line-format (:eval (let ((pages (mapcar 'car pdf-history-stack)) (index pdf-history-index) header) (dotimes (i (length pages)) (push (propertize (format "%s" (nth i pages)) 'face (and (= i index) 'match)) header)) (concat "(" (format "%d" index) ") " (mapconcat 'identity (nreverse header) " | "))))] 2 (#$ . 5414) nil]) (provide 'pdf-history)