Questions tagged [error-handling]
The error-handling tag has no usage guidance.
68
questions
2
votes
1
answer
31
views
use search-forward to determine bound of another search-forward
I'm trying to use lisp to search for a pattern bounded by another one across a BiBTeX file.
Let's say the following is the file I want to search in
% Created using Papers on Wed, 07 Apr 2021.
%% http:/...
0
votes
0
answers
30
views
What's the meaning of the error: Point 95406 after end of properties?
What's the meaning of the error: Point 95406 after end of properties?
I identified the piece of code that produces this error (blocking my script):
;; "Fig" --> "Figure"
;; &...
4
votes
1
answer
94
views
How to prevent the white flash when I try to go beyond the end/beginning of line?
When I hit the end or beginning of the line and I press to go past it, my echo area flashes white.
This also happens when a function fails.
How do I stop this from happening?
1
vote
1
answer
39
views
Capturing "quit" in the completion prompt
I need to use completion prompt, but also capture the fact when the user hits <escape> or C-g. Here's an example:
(let ((proj (completing-read "choose project:" projectile-known-...
1
vote
1
answer
170
views
Failed to download ‘melpa-stable’ archive. GnuTLS : Contacting host: 443
I am trying to install packages/modes from melpa on my emacs27.1, but I am unable to do so. If I run M-x package-refresh-contents , I get the following error :
Importing package-keyring.gpg...done
...
2
votes
1
answer
39
views
Find out where "Text is read only" coming from
My workflow involves converting a huge generated org-mode document that is created in a read only buffer and is automatically put together. When trying to export it to latex, sporadically I get the &...
0
votes
0
answers
23
views
Guess features needed to provide function upon void-function error
Question
How do I run code before any void-function error is signaled? I have a feeling I can use advising for this, but I don't know what exactly I need to advise.
What I want to achieve
Before any ...
1
vote
1
answer
40
views
Why is Emacs Entering the Debugger despite a condition case wrapper?
The context of my question: I was editing some clojure code, and point was inside a comment, and to the right of three characters: `abc'.
I ran the command: M-x company-diag, to ask company mode for a ...
1
vote
1
answer
32
views
A way to check if "(current-kill 0)" will run onto an error before it happens
I have an Elisp part involving (current-kill 0) to copy the current clipboard content into a variable. This works flawlessly as long as the kill-ring has content. However, if I just started the ...
1
vote
1
answer
123
views
unescaped character literals detection error
When I reload my init file I get an error (or warning) saying
unescaped character literals `?(', `?)', `?[', `?]' detected!
What does this error (warning) mean and how can one fix it?
0
votes
1
answer
40
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
0
answers
147
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
2
answers
75
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
0
answers
758
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
1
answer
82
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
2
answers
32
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
1
answer
56
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
1
answer
92
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
2
answers
136
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 ...
5
votes
0
answers
1k
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
1
answer
71
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
0
answers
87
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 ...
3
votes
2
answers
389
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
1
answer
215
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 ...
1
vote
1
answer
104
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
1
answer
83
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
1
answer
88
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 ...
3
votes
2
answers
1k
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
1
answer
64
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
0
answers
384
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
1
answer
38
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 ...
2
votes
1
answer
217
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
1
answer
231
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
0
answers
429
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
1
answer
44
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
1
answer
208
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
2
answers
324
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
1
answer
92
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
0
answers
152
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, ...
4
votes
2
answers
2k
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
1
answer
793
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 (...
13
votes
1
answer
935
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
1
answer
92
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
1
answer
98
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
1
answer
48
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
1
answer
43
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 ...
60
votes
2
answers
15k
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
1
answer
332
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
2
answers
370
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
1
answer
301
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 ...