• Using use-package and local definitions

    From USEnet@jvromans@squirrel.nl to gnu.emacs.help on Sun May 22 21:49:23 2022
    From Newsgroup: gnu.emacs.help

    I'm upgrading my .emacs to use the modern `use-package` facility.

    I have this code:

    (autoload 'foo-mode "foo-mode")
    (add-to-list 'auto-mode-alist '("\\.foo'" . foo-mode))

    The file `foo-mode.el` is somewhere in my lisp load path.

    Now I want to use:

    (use-package foo-mode
    :mode "\\.foo")

    Problem: `use-package` wants to install `foo-mode` from melpa, where it
    does not reside.

    I tried adding `:ensure nil` but then there is no autoload set up.

    What is the correct `use-package` incantation for this situation?

    -- Johan

    --- Synchronet 3.21d-Linux NewsLink 1.2