Questions tagged [error-handling]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
34 views

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

Assume that I have two functions, say function1 and function2. I would like to execute function2 only if there is some error during the execution of function1. So far, I have tried the below code (...
0
votes
0answers
29 views

Some keybinding stopped working this morning with error “Wrong type argument: arrayp, nil”

I used counsel-org-goto-all to jump between headings. This morning, the command (which I have bound to C-;) stopped working with this error: Wrong type argument: arrayp, nil. I have searched on the ...
0
votes
2answers
49 views

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

With a function that uses keyword arguments using this style of function definition: (defun some-name (&rest kwargs) (plist-get kwargs 'example)) Is there a convenient way to ensure only ...
0
votes
0answers
134 views

Cannot enable org-roam mode - No EmacSQL SQLite binary available (windows 10)

Cannot make org-roam work under windows 10 because I get "No EmacSQL SQLite binary available". What I've done: Installed org-roam using M-x install-package. Installed emacsql-sqlite3 using M-x ...
0
votes
0answers
20 views

How does one debug errors in a process filter, (setq debug-on-error t) does not pop up a *Backtrace*?

With annoying frequency I get errors in my *Messages* buffer that seem to come from process-filters however, I never get a *Backtrace* for them. So, I have to play around and do similar experiments ...
0
votes
0answers
22 views

Recovery from accidentally huge operation

I accidentally typed C-u 800000 ι, and now EMACS hangs and my fan is spinning. How do I most effectively recover from this? I did try C-g, which did not work. pkill -USR2 emacs stopped my fan, but ...
0
votes
1answer
21 views

Emacs 24.3: warning “Unable to activate package”

Upon startup of my emacs 24.3, I'm getting the errors: Warning (emacs): Unable to activate package `with-editor'. Required package `emacs-24.4' is unavailable I have a dim recollection that when I ...
1
vote
2answers
25 views

Can a mode setup function fail?

If I define a new mode using define-derived-mode or define-minor-mode, can the mode setup somehow signal failure so that the mode is not activated? All of the following modes are activated despite ...
0
votes
1answer
22 views

How to handle multiple kinds of errors with condition-case?

With condition-case, is there a way to handle multiple kinds of errors? Currently I have user-error and error both being handled. Is there a way to de-duplicate these checks to handle any kind of ...
0
votes
1answer
35 views

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

I wrote some LISP code that was wrong because I was trying to pop a cons twice: (let ((pair '("a" . "b"))) (let* ((a (pop pair)) (b (pop pair))) b)) Evaluating this in the *scratch* ...
4
votes
2answers
102 views

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

When writing my own interactive function, whats the best way to report that nothing happened. (if line-is-empty (message "Found empty line, nothing to do!") (do-stuff)) Or is it better to use ...
3
votes
0answers
566 views

Fontconfig Error in Snap version of Emacs

I installed Emacs 26.3 using Snap in my Debian Buster. After I launch it, it gives me the following errors: Fontconfig warning: "/etc/fonts/fonts.conf", line 5: unknown element "its:rules" Fontconfig ...
1
vote
1answer
39 views

How does emacs flash its icon on the windows taskbar?

Sometimes when I run a process if there is an error during the process the emacs icon on the windows taskbar lights up, so if I'm in an other app I can see something happened there. I'd like to use ...
0
votes
0answers
21 views

AucTeX'sTeX-next-error not catching any errors in ConTeXt

AucTeX's TeX-next-error doesn't display any of the errors listed in the output buffer, only "No more errors". MWE: \starttext \Hello \stoptext % Local Variables: % ConTeXt-Mark-version: "IV" % End: ...
0
votes
0answers
25 views

“<Hangul> is undefined” error on space key press

I'm running Emacs 26.1 without any "strange" configuration: a bare bone Ubuntu 19.04 emacs package with few packages installed from elpa or melpa. I have the following issue: when pressing space bar ...
2
votes
2answers
96 views

Couldn't make condition-case work

Hello fellow Emacs Lisp enthusiasts! I've encountered problem that I am even embarrassed to describe. It is very clear how to use condition-case from all the docs and examples that I can find online, ...
1
vote
1answer
71 views

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

So I did just M-x bookmark-save in my original .spacemacs file, which lead to the case that when I booted Spacemacs, I get the following error: Upgrading bookmark format from 0 to 1... mapcar: Wrong ...
0
votes
0answers
72 views

Why AUCTeX/pdflatex show me help in Japanese?

I had this error message displayed to me by AUCTeX (already corrected using \ddot{\boldsymbol x}) ERROR: Extra }, or forgotten $. --- TeX said --- <recently read> } l.51 \[ \boldsymbol M\ddot\...
1
vote
1answer
61 views

Latex compilation message in the echo area dissapears too soon

The outcome (success/error) of a Latex compilation (TeX-command-run-all) is printed in the echo area. Once you press a key, however, the echo area is cleared and the message is gone. I usually look at ...
1
vote
1answer
71 views

Keep going mode for require-package

In my initialization file, I have got: (require-package 'clips-mode) The thing is that, lately, this package fails to be loaded sometimes (it's already downloaded but I guess it fails when it tries ...
0
votes
1answer
78 views

helm-mu on macOS throws Invalid read syntax: (")

Hej guys, I get an error when searching through my mails with helm-mu. Messages gives Invalid face reference: helm-grep-finish [96 times] error in process filter: helm-mu-candidate-parser: End of ...
3
votes
2answers
925 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
46 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
233 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
33 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
120 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
221 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
313 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 ...
2
votes
1answer
36 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
131 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
169 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
62 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
110 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
2answers
1k 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/...
3
votes
1answer
445 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 (...
12
votes
1answer
635 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
86 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 ...
2
votes
1answer
57 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
40 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
36 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 ...
53
votes
2answers
10k 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
197 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
267 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) (...
7
votes
1answer
207 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
657 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 ...
3
votes
3answers
640 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
323 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
954 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 ...
9
votes
2answers
354 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
215 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. ...