Skip to main content
81 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.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

What is the difference between the error handler in condition-case and the error function

The docstring for condition-case (C-h f condition-case) says: condition-case is a special form in `C source code'. (condition-case VAR BODYFORM &rest HANDLERS) Regain control when an ...
JeanPierre's user avatar
  • 7,475
7 votes
Accepted

Symbol's function definition is void: insert-string

See this issue. This problem should be fixed in the next release. Quick fix: Change the function insert-string to insert in ~/.emacs.d/core/core-spacemacs-buffer.el, and everything works well.
nalzok's user avatar
  • 675
5 votes
Accepted

Couldn't make condition-case work

Your error symbol test-signal is not defined. C-h f signal says: An error symbol is a symbol with an error-conditions property that is a list of condition names. Let's check this for some ...
xuchunyang's user avatar
  • 14.6k
5 votes
Accepted

When I (byte-compile-file "my-package.el"), can I treat warnings as errors?

The documentation for the customisable variable byte-compile-error-on-warn says: If true, the byte-compiler reports warnings with `error'.
Basil's user avatar
  • 12.5k
5 votes

What do I do when Emacs is frozen?

It also sometimes helps to abort-recursive-edit with C-].
Adobe's user avatar
  • 1,879
4 votes
Accepted

Standard way of reporting user errors to user?

You can use whatever you think is most appropriate for your context. There is no "right" way for all contexts. message does not prevent continued processing of the current command. If you want to be ...
Drew's user avatar
  • 78k
4 votes

Orgmode table error - shrunk field?

I experienced the same (invalid-function org-table-with-shrunk-field) issue and resolved it with the following process, gleaned from the comments: confirm the source of the issue with M-x org-version,...
Dave's user avatar
  • 227
4 votes
Accepted

unescaped character literals detection error

Section 2.3.3.1 Basic Char Syntax of the Elisp manual says: The usual read syntax for alphanumeric characters is a question mark followed by the character; thus, ‘?A’ for the character ‘A’, ‘?B’ for ...
db48x's user avatar
  • 18.3k
4 votes
Accepted

use search-forward to determine bound of another search-forward

When searching, Emacs starts from the current point. Also, when it searches, it moves the point forward until it finds a match (or reaches the end of the buffer). After your first search, the point is ...
dalanicolai's user avatar
  • 7,865
3 votes
Accepted

How to report that an interactive command couldn't run?

The only thing to be considered here is the semantics. One should use a programming language as good as possible in a sense of a natural language. I.e., the code you write should as directly express ...
Tobias's user avatar
  • 33.3k
3 votes

How to report that an interactive command couldn't run?

It depends on your usecase. error signals an error, this means it rewinds the call stack until the previous condition-case which catches the error. Consider following code: (defun foo () (...
jue's user avatar
  • 4,596
3 votes
Accepted

Keep going mode for require-package

You can wrap that in ignore-errors, to ignore any error evaluating it might raise: (ignore-errors (require-package 'clips-mode)) If you want to ignore only particular errors then you can instead ...
Drew's user avatar
  • 78k
3 votes
Accepted

Exiting from outer calling functions on error

You didn't raise an error with your error message. You just used message. So your message actually appeared (check buffer *Messages*), but then execution continued and the second message was ...
Drew's user avatar
  • 78k
3 votes

How can I disable the "<C-lwindow> is undefined" error?

I managed to remove the error by adding (global-set-key (kbd "<C-lwindow>") 'ignore) to my Emacs config file.
werki's user avatar
  • 51
3 votes
Accepted

Is the unwind-protect's clean form always evaluated?

This is a classic case where reading the docs gives you the answer immediately: unwind-protect is a special form in ‘C source code’. (unwind-protect BODYFORM UNWINDFORMS...) Do BODYFORM, ...
wasamasa's user avatar
  • 22.2k
3 votes

How to raise an error when unrecogized keyword arguments are passed to a function?

cl-defun handles this usecase: (require 'cl-lib) (cl-defun test (&key foo bar) (list foo bar)) (test :foo 1 :bar 2) ; (1 2) (test :foo 1 :bar 2 :baz 3) ; Error: "Keyword argument :baz not one ...
wasamasa's user avatar
  • 22.2k
3 votes
Accepted

How to invoke another function only if there is some error with a given function?

Read about condition-case in C-hig (elisp)Handling Errors (condition-case nil (function1) (error (function2)))
phils's user avatar
  • 51.6k
3 votes
Accepted

How to prevent the white flash when I try to go beyond the end/beginning of line?

This is called a bell, you can toggle it with (setq visible-bell nil) in your config file. but this does enable the audible which uses your computer's beep function
qKweint's user avatar
  • 90
2 votes

Get backtrace from error programmatically

The easiest thing to do is to create your own debugger in the environment in which the error occurs. That goes something like this: (defun my-debugger (&rest debugger-args) (message "BACKTRACE:...
cyberbisson's user avatar
2 votes

Taking action depending on the presence of particular message in the echo area

I don't know what you want to accomplish exactly, but as other people pointed out, reading the echo area is not the best strategy. Instead, you probably want to set up a sentinel. Many commands in ...
giordano's user avatar
  • 3,255
2 votes
Accepted

Catch invalid calc expression

As it says in the documentation of calc-eval, Return value will either be the formatted result in string form, or a list containing a character position and an error message in string form. So ...
Gilles 'SO- stop being evil''s user avatar
2 votes

Is the unwind-protect's clean form always evaluated?

To add a bit to what @wasamasa has said - The answer to your question is not to use unwind-protect, but instead to (1) define what you mean, in English, by "something goes wrong", then (2) define ...
Drew's user avatar
  • 78k
2 votes

Orgmode table error - shrunk field?

Please see here: https://orgmode.org/Changes.html#orgeeff4d2 In Org 9.2, you'll need to add shrink to the startup option line: #+STARTUP: align shrink The shrinking behaviour has changed from the ...
Liwen's user avatar
  • 121
2 votes

Identify which mode is throwing an error

Enable debugging via M-x toggle-debug-on-error or in the menu Options => Enter Debugger on Error.
Stefan's user avatar
  • 26.5k
2 votes
Accepted

After setting bookmark: `Wrong type argument: listp, "~/.spacemacs`

"Upgrading bookmark format from 0 to 1..." This message comes from the function bookmark-upgrade-file-format-from-0 which was added to Emacs 24 years ago. I presume that you don't actually have such ...
phils's user avatar
  • 51.6k
2 votes
Accepted

Why does Emacs not enter the debugger when popping a cons twice?

Like this? *scratch*: (let ((pair '("a" . "b"))) (let* ((a (pop pair)) (b (pop pair))) b)) C-j Debugger entered--Lisp error: (wrong-type-argument listp "b") cdr("b") (setq pair (cdr ...
phils's user avatar
  • 51.6k
2 votes
Accepted

Can a mode setup function fail?

No, the mode has already done a whole bunch of stuff before your error happens. Use M-x pp-macroexpand-last-sexp to see what your definitions expand to, and where your mode body code actually runs. ...
phils's user avatar
  • 51.6k

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