Function: pdf-info-close

pdf-info-close is a natively compiled function defined in pdf-info.el.

Signature

(pdf-info-close &optional FILE-OR-BUFFER)

Documentation

Close the document FILE-OR-BUFFER.

Returns t, if the document was actually open, otherwise nil. This command is rarely needed, see also pdf-info-open.

Source Code

;; Defined in /nix/store/63h5z2vmzn0mfavcxi2idi23g5xcgkbl-emacs-packages-deps/share/emacs/site-lisp/elpa/pdf-tools-20260102.1101/pdf-info.el
(defun pdf-info-close (&optional file-or-buffer)
  "Close the document FILE-OR-BUFFER.

Returns t, if the document was actually open, otherwise nil.
This command is rarely needed, see also `pdf-info-open'."
  (let* ((pdf (pdf-info--normalize-file-or-buffer file-or-buffer))
         (buffer (cond
                  ((not file-or-buffer) (current-buffer))
                  ((bufferp file-or-buffer) file-or-buffer)
                  ((stringp file-or-buffer)
                   (find-buffer-visiting file-or-buffer)))))
    (prog1
        (pdf-info-query 'close pdf)
      (if (buffer-live-p buffer)
          (with-current-buffer buffer
            (run-hooks 'pdf-info-close-document-hook))
        (with-temp-buffer
          (run-hooks 'pdf-info-close-document-hook))))))