Stack Exchange Network

Stack Exchange network consists of 175 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 [debugging]

Debugging is a methodical process of finding and reducing the number of bugs, or defects, in a computer program.

21
votes
1answer
1k views

How do I troubleshoot Emacs problems?

In a situation where Emacs is not behaving like I want, what can I do to troubleshoot the problem? What steps can I take to find and fix the problem myself? Or, failing that, how can I gather useful ...
15
votes
1answer
1k views

How do I debug an emacs crash?

I am debugging why emacs crashes when using a function from a package1. The aim of this debug process is to get useful data to submit using M-x report-emacs-bug. To get help on how to debug emacs ...
48
votes
9answers
23k views

Using Emacs as a full-featured C/C++ IDE

I have been trying off and on for over a year now to use Emacs as a C/C++ IDE. I have only been marginally successful thus far, but have run into a few brick walls along the way. Currently I am ...
43
votes
2answers
5k views

Debugging a frozen Emacs

I am using mew for my e-mail. I need to use TLS with my email provider for SMTP. However, when I try to invoke that, Emacs freezes. I would like to take this opportunity to learn more about Emacs ...
35
votes
2answers
6k 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 ...
9
votes
0answers
416 views

Edebug orgmode source code blocks with input variables

What is the standard method to debug emacs-lisp orgmode source code blocks with input variables as header arguments? I found the hacky solution to insert the following snipped in front of a source ...
6
votes
3answers
3k views

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

When I launch Emacs24 (in an Ubuntu machine) I get an error message in the init procedure. Warning (initialization): An error occurred while loading `/home/nivaca/.emacs': But when I launch it with ...
2
votes
2answers
390 views

Tracking down a write to a variable

Something setqs desktop-dirname to nil after my "init.el" is loaded. I want to track down the offending code. Just before the end of "init.el", desktop-dirname is correctly set. I checked run-hooks ...
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 ...
9
votes
2answers
620 views

Navigate to the source code of built-in functions and variables

Throughout the day I am constantly using C-h f or C-h v (describe-function and describe-variable) to look up documentation for functions and variables. More often than not, if I don't get all the ...
13
votes
2answers
1k views

How to kill a buffer when it causes Emacs to stop responding? [duplicate]

I use Emacs Dired to manage files. Accidentally, I hit Enter on an image file, Emacs tries to open the image and stop response. Is there a way to kill this process? (Since I am running other ...
11
votes
2answers
1k views

How to cancel `edebug-defun`?

How do I undo the effects of edebug-defun? In other words, how do I rescind the directive that causes edebug to enter debugging mode when a particular function is invoked? Also, I'd really like to ...
9
votes
1answer
1k views

How to compile emacs with debug symbols?

I'm having trouble walking through emacs source code in gdb. I think I'm missing debug symbols. Following a suggestion from https://stackoverflow.com/a/4298982/2752242, I tried: ./configure CFLAGS="...
7
votes
3answers
459 views

how to get Emacs to locate the error in my init file without relaunching?

When there's an error in one of my init files, I get a vague message like this when I launch Emacs: Warning (initialization): An error occurred while loading /Users/im/.emacs.d/init.elc: (wrong-type-...
2
votes
1answer
61 views

eval-after-load and define-key of raise-sexp results in an error of “Unbalanced parenthesis”

(eval-after-load 'lisp-mode (define-key emacs-lisp-mode-map (kbd "C-c r") 'raise-sexp)) When above lisp is evaluated, it shows following error message. up-list: Scan error: "Unbalanced parentheses"...
1
vote
0answers
145 views

How to debug a(n) .emacs that doesn't work correctly, but also doesn't throw any errors? [closed]

I currently have an Emacs/AucTeX setup where emacs --debug-init doesn't throw any errors, but things still don't work as expected. This being the case, I don't really know how to debug my .emacs file ...
17
votes
1answer
677 views

Interrupt evaluation and observe current stack in the emacs-lisp debugger?

If some emacs-lisp function, such as a major mode hook, is taking longer than expected to execute, I would sometimes like to interrupt it and look at the current stack. Ideally, I'd also like to be ...
3
votes
2answers
198 views

How to know which function triggered an autoload of a library

How can I monitor when Emacs loads a library because of an autoloaded function, and also know the name of that function? EXAMPLE:  I type M-x eval-buffer in a buffer where one of the functions uses ...
10
votes
1answer
586 views

Find elisp origin of warning

I ran a command and received a warning in the minibuffer. The exact warning was comint-completion-at-point failed to return valid completion data, after I autocompleted a command in shell-mode. How ...
6
votes
4answers
1k views

Debugging slowness in init file (not hostname related)

I am seeing some slowness in my init file loading: $ time emacs --debug-init -eval '(kill-emacs)' -Q real 0m0.672s user 0m0.338s sys 0m0.057s $ time emacs --debug-init --eval '(kill-emacs)...
5
votes
1answer
2k views

How to fix this startup package initialization problem?

All of a sudden Emacs returns an error at the startup, when I run $ emacs --debug-init from the terminal (linux) I get this debug error message: Debugger entered--Lisp error: (wrong-type-argument ...
1
vote
1answer
208 views

How do I make a bug report or feature request against GNU Emacs? [duplicate]

I found this list at the emacswiki: FFI (foreign function interface). Would be great to have this in GNU. Enhanced Numerics. We sorely need this too. Apparently much better multimedia support (Of ...
5
votes
2answers
376 views

How to visit file containing source code for a given function?

To open a buffer on the source code for a command definition, I usually follow a convoluted procedure something like this: Guess the name of the mode from the function name Guess the name of an elisp ...
3
votes
1answer
699 views

Recentf doesn't remember all files

I have the following problem with recentf. If I open a file from commandline like emacs myfile the file myfile doesn't appear in the list of recently opened files (I also checked directly the file ....
3
votes
0answers
209 views

Emacs sometimes fails to save files

I'm experiencing a weird problem with Emacs on Windows where sometimes, after a while, the current buffer I'm in throws an error when attempting to save the file. I can't seem to reliably reproduce ...
3
votes
1answer
189 views

trace-redisplay: How to see stderr from within Emacs?

When building Emacs, I use ./configure --enable-checking='glyphs' so that I can take advantage of some of the built-in tools such as M-x trace-redisplay. The redisplay debugging messages can be seen ...
2
votes
2answers
83 views

How to see *Messages* buffer in Spacemacs?

How to see *Messages* buffer as advised in this answer - https://emacs.stackexchange.com/a/32069/23367? Why do I need this? I am new to Spacemacs and I am trying to understand how it can help me ...
1
vote
1answer
45 views

Unclear error message from a function call in my init file

With my Emacs 26.1 on my 10.13.6 Mac, I want Emacs to systemically open my file located at /Users/ewandelanoy/Documents/html_files/Printable/latinized_agreda2.txt with the mac-roman-mac encoding, ...
1
vote
1answer
191 views

emacs Aborted (core dumped)- centOS 7.0 emacs 25.3 — Please Help

Dear stackexchange users, I would really appreciate your help in fixing my issue. I am new with centOS 7.0 with less a year of experience. I was using emacs-24.3 until the following error came up, so ...
1
vote
1answer
1k views

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

I opened Emacs, and executed C-x C-f. A beep sounded and the following message appeared in the status line: Wrong type argument: commandp, counsel-find-file All I wanted was to open an existing file....
0
votes
0answers
17 views

helm-comint-input-ring - get error: shell-mode-map

windows 10, emacs 26.1, helm 3.0 I use C-c C-l (comint-dynamic-list-input-ring) I get something like this: But I don't like this. I want to use helm-comint-input-ring. I want to get something like ...