Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options answers only not deleted user 105
1 vote
Accepted

(error "Required feature `cl-macs' was not provided")

If you need them only at compile time, do this: (eval-when-compile (require 'cl)) If you need them also at runtime (with byte-compiled code) then do this: (load-library "cl-macs") …
Drew's user avatar
  • 79.1k
1 vote

Launching emacs with configured packages

Just put the directory where dash.el[c] resides in your load-path value, before you require that library: (add-to-list 'load-path "/YOUR/DIRECTORY/CONTAINING/DASH/") (require 'dash) …
Drew's user avatar
  • 79.1k
0 votes
Accepted

Encountering void-variable sh-mode-map for define-key

If for some reason you don't want to require sh-script.el when you invoke tika-keymap-showhrk, you can instead add a defvar that defines all of the bindings you want, including the default bindings. … (require 'sh-script) ; <============ (dolist (mjmode mdlist) (let (($map (symbol-value (intern (format "%s-map" mjmode))))) (define-key $map (kbd "H-o a") #'outline-show-all))) ) …
Drew's user avatar
  • 79.1k
5 votes
Accepted

Prevent byte-compiler warnings after requiring features

IMHO, the right way is to ignore it. ;-) But the standard Emacs answer is to use declare-function - see (elisp) Declaring Functions. All you need to do is add a declare-function statement before …
Drew's user avatar
  • 79.1k
2 votes

Undefined-function error about function called by my function

Put (require 'THE-LIBRARY) inside your definition of safe-mail-send-and-exit, at the beginning (just after (interactive), where THE-LIBRARY is the library that defines function mail-send-and-exit. … (defun safe-mail-send-and-exit () (interactive) (require 'THE-LIBRARY) ; Replace THE-LIBRARY with the right library name. (if (string-equal (read-from-minibuffer "Are you sure? …
Drew's user avatar
  • 79.1k
0 votes

How can I get the old GNEVE to work?

If you don't want to change gneve.el then use load-library or similar, instead of require, to load it. …
Drew's user avatar
  • 79.1k
2 votes

For convenience, how should I load a package whenever a specific other package loads?

Use require if your library depends on another. That's the main question to ask yourself: does your library need the other library? If so, require it. … You can also use a "soft-require" if you want to load another library whenever something is true. …
Drew's user avatar
  • 79.1k
1 vote
Accepted

defcustom not appearing in Customize UI

To load a file, put it in your load-path, then require it in your init file. … For example, this will make all files in directory ~/.elisp (but not in subdirectories) loadable using require: (add-to-list 'load-path "~/.elisp") If the defcustom is autoloaded (it has an autoload cookie …
Drew's user avatar
  • 79.1k
0 votes
Accepted

require 'package vs with-eval-after-load 'package

Not at all the same. with-eval-after-load doesn't load its first argument; require does. Even if the require fails in your scenario, (do-something) is invoked. …
Drew's user avatar
  • 79.1k
4 votes
Accepted

Deep eager macroexpansion

A solution to the byte-compiler not evaluating your (non top-level) require statement is to force its evaluation, using (eval-and-compile (require 'clojure-mode)). … The fact that require is evaluated by the byte-compiler when it is at top level is pointed out in the Elisp manual, node Named Features (which I found by using i require in the manual). …
Drew's user avatar
  • 79.1k