Skip to content

Fix :type of devdocs-browser-major-mode-docs-alist #11

Description

@krisbalintona

devdocs-browser-major-mode-docs-alist uses function as the :key-type for the alist. However, if a mode in that alist is not loaded when setopt is called to set the option, it will warn the user that the value of the option does not match its type. This is because functionp` only returns non-nil when that major mode is loaded.

You'll see this error, for instance, in a fresh emacs -q: load devdocs-browser.el, then call setopt on the default value of devdocs-browser-major-mode-docs-alist:

(setopt devdocs-browser-major-mode-docs-alist
        '((c++-mode . ("cpp"))
          (c-mode . ("c"))
          (go-mode . ("go"))
          (python-mode . ("Python"))
          (emacs-lisp-mode . ("elisp"))
          (rust-mode . ("rust"))
          (cmake-mode . ("CMake"))))

You'll see the warning.

Instead, I think symbol is more appropriate as the :key-type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions