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 [error-handling]

The tag has no usage guidance.

2
votes
2answers
78 views

Orgmode table error - shrunk field?

I'm very new to Emacs and Org mode, so I'm basically fumbling around. I'm getting an alarm bell ding whenever I type in an table in an *.org file. A message says "invalid function: org-table-with-...
0
votes
1answer
27 views

Identify which mode is throwing an error

I am attempting to edit a file. Emacs is preventing me from making the edit, and throwing: Args out of range: #<buffer user.action.js>, 4965, 17721. It is completely not obvious to me where this ...
0
votes
0answers
28 views

“No such file or directory, bind-key” after installing use-package [duplicate]

I'm using Emacs on Windows 10. I want to override key bindings, so after reading How to override major mode bindings, I installed use-package with the built-in package manager (via M-x package-install ...
0
votes
1answer
25 views

How Can I Prevent make-process from failing if the default-directory doesn't exist?

Usually, when you open a file, Emacs prompts you to run M-x make-directory RET RET if the directory doesn't exist. However, after writing my own advice, I realized that opening files in directories ...
1
vote
1answer
56 views

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

I use Windows 10's virtual desktop feature. The hotkey for switching between virtual desktops is Ctrl-Win-Left / Ctrl-Win-Right. When Emacs is focused and I want to switch dekstops, I get an error ...
1
vote
1answer
153 views

Running emacs client: how do you know if the init files had errors loading

I use emacs 25, in nw mode, with "alias emacs='emacsclient -nw'" When I add something to my personal.el, I do brew services restart emacs My issue is, if I make a big blunder inside my personal.el ...
0
votes
0answers
19 views

Flycheck error display not formatted. It Displays XML

Can someone tell me why my error output does not parse xml and looks like this? ( see: https://i.imgur.com/W7ISh4C.png ) Ubuntu(v16.04 xenial) GNU Emacs 25.3.1 flycheck 31 js2-mode 20170721 eslint v4....
0
votes
0answers
154 views

toggle-debug-on-error only works for the first error, how can i fix this?

when I enable debug on error it works perfectly the first time. when I go and fix my error and rerun my function debug on error no longer triggers for new errors. Is there a way to enable it so ...
3
votes
1answer
33 views

Exiting from outer calling functions on error

Consider the following: (defun my-divide-by-0() (condition-case nil (/ 1 0) (error (progn (message "Could not evaluate: 1/0") nil)))) (defun my-test() (interactive) (my-divide-by-0) ...
0
votes
1answer
69 views

redirect stderr to a file in call-process-region

I have been reading the documentation for call-process-region here and I am trying to redirect stderr to a file. from the the documentation, this looks correct (call-process-region beg end perltidy-...
1
vote
2answers
79 views

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

I have this loop: (catch 'QUIT (while (search-forward-regexp "\\([^\n\\]\\(?:\\\\\\\\\\)*\\|^\\(?:\\\\\\\\\\)+\\)%.*\n" nil t) (save-excursion (let ((b (make-...
3
votes
1answer
44 views

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

As part of CI testing, I'm byte-compiling package files to make sure there are no errors. I'd like to take this a step further and ensure there are no warnings, either (like 'function not known to be ...
0
votes
0answers
78 views

On Windows 8.1, in Emacs Ghostscript doesn't work, while on commandline it does

Edited question of August 2017: After a long search I found the reason, why a wonderful software called pdfsizeopt (for my question from April 2017 see below) does not work, when called from Emacs, ...
2
votes
1answer
889 views

Symbol's function definition is void: insert-string

;; Specify the startup banner. Default value is `official', it displays ;; the official spacemacs logo. An integer value is the index of text ;; banner, `random' chooses a random text banner in `core/...
1
vote
1answer
158 views

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

I am wondering the semantic of the error function. For condition-case, the Elisp manual says: The arguments after the protected form are handlers. Each handler lists one or more condition names (...
9
votes
0answers
387 views

Get backtrace from error programmatically

If an error is signalled in Emacs Lisp code, and debug-on-error is t, I get a backtrace buffer that makes it easy to figure out where the error occurred. However, for errors that occur while ...
2
votes
1answer
81 views

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

I have my proper function to run latex, say my-tex. Sometimes one should run latex two times to get references right. A message like below in the echo area appears to tell this. How to identify ...
3
votes
1answer
34 views

Standard way of reporting user errors to user?

I am writing an emacs package which provides some commands to the user. The user can run things like M-x foobar and M-x eggsspam. However, some of these commands can fail. As an example, without ...
2
votes
1answer
32 views

Which function should I advise to do something when a user-error is unhandled?

I need to advise emacs to do something when any error dings to the user. I can't find any documentation on which function I actually need to advise. Which function do I need to advise to do ...
2
votes
1answer
32 views

Catch invalid calc expression

Inspired by this blog I wrote a function which replaces arithmetic expressions between two $ symbols with the mathematical result inline (and deletes the $ symbols). How can I modify this such that it ...
31
votes
2answers
5k views

What do I do when Emacs is frozen? [duplicate]

What should I do when Emacs stops responding? My current "emacs-is-frozen" protocol looks like this: Spam C-g (it sometimes works) Wait for a while. pkill -9 emacs What alternate steps could I try ...
2
votes
1answer
103 views

Break on all errors in edebug

How can I make Emacs break on an error, even if the error is being handled somewhere? In my current scenario, the setup of a major mode is modifying the buffer and I want to find out why (and then ...
0
votes
2answers
148 views

autoload list of packages in Emacs 25.0.92

According to emacs.SE answer I am trying to make Emacs (version 25.0.92) autoload packages if they are not already installed on my computer. At my .emacs file now I have only: (package-initialize) (...
5
votes
1answer
120 views

How to abort saving in a before-save-hook function?

If, in a function run from before-save-hook, I want to abort the saving of a file, so that the file is not saved and the user is signaled, how can I do that? Is it possible (without rebinding C-xC-s ...
0
votes
1answer
483 views

Cryptic startup error messages

I just started out on emacs so this might have a really simple answer. I'm getting an error message on startup and have no idea what it means. The debug message doesn't help much either. What do ...
4
votes
3answers
329 views

Finding frames by name

I'm trying to write a little compilation monitor frame that gets compilation updates written to it without the overhead of seeing absolutely everything going on in the compile. I've been working with ...
4
votes
1answer
253 views

How to condition-case Lisp nesting exceeds `max-lisp-eval-depth'?

I'd like to catch too big recursive call nesting in elisp, like this: (condition-case nil (potentially-too-recursive-function) (xxx (message "Gave up, using defaults"))) What is the symbol in ...
1
vote
0answers
693 views

Can't exit Emacs with error “End of file during parsing”

Every time I press c-x c-c to exit Emacs, it shows "End of file during parsing" in the minibuffer. I cursorily examined my .emacs and did not find any mismatching parenthesis. Any idea what's the ...
8
votes
2answers
264 views

Rethrowing an error in Emacs Lisp

I need to call a function and perform a cleanup only if the function fails, and then relaunch the error. Here is the pseudo-code: (condition-case err (call-function) (error (cleanup) ;; ...
3
votes
3answers
157 views

How to call another function, if one function gives an error message

Suppose I call a function which is named as foo. Sometimes that function foo will give a message such as "Example of error message". If that is the case, then something else should be executed. ...
2
votes
1answer
49 views

Invoke function on message

The debug-on-message variable tells Emacs to start the debugger when a matching message is displayed. How can I get Emacs to invoke my own function when a matching message is displayed? My motivation ...
4
votes
1answer
505 views

Capturing stderr of subprocesses

I'm trying to capture stderr separately from stdout for a (synchronous) process run from emacs. I've found one way of doing it based on some code copied from emacs' shell-command function (I don't ...
3
votes
1answer
67 views

Perform function until it returns user-error

I want to define a function org-move-subtree-top that calls org-move-subtree-up until it returns a user-error (in this case "Cannot move past superior level or buffer limit"). How can I do this in ...
15
votes
3answers
3k views

Show line number on error

Say that emacs throws some error that I don't understand. Or maybe the error says "Symbol's value as variable is void: modes", but there are many occurrences of the symbol modes in my code, so I need ...
2
votes
1answer
135 views

How do I catch signals?

After reading the documentation, here's what I've tried: (condition-case err (signal 'my-error 'my-data) (my-error (message "data: %S" err))) Evaluating this form still throws the signal, ...
2
votes
1answer
284 views

define-error for older Emacs?

I'm using define-error to throw custom errors. But it looks like this function wasn't yet implemented in emacs-24.3, for instance. It still seems to work for emacs-24.3 if I write this: (when (...
4
votes
3answers
1k views

File mode specification error: How to find syntax problem: Missing :END: line in org-mode properties?

When I launch my emacs software (Aquamacs.app) I see a message File mode specification error: (error ":END: line missing at position 23740") Unfortunately, I do not know in which file this problem ...
2
votes
1answer
85 views

How does one define a widget of type editable-list with validation?

I create my widget with the following code: (widget-create 'editable-list :entry-format "%i %d %v" :value '("") '(editable-field ...
0
votes
1answer
290 views

Error in post-command-hook during org-agenda-todo

Ever since upgrading to emacs 24.4.1, when I set something as 'done' from the agenda, I frequently get the error: Error in post-command-hook (org-add-log-note): (error "Variable binding depth exceeds ...
1
vote
1answer
382 views

How to prevent Emacs from opening error buffer

I got someone ask this question: How can I prevent errors that should really just be a bell or flashing screen not open a window with an error?
3
votes
2answers
722 views

Emacs flickers when I run certain commands (gif screencast included)

After I did an overhaul of my .emacs file yesterday (adding/removing packages, organizing, etc.), I'm left with an annoying screen flicker. It happens when I move the cursor to the edge of the buffer ...
17
votes
3answers
826 views

How to gracefully handle errors in init file

I would like a way to catch errors when running my init file, and then handle them gracefully. A lot of my most important customizations and keybindings show up at the end of my init file to make sure ...