Questions tagged [debugging]

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

3
votes
1answer
80 views

(delete-backward-char) needs an argument?

I have written a function to yank a selected region n times. I get a warning however because of the (delete-backward-char) although it seems to work. Does the (delete-backward-char) need an argument? ...
3
votes
1answer
40 views

Completion in edebug-eval-expression

Is there a way to get completion-at-point to work inside edebug-eval-expression (i.e. similarly to the way it works in eval-expression)? Presently, when I press tab inside of a call to edebug-eval-...
3
votes
1answer
55 views

Continue debugging same function

When I write lisp code that contains errors, I debug it with toggle-debug-on-error. Unfortunately, once a certain function triggers the debugger once, Emacs stops launching the debugger on errors in ...
3
votes
2answers
202 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 ...
3
votes
1answer
290 views

how to debug constant freezing with emacs org-mode on windows?

I use org-mode with emacs heavily. On LINUX, everything is great. When I have to use windows emacs regularly freezes and I have to kill via task manager and restart. Any suggestions on how I can ...
3
votes
1answer
159 views

Debugging open file handles in emacs

Is there a way I can find what file handles emacs has open, and close these references? Or even better, find where they are being open? Emacs is keeping handles to a large number of files (a leak) ...
3
votes
1answer
38 views

How can I identify all changes to match-data?

I have a sporadic error when running query-replace: Args out of range: #<buffer lib.rs>, 0, 1 There are similar questions: Match data clobbered by buffer modification hooks (RegEx-)Replace: ...
3
votes
1answer
674 views

Correct way to configure the lastest `org-mode` (literate programming)

Update: 11/Aug: I forgot to mention that I'm using literate programming to build the init.el from an org file. It seems that the problem appears when emacs opens the configure.org to generate the .el ...
3
votes
1answer
116 views

Delete breakpoint set using edebug-defun

I set break-point in function (add-hook 'c-mode-common-hook (function (lambda nil (if (or (string-match "llvm" buffer-file-name) (string-match "nvvm" buffer-file-...
3
votes
1answer
51 views

(RegEx-)Replace: Sporadic Match data clobbered by buffer modification hooks

I know this was asked in other contexts already, but I couldn't find anything related to C++ development with my hooks that could help me. I am working a lot with replace and query-replace and query-...
3
votes
0answers
86 views

Multiple Quit messages in my *Messages* buffer

When I hold C-p or C-n to navigate any page, the movement is jerky and I get multiple Quit messages in my *Messages* buffer. I checked the C-h l to see the commands ran, it only has the C-n [next-...
3
votes
0answers
1k views

Spacemacs C++ debugging?

What tools are you using for setting Breakpoints visualize Variables within Spacemacs? I had a look at gdb but it felt awkward to set the breakpoints separated from the source files. I would like to ...
3
votes
0answers
243 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
0answers
40 views

Display all internet connections during startup

How can I display all Internet connections that are used during startup? Sometimes I work in a low speed Internet environment and I would like to remove all the Internet connection code during startup....
3
votes
0answers
117 views

Why is emacs freezing and how can I prevent it? (likely involving org agenda)

What would cause emacs to "mostly" freeze when creating an org agenda? I say "mostly" because when you type C-g, it does show "Quit" in the minibuffer, and the time logging number in the minibuffer ...
3
votes
1answer
191 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 ...
3
votes
0answers
536 views

Emacs typing backwards

So, sometimes when I go into a buffer that has a [ as the first character (such as .ini files) emacs suddenly starts typing everything backwards. In other words, if I press the keys y e s I get out s ...
3
votes
0answers
719 views

Why doesn't auto-complete work in ruby-mode?

I have spent several days trying to debug auto-complete, it is working properly in Elisp mode, but when I go in Ruby mode it stops working. auto-complete-mode runs successfully, but the menu of ...
2
votes
2answers
120 views

Invalid read syntax “#”

I'm having trouble using: (add-hook ’before-save-hook #’gofmt-before-save) This is supposed to format the go code before saving. The error I get is: Debugger entered--Lisp error: (invalid-read-...
2
votes
1answer
894 views

Error void-variable in mapcar

What is the difference between the two functions func1 and func2? (defun func1 (arg) (if (listp arg) (mapcar (lambda (x) (func1 x)) arg) arg)) (func1 (list 1 2 3)) (defun func2 (arg) (...
2
votes
2answers
428 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 ...
2
votes
3answers
511 views

How can I determine which package is adding .emacs.d to my load-path?

I have a bunch of packages installed. One of them is adding ~/.emacs.d to my load-path, which Emacs is (unsurprisingly) complaining about. I could be incorrect here, but: Attempting to bisect my ...
2
votes
2answers
2k views

“Symbol's value as a variable is void: defun” when reloading .emacs?

I am always editing my .emacs file, and I was just wondering if I could reload it without restarting Emacs? Note: I have tried M-x load-file and choosing the .emacs file, but I get this error ...
2
votes
1answer
44 views

Does function evaluation depend on place where it is defined?

I get an error message from rtags module while trying to call rtags-taglist. While edebugging it I didn't find any problem with this function, although of course debugger printed the same error as ...
2
votes
2answers
53 views

How to append an argument to an external command in init.el?

I 1must append a config file to 2package command, required as -p puppeteer-config.json. In my init.el, I tried changing the native command as shown below: From: (setq ob-mermaid-cli-path "~/...
2
votes
2answers
108 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 ...
2
votes
2answers
149 views

Debugging a recalcitrant eldoc function

I'm using SLIME and common LISP (SBCL) for some weekend hacking. I've just upgraded to emacs 26.1 on Mac OS X 10.13.5. Now I've run into a problem with the setup where I'm suddenly getting: error ...
2
votes
1answer
64 views

Define a function to execute multiple commands

Here is part of my init.el: (defun xx-devanagari-script () (interactive) (save-excursion (face-remap-add-relative 'default :family "Lohit Devanagari") (text-scale-increase) (text-...
2
votes
1answer
91 views

Multiple URL formats for bug-reference-mode

I’m working on a project which is version controlled using GitLab. GitLab, unlike GitHub, uses two separate URL endpoints for issues and merge requests (AKA Pull Requests): https://gitlab.example....
2
votes
2answers
209 views

Trace calls to a function with the parameters

I need to track the calls to org-tags-view to discover the params passed to it. I tried an advice: (defun his-tracing-function (orig-fun &rest args) (message "org-tags-view called with args %S" ...
2
votes
1answer
214 views

Fixing wrong-type-argument to looking-at in Emacs 25 js-mode on large files

When using js-mode (or js2-mode) on Emacs 25.1 (in Debian 9) to edit some large files, any attempt to insert text after some "random" point in the file fails with an elisp stack trace: Debugger ...
2
votes
1answer
149 views

Obtaining a backtrace on batch invocation of Emacs?

The only way I know of printing a backtrace for errors in batch invocation of Emacs is by setting debug-on-error inline like so: $ emacs -batch --eval "(setq debug-on-error t)" -f "my/foo-function" ...
2
votes
1answer
188 views

How to use NSTRACE when debugging

I would like to use NSTRACE to see its built-in messages, and create new ones, at various locations within nsterm.m. I imagine/guess that enabling NSTRACE needs to be done when configuring Emacs and ...
2
votes
1answer
1k views

(wrong-type-argument stringp nil)-error when starting dired

Dired used to run fine on my machine (Ubuntu 14.04). But for a while now, i keep running into the error (wrong-type-argument stringp nil). This does not only happen with dired but also with other ...
2
votes
1answer
65 views

escape or omit binary data in backtrace buffer?

Many times when I check the backtrace buffer, I can't copy the text out because of the embedded binary data (perhaps it's the internal null characters making the copy function think the string is ...
2
votes
1answer
1k views

“Error in process sentinel: Selecting deleted buffer” when exiting Emacs?

I am getting the following message when I do C-x C-c to exit Emacs: error in process sentinel: Selecting deleted buffer So instead of exiting Emacs like normal, I am forced to close it through ...
2
votes
1answer
561 views

Debugging server related warning message

I've been seeing this issue for some time now, but I don't know how to debug it. I start up a emacs instance, using say emacs foo.tex & Then I run C-c C-c to compile. A new window pops open, ...
2
votes
1answer
435 views

Show breakpoints when debugging Matlab

I am using matlab-emacs to debug a matlab script from inside of emacs with GUD. Everything seems to be working as expected except that I don't see any breakpoint indicators in the fringe. This is ...
2
votes
1answer
28 views

Get asked to confirm safe theme forever

I created a theme which I stored in ~/.emacs.d/themes/, added this directory to custom-theme-load-path, and put (load-theme "the-theme.el") in my init.el. Now restarting emacs, I get prompted whether ...
2
votes
1answer
181 views

Signaling a breakpoint in Emacs Lisp

Many languages have a mechanism to signal an attached debugger to pause or break. For example in JavaScript this is done using the debugger keyword. In others like C# or Visual Basic the signal is ...
2
votes
1answer
60 views

Get a list of functions evaluated

I am trying to track down a weird bug in my emacs configuration - the cursor, occasionally, jumps to a random location when I am scrolling using the arrow keys, in cc-mode. I don't see any accidental ...
2
votes
2answers
86 views

Get actual buffer name from backtrace buffer?

I have a buffer foo.el with some invalid code (bar) If i run M-x eval-buffer, with debug on, it show this in backtrace buffer Debugger entered--Lisp error: (void-function bar) (bar) eval-buffer(...
2
votes
1answer
502 views

How can I delete all the gdb related windows/buffers after `q` in gdb CLI window

I use (setq gdb-many-windows t) and (setq gdb-show-main t) configurations in my init.el, so after executing M-x gdb, there will be six windows in the frame, after typing q in the main gdb cli window ...
2
votes
1answer
68 views

M-= shortcut suddenly stops working in Emacs in KDE

I'm trying to run M-= on a region of text, but nothing happens. I think the shortcut is registered (I don't get a message like "M-= is undefined") but the execution stops for some reason and there is ...
2
votes
1answer
530 views

json-readtable-error during org-capture

This problem only arose today and I haven't really changed anything substantial in my init.el so I am sure what the source of the error is. Essentially, when running org-capture (and also during ...
2
votes
1answer
769 views

Debug an elisp error - show call stack when an error occurs

I am relatively new to emacs / elisp, and am trying to build some custom functionality. I have added a number of functions which are added to a major-mode. Occasionally (and seemingly only after a ...
2
votes
1answer
600 views

Emacs lisp throwing error when using spell check

I am trying to configure Hunspell in my emacs running in windows. When I type M-x ispell-buffer, I get the following error: Debugger entered--Lisp error: (wrong-type-argument stringp nil) string-...
2
votes
1answer
82 views

Debugging in elisp

I am having a fairly big .emacs file with lots of stuff inside, parts of which I have copied from somewhere else. At some point in the file I am setting the font size to some value but this setting ...
2
votes
2answers
184 views

Emacs without GUI adding extra text to opened files

Whenever I open a file using emacs without gui (emacs --no-window-system) it modifies the file with the following text: 12;rgb:0000/0000/0000 This text is inserted at the beginning of the file. How ...
2
votes
1answer
265 views

gdb-many-windows causes hangs in emacs 24.5

When running gdb -i=miand then attach to the process for debugging, emacs hangs for like 5 minutes before I can type anything. After trial and error I found it is caused by the following line in my ...