14 votes
Accepted

How do you recompile an .el source file and make it active in my current session

How do you recompile an .el source file [...] In Elisp file-visiting buffers, you can run the command M-xemacs-lisp-byte-compileRET to byte-compile the corresponding file. In Dired buffers, you can ...
Basil's user avatar
  • 12.4k
7 votes
Accepted

use-package: load all defined packages

Take a look at the customization options available for use-package. I think you can set use-package-always-demand based on how Emacs was started to get the behavior you want. For example at the ...
glucas's user avatar
  • 20.6k
7 votes
Accepted

How to re-load a package?

You can unload the system prolog mode first, this unbinds all its variables, so that the new defvar init-forms will take effect: (require 'prolog) (when (version< prolog-mode-version "1.25") (...
npostavs's user avatar
  • 9,203
7 votes
Accepted

Obviate the need to specify every folder for a manual setup

(defvar my-packages-dir "~/.emacs.d/packages") (let ((default-directory my-packages-dir)) (normal-top-level-add-subdirs-to-load-path))
Fran Burstall's user avatar
5 votes

How to make all variables and functions of a mode visible without activating the mode

@phils gave you what is almost always the correct answer, that is, it is the right answer for most major and minor modes; but in the case of eshell you need to do something else: (add-hook 'eshell-...
Omar's user avatar
  • 4,812
4 votes

Command to Run (Eval) "Hello World" in ELISP on Eshell?

The one word you request can also be just a dot .. After running that command you get: ~/Documents $ . hello.el Hello World ~/Documents $ If this is too strange for you you can also use: ~/...
Tobias's user avatar
  • 33.2k
4 votes
Accepted

emacs-custom file get overwritten

You used M-x customize-variable, edited the option value, and then saved it. When you save your changes they're written to your custom-file (or your init file, if you have no custom-file defined). So ...
Drew's user avatar
  • 77.5k
4 votes

Is it possible to see if a library is loaded after another one?

I remembered load-historywith that, I came up with this that seems to work. Libraries that are loaded more recently have a smaller position (i.e. closer to the beginning of the list). (let ((org-ref-i ...
John Kitchin's user avatar
  • 11.9k
4 votes

How do you reload a dynamic module?

Here is a work-around: (defun fake-module-reload (module) (interactive "fReload Module file: ") (let ((tmpfile (make-temp-file (file-name-nondirectory module) nil module-file-...
xuchunyang's user avatar
  • 14.5k
3 votes
Accepted

Should I use "require" or "load" when writing my own configuration?

The point of require is not lazy-loading (that would be autoload instead). Instead, the purpose is to avoid loading the same package multiple times. In the case of config files, which of load or ...
Stefan's user avatar
  • 26.4k
3 votes

How do you do runtime code swapping?

There is no real definition in Dave Thomas' video presentation. Therefore I stick to the definition Don Stewart gives in his PhD cited in your question. Dave Thomas mentiones in his video that a ...
Tobias's user avatar
  • 33.2k
3 votes

How do you do runtime code swapping?

Yes, at any point you can redefine a function by evaluating a defun with the name of an existing function. By extension, when you reload a file with M-x load-file, all function definitions in that ...
legoscia's user avatar
  • 6,072
3 votes
Accepted

How to load an Idris file that depends on a package?

The layer for idris in Spacemacs use this https://github.com/idris-hackers/idris-mode. So for my part, using spacemacs and helm, I succesfully load a file using contrib using the following shortcut: ...
Luc DUZAN's user avatar
  • 146
3 votes
Accepted

How to make all variables and functions of a mode visible without activating the mode

You don't :) At least, not for this use-case. Instead you defer your configuration until such time as the library in question has been loaded: (with-eval-after-load "esh-mode" (define-key eshell-...
phils's user avatar
  • 51.1k
3 votes

Command to Run (Eval) "Hello World" in ELISP on Eshell?

You asked: A file (message "Hello World") saved as 'hello.el'. Now, how to run (evaluate) this file on Eshell? ~/Documents $ ....... hello.el I just fill in the command at the dots: ~/...
Tobias's user avatar
  • 33.2k
3 votes

How to re-load a package?

As an alternative to unload-feature, you could use this to check the version of the default package without actually loading the code: (let ((version (with-temp-buffer (insert-file (...
Tyler's user avatar
  • 22.3k
2 votes

use-package: load all defined packages

You can either add :ensure t to each package you want to load from ELPA, or add (setq use-package-always-ensure t) to the beginning of your emacs config file and add :ensure nil to those few packages ...
Heikki's user avatar
  • 3,066
2 votes

Is it possible to lazy-load language mode packages?

You can use autoload rather than require example with yaml-mode (autoload 'yaml-mode "yaml-mode" nil t) (add-to-list 'auto-mode-alist '("\\.yml$" . yaml-mode))
djangoliv's user avatar
  • 3,199
2 votes

Command to Run (Eval) "Hello World" in ELISP on Eshell?

To run program written in Emacs Lisp from shell like other general languages, use (elisp) Batch Mode: ~ $ cat ~/Documents/hello.el (message "Hello World") ~ $ emacs --batch --load ~/Documents/hello....
xuchunyang's user avatar
  • 14.5k
2 votes

Loading and executing .el file if it exists on startup

Mystery solved, it's a bit embarrassing: Emacs is doing fine but just showing the startup-screen as first buffer. Disabling it via (setq inhibit-startup-screen t)? does the trick...
Uwe Ziegenhagen's user avatar
2 votes

In what order are Lisp files evaluated in this scenario?

Emacs will load your init.el file first. Nothing else gets loaded unless init.el says so. You can answer your question by working through init.el and looking for require or load lines, which will be ...
Tyler's user avatar
  • 22.3k
2 votes
Accepted

Multiple files for reading abbreviations?

An abbrev file contains regular Lisp code and is evaluated using load. Therefore all you need to do is to add (load B) (with B being the full path to file B) to your init file wherever appropriate.
wasamasa's user avatar
  • 22.2k
2 votes

Obviate the need to specify every folder for a manual setup

(defvar my-packages-directory "~/.emacs.d/packages") (dolist (package-directory (directory-files my-packages-directory :absolute)) (add-to-list 'load-path package-directory))
Phil Hudson's user avatar
  • 1,741
2 votes

How do you install DoReMi?

You install it the same way you install any code from any random .el file: copy it into your load-path, and then call require. require takes one argument, which is the name of the feature to load. Add ...
db48x's user avatar
  • 18.1k
2 votes
Accepted

Function load raises error on loading an existing file

OK. If anyone has a similar problem, I figured it out. The problem was not a failure to find the file that was the argument to the (load) function, the problem was that /that/ file was doing a (...
Daniel Doherty's user avatar
2 votes

how to load a file in init.el

load-file needs an absolute file name. If you don't give it an absolute path, it will have to generate one based on the current buffer's default-directory which isn't going to be what you want: $ cd /...
phils's user avatar
  • 51.1k
1 vote
Accepted

How to improve ‘jedi‘ package's load time

While switching configurations I've came across this issue yet again and I believe I have a workaround for this if you're still interested. The steps I do to reproduce: start fresh emacs, venv-workon ...
Tomasz Grining's user avatar
1 vote

Load a list from a file (in a script)

You can throw the burden of iterating onto lisp's read. To do that you just need to realize that the list in journals is a lisp list with the beginning and ending parentheses missing. So fill-in the ...
Rusi's user avatar
  • 331
1 vote
Accepted

Load a list from a file (in a script)

Something along these lines? (let ((JOURNALS (with-temp-buffer (insert-file-contents FILENAME) (let (list form) (while (setq form (ignore-...
phils's user avatar
  • 51.1k
1 vote

The dirtree mode not present installed using melpa

Command dirtree is not marked for autoloading so you need do (require 'dirtree) first. Or follow instructions provided in dirtree commentary section: Put the following into your ~/.emacs: (autoload '...
muffinmad's user avatar
  • 2,300

Only top scored, non community-wiki answers of a minimum length are eligible