Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [require]

The tag has no usage guidance.

1
vote
3answers
40 views

Launching emacs with configured packages

Let's say I want to use elisp functions in a script . I rely in my script on some library, dash which I require. #!/usr/local/bin/emacs --script (require 'dash) (message (describe-variable 'load-...
0
votes
1answer
62 views

Why is calc-precision function definition void?

For a school assignment, we were to find some way to overcome Elisp's limited floating point precision. I found this, which I thought was pretty useful, but it gives no description of how to actually ...
1
vote
1answer
535 views

require vs. package-initialize?

Ok, this is a noob question but I've digging into this enough that I think it's reasonable to ask :) My question: In one's .emacs / init.el file, can one use require to load packages that were ...
0
votes
1answer
16 views

Error on loading my custom minor mode

I created a custom minor mode for my Wordpress projects: (define-minor-mode wordpress-mode "Wordpress minor mode" :lighter " Wordpress") (provide 'wordpress-mode) And on my init.el I load the ...
0
votes
1answer
51 views

How do I require a package installed via .cask in a project

I'm trying to contrib to a project and installed cask and did cask install and now I have a .cask folder with the deps. Now in emacs how do I evaluate a .require of one of those deps? Is there a ...
0
votes
1answer
88 views

What's the difference of (require 'init-local nil t) and (require 'init-local)?

I'm not familiar with elisp at present. I put my local configuration into init-local.el and exclude it in .gitignore. I use (require 'init-local nil t) in init.el file before, however I think (...
0
votes
1answer
156 views

How can I replace in my .emacs all these `require` with `package.el` and `MELPA`?

My .emacs still uses old-style (pre MELPA, pre package.el) initializations. Current (this works) I'll use web-mode as a concrete example. If I manually download web-mode.el and put it in ~/elisp, ...
1
vote
1answer
213 views

How to autoload a package without requiring in the init file?

When you install clojure-mode via package-install, you can then open any .clj file and automatically enter the mode. And this works for every subsequent Emacs launch ; Yet, no (require 'clojure-mode) ...
1
vote
1answer
38 views

Requiring user-installed packages from byte-compiled .emacs

I have the following in my .emacs.el: (when (require 'edit-server nil t) (custom-set-variables '(edit-server-default-major-mode 'markdown-mode) '(edit-server-new-frame nil)) (edit-server-...
0
votes
0answers
277 views

lsp-rust: require + provide but still void-function

I am trying to use lsp-rust package. I installed it from melpa. After I run it I got message in *Messages*: Error loading autoloads: (void-function lsp-define-stdio-client) There are two packages: ...
4
votes
2answers
91 views

Prevent byte-compiler warnings after requiring features

In Elisp packages, we sometimes want to use a feature only if the user has installed another package without specifying that package as a dependency for our own. E.g. (when (require 'markdown-mode ...
0
votes
1answer
69 views

Emacs - How “package management tool” got installed? [closed]

In emacs 24.5.1, M-x package-list-packages shows the list of packages. My understanding is, below elisp code should be part of my .emacs, (require 'package) (package-initialize) (add-to-list '...
1
vote
2answers
37 views

cl-lib isn't loaded the first time an autoloaded function is used from it

I'm trying to use cl-lib early in my init.el. The function I'm using (cl-some) is autoloaded, so I expect that don't need an explicit require, yet I get a void-function error if I don't explicitly ...
2
votes
1answer
388 views

Require a file in the current directory without setting load-path

I have test code that wants to require some utility code in the same directory. I would prefer to not update the load-path, as most of the time, I do not want me or any other user who has checked out ...
5
votes
1answer
85 views

Soft-require a feature, then conditionally run more commands

What's the idiomatic Emacs way to soft-require a feature, then use that feature if it's available? The require function allows “soft require” by specifying a non-nil third argument: (require '...
1
vote
1answer
122 views

How to load libraries (Lisp files), wherever they are located

I've been learning how to use modules using the cider-mode source code but I've run into a very basic issue. The contents of my files are main.el (require 'main-module) (main-module-message) ...
3
votes
2answers
144 views

Deep eager macroexpansion

This works: (require 'clojure-mode) (when (member 'clojure-mode my-packages) (define-clojure-indent (-> 1) (->> 1))) This gives the error Wrong type argument: listp, 1: (when (...
1
vote
0answers
260 views

How to tell if a emacs library is loaded?

Is there a function that will tell me for a given library foo if (require 'foo) has previously happened?
0
votes
1answer
49 views

How to require/provide a package name with the value of `user-login-name`, without hard coding it?

I am trying to load package depending on a user's login name For example: If a user's login name is "user_foo", I would like to (require 'user_foo). I don't want to hard code the user's login name. ...
5
votes
1answer
2k views

What does (require 'package) mean for emacs and how does it differ from load-file?

I just began using emacs a few days ago and I read somewhere that (require 'package-name) is not needed when the said package is installed using package-install. But why, what does (require 'package-...
1
vote
1answer
139 views

(require 'flx-ido) fails, but “M-x flx-ido-mode” succeeds

I installed the flx-ido package from MELPA, and added the following two lines of code to my .emacs file. (require 'flx-ido) (flx-ido-mode 1) Emacs startup fails with the following error: File error:...
2
votes
1answer
306 views

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

On Windows Emacs v24.2.1 I get error: (error "Required feature `cl-macs' was not provided") I byte-compile my .emacs and here is code: (with-no-warning (require 'cl-macs)) Actually (load "cl-macs")...
4
votes
1answer
76 views

How to Find Out Where a File is Being Required?

Using benchmark-init, I see that helm files (helm-elisp, helm-mode, helm, etc.) are being required, but I don't have "(require 'helm)" or "(require 'helm-config)" or "(helm-mode 1)" anywhere in my ...
28
votes
3answers
2k views

When should I use autoload instead of require?

From what I understand require is used to load large chunks of code (something like modules) although it can also load individual functions. Autoload on the other side, only registers functions and ...