Skip to content

Commit

Permalink
Fix defcustom :type arguments
Browse files Browse the repository at this point in the history
These variables' default values should match the :type given in their
definitions, or else M-x customize will display a warning or may even
fail to initialize properly.
  • Loading branch information
bcc32 authored and vedang committed Apr 11, 2024
1 parent a1048bc commit 94e9f20
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 4 additions & 2 deletions lisp/pdf-tools.el
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,13 @@ PDF buffers."
(defcustom pdf-tools-installer-os nil
"Specifies which installer to use.
If nil the installer is chosen automatically. This variable is
If nil, the installer is chosen automatically. This variable is
useful if you have multiple installers present on your
system (e.g. nix on arch linux)"
:group 'pdf-tools
:type 'string)
:type '(choice
(const :tag "Choose automatically" nil)
string))

(defun pdf-tools-identify-build-directory (directory)
"Return non-nil, if DIRECTORY appears to contain the epdfinfo source.
Expand Down
12 changes: 7 additions & 5 deletions lisp/pdf-util.el
Original file line number Diff line number Diff line change
Expand Up @@ -907,21 +907,23 @@ frame's PPI is larger than 180. Otherwise, return 1."
(executable-find "convert"))
"Absolute path to the convert program."
:group 'pdf-tools
:type 'executable)
:type '(choice (const :tag "Unset" nil) file))

(defcustom pdf-util-fast-image-format nil
"An image format appropriate for fast displaying.
This should be a cons \(TYPE . EXT\) where type is the Emacs
image-type and EXT the appropriate file extension starting with a
dot. If nil, the value is determined automatically.
This should be a cons (TYPE . EXT) where type is the Emacs
`image-type' and EXT the appropriate file extension starting with
a dot. If nil, the value is determined automatically.
Different formats have different properties, with respect to
Emacs loading time, convert creation time and the file-size. In
general, uncompressed formats are faster, but may need a fair
amount of (temporary) disk space."
:group 'pdf-tools
:type '(cons symbol string))
:type '(choice
(const :tag "Determine automatically" nil)
(cons symbol string)))

(defun pdf-util-assert-convert-program ()
(unless (and pdf-util-convert-program
Expand Down

0 comments on commit 94e9f20

Please sign in to comment.