update packages
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
;;; pdf-misc.el --- Miscellaneous commands for PDF buffer.
|
||||
;;; pdf-misc.el --- Miscellaneous commands for PDF buffer. -*- lexical-binding: t; -*-
|
||||
|
||||
;; Copyright (C) 2013, 2014 Andreas Politz
|
||||
|
||||
@@ -38,12 +38,12 @@
|
||||
;;;###autoload
|
||||
(define-minor-mode pdf-misc-minor-mode
|
||||
"FIXME: Not documented."
|
||||
nil nil nil)
|
||||
:group 'pdf-misc)
|
||||
|
||||
;;;###autoload
|
||||
(define-minor-mode pdf-misc-size-indication-minor-mode
|
||||
"Provide a working size indication in the mode-line."
|
||||
nil nil nil
|
||||
:group 'pdf-misc
|
||||
(pdf-util-assert-pdf-buffer)
|
||||
(cond
|
||||
(pdf-misc-size-indication-minor-mode
|
||||
@@ -171,7 +171,7 @@
|
||||
;;;###autoload
|
||||
(define-minor-mode pdf-misc-menu-bar-minor-mode
|
||||
"Display a PDF Tools menu in the menu-bar."
|
||||
nil nil nil
|
||||
:group 'pdf-misc
|
||||
(pdf-util-assert-pdf-buffer))
|
||||
|
||||
(defvar pdf-misc-context-menu-minor-mode-map
|
||||
@@ -184,16 +184,18 @@
|
||||
"Provide a right-click context menu in PDF buffers.
|
||||
|
||||
\\{pdf-misc-context-menu-minor-mode-map}"
|
||||
nil nil nil
|
||||
:group 'pdf-misc
|
||||
(pdf-util-assert-pdf-buffer))
|
||||
|
||||
(defun pdf-misc-popup-context-menu (event)
|
||||
"Popup a context menu at position determined by EVENT."
|
||||
(defun pdf-misc-popup-context-menu ()
|
||||
"Popup a context menu at position."
|
||||
(interactive "@e")
|
||||
(popup-menu
|
||||
(cons 'keymap
|
||||
(cddr (lookup-key pdf-misc-menu-bar-minor-mode-map
|
||||
[menu-bar PDF\ Tools])))))
|
||||
(cddr (or (lookup-key pdf-misc-menu-bar-minor-mode-map
|
||||
[menu-bar PDF\ Tools])
|
||||
(lookup-key pdf-misc-menu-bar-minor-mode-map
|
||||
[menu-bar pdf\ tools]))))))
|
||||
|
||||
(defun pdf-misc-display-metadata ()
|
||||
"Display all available metadata in a separate buffer."
|
||||
@@ -206,8 +208,7 @@
|
||||
(pad (apply' max (mapcar (lambda (d)
|
||||
(length (symbol-name (car d))))
|
||||
md)))
|
||||
(fmt (format "%%%ds:%%s\n" pad))
|
||||
window)
|
||||
(fmt (format "%%%ds:%%s\n" pad)))
|
||||
(erase-buffer)
|
||||
(setq header-line-format (buffer-name buffer)
|
||||
buffer-read-only t)
|
||||
@@ -235,8 +236,8 @@
|
||||
:group 'pdf-tools)
|
||||
|
||||
(define-obsolete-variable-alias 'pdf-misc-print-programm
|
||||
'pdf-misc-print-program "1.0")
|
||||
(defcustom pdf-misc-print-programm nil
|
||||
'pdf-misc-print-program-executable "1.0")
|
||||
(defcustom pdf-misc-print-program-executable nil
|
||||
"The program used for printing.
|
||||
|
||||
It is called with one argument, the PDF file."
|
||||
@@ -245,14 +246,20 @@ It is called with one argument, the PDF file."
|
||||
|
||||
(define-obsolete-variable-alias 'pdf-misc-print-programm-args
|
||||
'pdf-misc-print-program-args "1.0")
|
||||
(defcustom pdf-misc-print-programm-args nil
|
||||
(defcustom pdf-misc-print-program-args nil
|
||||
"List of additional arguments passed to `pdf-misc-print-program'."
|
||||
:group 'pdf-misc
|
||||
:type '(repeat string))
|
||||
|
||||
(defun pdf-misc-print-programm (&optional interactive-p)
|
||||
(or (and pdf-misc-print-programm
|
||||
(executable-find pdf-misc-print-programm))
|
||||
(define-obsolete-function-alias 'pdf-misc-print-programm
|
||||
'pdf-misc-print-program "1.0")
|
||||
(defun pdf-misc-print-program (&optional interactive-p)
|
||||
"Return the program used to print PDFs (if the executable is installed).
|
||||
|
||||
If INTERACTIVE-P is non-nil, ask the user for which program to
|
||||
use when printing the PDF. Optionally, save the choice"
|
||||
(or (and pdf-misc-print-program-executable
|
||||
(executable-find pdf-misc-print-program-executable))
|
||||
(when interactive-p
|
||||
(let* ((default (car (delq nil (mapcar
|
||||
'executable-find
|
||||
@@ -264,17 +271,17 @@ It is called with one argument, the PDF file."
|
||||
"Print with: " default nil t nil 'file-executable-p))))
|
||||
(when (and program
|
||||
(executable-find program))
|
||||
(when (y-or-n-p "Save choice using customize ?")
|
||||
(when (y-or-n-p "Save choice using customize? ")
|
||||
(customize-save-variable
|
||||
'pdf-misc-print-program program))
|
||||
(setq pdf-misc-print-program program))))))
|
||||
'pdf-misc-print-program-executable program))
|
||||
(setq pdf-misc-print-program-executable program))))))
|
||||
|
||||
(defun pdf-misc-print-document (filename &optional interactive-p)
|
||||
(interactive
|
||||
(list (pdf-view-buffer-file-name) t))
|
||||
(cl-check-type filename (and string file-readable))
|
||||
(cl-check-type filename (and string (satisfies file-readable-p)))
|
||||
(let ((program (pdf-misc-print-program interactive-p))
|
||||
(args (append pdf-misc-print-programm-args (list filename))))
|
||||
(args (append pdf-misc-print-program-args (list filename))))
|
||||
(unless program
|
||||
(error "No print program available"))
|
||||
(apply #'start-process "printing" nil program args)
|
||||
|
||||
Reference in New Issue
Block a user