1

How to configure packages, which have no (provide <PACKAGENAME>) call in their source code?

Immediate problem: configure isearch with use-package.
(Editing isearch.el is not an option because it may break updates and may trigger heavy bug hunting)

Edit: answering Drews comment: use-package can be used to cluster elisp code, which should belong to a package/library. The user is then able to write functions or set up keybindings, which are part of a users emacs configuration. Whith this technique it is possible to lazy load self written functions, or even redefine functions from a package after the package/library has been loaded. (Of course there are also other ways to do that but use-package is a nice Domain Specific Language for that kind of configuration).
By "configure" I mean writing a valid use-package sexp which serves the purpose of changing emacs default behavior.
Yes, with "Editing" I meant changing the source code file isearch.el. Emacs is hackable after all.

  • 1
    Strange, if I M-x find-library RET isearch RET and jump to the end of the file, I immediately find (provide 'isearch) there. – wasamasa Oct 7 at 17:30
  • The question is unclear. What do you mean by "configure" isearch.el (which is not a package, BTW)? There's no reason to require isearch.el, as it is loaded automatically. And why do you speak of "editing" isearch.el - are you trying to change some of its code? Unclear question, so far. – Drew Oct 7 at 17:40
  • @wasamasa nice to know it has been fixed in recent versions of emacs. I'm using emacs 25.1 (part of distribution, and I dislike to upgrade, yet) there is no (provide 'isearch) in isearch.el – jue Oct 8 at 8:51
  • 1
    FYI, the missing provide was added in 2016: github.com/emacs-mirror/emacs/commit/… – Tyler Oct 8 at 13:29
2

Immediate problem: configure isearch with use-package.

You can pass the filename as a string instead of a symbol (this is similar to eval-after-load, which is basically what the use-package macro expands to).

(use-package "isearch"
  ...)

Another possibilty for builtin preloaded packages like isearch is to "use" the "emacs" package (since Emacs always provides the emacs feature):

(use-package emacs ; isearch
  ...)

Or simply put the provide into your init file:

(provide 'isearch)
(use-package isearch
  ...)

See also Bug#25026 - Add missing (provide 'isearch) (this is done as of Emacs 26.1).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.