80 votes
Accepted

What do I do when Emacs is frozen?

When C-g doesn't work, you can sometimes get control back with: pkill -SIGUSR2 emacs As @Archenoth points out, sending the SIGUSR2 signal to Emacs turns on debug-on-quit. This can be useful, but you'...
Tyler's user avatar
  • 22.3k
37 votes

debugging some elisp -- "end of file during parsing error" in init.el

The "end of file during parsing" error means that you have not closed a paren. To debug this, you should Do M-x check-parens RET to pinpoint the location of the current error. Enable show-paren-mode ...
sds's user avatar
  • 6,114
35 votes
Accepted

How do I troubleshoot Emacs problems?

Step 1: running emacs -Q The first thing you need to do is run emacs without any of your customizations. If you can reproduce the problem in vanilla Emacs, it may actually be a bug in Emacs itself. ...
Tyler's user avatar
  • 22.3k
26 votes
Accepted

How do I debug `Package cl is deprecated`?

Try the following in an Emacs session with the code in question loaded up: (require 'loadhist) (file-dependents (feature-file 'cl))
wasamasa's user avatar
  • 22.2k
21 votes
Accepted

How to cancel `edebug-defun`?

From (info "(elisp) Instrumenting") : To remove instrumentation from a definition, simply re-evaluate its definition in a way that does not instrument. There are two ways of evaluating forms that ...
YoungFrog's user avatar
  • 3,526
16 votes
Accepted

Wrong number of arguments on lambda key binding

“Wrong number of arguments: (1 . 2), 0” means that a function expects at least 1 and at most 2 arguments (i.e. 1 mandatory and 1 optional argument), but it was called with 0 arguments. As npostavs ...
Gilles 'SO- stop being evil''s user avatar
12 votes

How to fix "Symbol's function definition is void: org-babel-get-header"

According to https://lists.gnu.org/archive/html/emacs-orgmode/2015-11/msg00425.html ob-sh was renamed ob-shell in org 8.2 ... and I cite from there: org-babel-get-header was removed in 0d000f5 (...
Tobias's user avatar
  • 33.2k
11 votes
Accepted

Error void-variable on function name

Short Answer Replace func2 with #'func2: (defun func2 (arg) (if (listp arg) (mapcar #'func2 arg) arg)) Explanation Emacs Lisp is a lisp-2 (like Common Lisp), not lisp-1 (unlike, say, ...
sds's user avatar
  • 6,114
11 votes
Accepted

Melpa - 'Failed to download melpa'

The error seems to be saying that ((\, "http://melpa.org/packages/")) doesn't match the regex "\`https?:" Let's look at that value, the one being added to package-archives: '("melpa", "http://melpa....
zck's user avatar
  • 9,092
10 votes

How to cancel `edebug-defun`?

In other words, how do I rescind the directive that causes edebug to enter debugging mode when a particular function is invoked? You can get this effect without removing instrumentation by setting ...
npostavs's user avatar
  • 9,203
10 votes
Accepted

Tracking down a write to a variable

This is still under development, but in Emacs 26.1 (assuming nothing goes wrong) you will be able to do M-x debug-watch <variable> RET and then any change to the variable will land in the ...
npostavs's user avatar
  • 9,203
10 votes
Accepted

Packages I never knew they existed cause problems

There was an issue with the latest straight.el commit. https://github.com/doomemacs/doomemacs/issues/6960 One way to fix it, is to update straight repo and getting latest version of straight , that ...
Tinker's user avatar
  • 116
9 votes

How to debug startup problem, if `--debug-init' has no effect

You can use elisp-bug-hunter to automatically bisect your init file. Automated error hunting If your Emacs init file signals an error during startup, but you don’t know why, simply issue ...
Wilfred Hughes's user avatar
9 votes

Can't get out of minibuffer completion

Is it possible there is an active recursive edit in the completion minibuffer? C-] by default is abort-recursive-edit. Alternatively keyboard-escape-quit or ESC ESC ESC might help?
dgtized's user avatar
  • 4,199
9 votes
Accepted

Debug an elisp error - show call stack when an error occurs

Use M-x set-variable RET debug-on-error RET t RET. (Or M-: (setq debug-on-error t).) That will open the debugger when the error is raised. You can see who called that recentf-mode, what arguments it ...
Drew's user avatar
  • 77.5k
9 votes
Accepted

Multiple URL formats for bug-reference-mode

Update Starting with Emacs 28, bug-reference is able to automatically detect and configure itself for Git forges including GitHub and GitLab. Quoth (info "(emacs) Bug Reference"): [...] ...
Basil's user avatar
  • 12.4k
8 votes

Show line number on error

Maybe because it's 2018 now, but in my case, I only had to turn on debugging like wasamasa suggested: M-x toggle-debug-on-error After this, M-x eval-buffer on my faulty Elisp file gave context ...
mistige's user avatar
  • 179
8 votes
Accepted

Surprisingly persistent local variable

In case someone else runs into this, I had enabled TeX-auto-save, which saves settings to an auto/ directory and loads them when a file is revisited. https://www.gnu.org/software/auctex/manual/...
Toothrot's user avatar
  • 3,264
8 votes
Accepted

Is there any way to get the memory size (usage) of a Lisp variable/value?

Is there any way to get the memory size/usage of a variable? Emacs 28 adds a more fine-grained memory usage reporting command than was previously available: ** New command 'memory-report'. This ...
Basil's user avatar
  • 12.4k
7 votes
Accepted

Signaling a breakpoint in Emacs Lisp

Add (debug) and you'll be thrown into a buffer showing you the backtrace and where you can examine the current state. See: Emacs Manual "Explicit Entry to the Debugger"
Stefan's user avatar
  • 26.4k
7 votes
Accepted

How to solve "Autoloading failed to define function sml-mode"?

This is a problem of conflicting libraries in load-path. I think you should inspect your load-path to see if you have sml-mode directory in it twice. The first directory probably doesn't contain a ...
narendraj9's user avatar
7 votes

How to see *Messages* buffer in Spacemacs?

It's just a buffer, so any of the numerous methods of switching to a buffer can be used. For example, using standard Emacs key sequences: C-xb *Messages* RET C-xC-b and select *Messages* M-x ibuffer ...
phils's user avatar
  • 51.1k
7 votes
Accepted

Can emacs show formatted backtraces?

Is there a way to get a pretty-printed backtrace buffer? There is, but you'll have to wait for Emacs 27 to be released or get a build of it in the meantime. Quoth its etc/NEWS file: * Changes in ...
Basil's user avatar
  • 12.4k
6 votes

detecting obsolete/deprecated settings in elisp files, particularly .emacs

Others will no doubt add more info to help answer this. I'll mention a few things that come to mind. `M-x customize-changed' shows you a Customize buffer that tells you about stuff that has changed ...
Drew's user avatar
  • 77.5k
6 votes
Accepted

Trace calls to a function with the parameters

The easiest way to find out the arguments passed to a function is to use M-x trace-function RET name-of-your-function RET. Once you're done, use M-x untrace-function or M-x untrace-all. Note that ...
YoungFrog's user avatar
  • 3,526
6 votes

How to write assertions

Here's an assert macro in elisp based on an expert's advice on emacs mailing list: (defmacro assert (test-form) `(when (not ,test-form) (error "Assertion failed: %s" (format "%s" ',test-form)))...
Emacs User's user avatar
  • 5,643
6 votes
Accepted

C-x C-f results in the error message: "Wrong type argument: commandp, counsel-find-file"

You have bound C-x C-f to the command counsel-find-file, which is part of the Counsel Package. Apparently, the counsel package is not getting loaded by your config files, so when you try to call it, ...
Tyler's user avatar
  • 22.3k
6 votes

Invalid read syntax "#"

;; Broken. Which is weird, since it came straight from the *Help* for go-mode This almost definitely indicates another case of the recently-introduced (25.1) text-quoting-style default behaviour ...
phils's user avatar
  • 51.1k
6 votes
Accepted

Need help with `expand-region`: Symbol’s function definition is void: org-outline-overlay-data

just delete ~/.emacs.d/elpa/*/develop/expand-region* and spacemacs will re-install it. https://github.com/syl20bnr/spacemacs/issues/12099#issuecomment-480904298 @flatwhatson The problem is that ...
BlindingDark's user avatar
6 votes
Accepted

How to see *Messages* buffer in Spacemacs?

This is possible in Spacemacs with SPC w p m key sequence (mentioned here). For more general way, in Spacemacs you can open buffer list with SPC b b. Then you can use your arrow key to find the ...
moanrisy's user avatar

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