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.

2
votes
1answer
101 views

Why use the “and” in (funcall (and initial-major-mode))?

I came across this code today, and do not understand why the author used the "and" in it. As far as I can tell, these two lines deliver the same results and have the same functionality. The variable ...
1
vote
2answers
112 views

How to debug lack of response to a certain set of keystrokes?

Suppose I do a certain keystroke sequence in emacs, and nothing happens, even though I expect there to be a keybinding that would do something. This could be because: The keybinding is not actually ...
1
vote
1answer
232 views

cadr wrong type argument listp

I have this code that used to work fine until today: (let* ((newest-pkg (cadr (assq 'org package-archive-contents))) (installed-pkg (cadr (or (assq 'org package-alist) ...
1
vote
1answer
72 views

What is causing my javascript files to auto-format?

If I have a long line in a javascript file such as: let args = [options.loadRaw ? buffer : path.resolve(filePath)].concat(options.commands); At some point when I keep adding to that line, it auto-...
2
votes
1answer
165 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 ...
0
votes
1answer
37 views

Having trouble pinpointing this error wrong argument listp 1

I'm having trouble finding where the problem here is exactly. The result I'd like returned is a string that looks like 1. (n,adj-no) occupation 2. business My function is here and it looks like ...
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....
2
votes
2answers
318 views

How to write assertions

How does one write assertions in Emacs Lisp? I know that cl-macs.el has cl-assert and cl-check-type, but I'm wondering if there's a native Emacs way to perform something that basic.
0
votes
2answers
708 views

Can't see pdb output from shell-mode

I'm on Windows, for what it's worth. Just to make sure that it wasn't something that I did, I fired up emacs using -Q to avoid loading my init.el and attempted to run some python with a breakpoint ...
0
votes
0answers
135 views

Debugging a crippling memory leak

After using a emacs for a while all I see is Garbage collecting...done in the modeline. At this point emacs is constantly garbage collecting but can't free any memory and has to be restarted. Emacs ...
34
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 ...
3
votes
0answers
107 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 ...
1
vote
1answer
434 views

“Wrong type argument: symbolp” on function usage

I am trying to use following code: (defun rust-save-and-build (mode) (interactive) (save-buffer) (setq tmp (shell-command-to-string (format "cygpath.exe -m %s" (buffer-...
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 ...
1
vote
1answer
67 views

Jump to a bookmark+ dired bookmark from Lisp code

According to the docu of Bookmark+ this code: (bmkp-dired-jump BOOKMARK-NAME &optional FLIP-USE-REGION-P) should allow to quickly jump to a dired buffer that has been bookmarked. I try to eval (...
3
votes
1answer
101 views

detecting obsolete/deprecated settings in elisp files, particularly .emacs

I recently got bitten by a deprecated setting breaking a new package I was trying to use. The same behaviour had been reported by a number of users before me, but the authors were unable to reproduce ...
5
votes
0answers
60 views

How to investigate “color bleeding”?

I frequently have color-bleed issues in emacs, most often with AUCTeX: all of a sudden and for no apparent reason, the line I'm writing will be fontified as math. First things first: no, I do not ...
0
votes
1answer
520 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 ...
6
votes
3answers
916 views

How do I debug an “Invalid face reference: quote” message?

After using Emacs for some time, the message Invalid face reference: quote starts popping up in my message buffer. I'm not sure what causes it to start appearing. debug-on-message doesn't do anything ...
3
votes
1answer
187 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 ...
5
votes
1answer
627 views

How to better debug Emacs CPU management?

I can't remember since when exactly, but Emacs is getting slow with basic operations (moving cursor around). It's not exactly slow, but feeling laggy. Before I try and halven my configuration files ...
3
votes
2answers
220 views

How to debug elisp code when it is running

I have a elisp program which check server in a endless loop, like (while t (let ((status (check-server))) (case status ...) (sleep-for 100)) ) and I want to debug or update ...
4
votes
1answer
114 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-...
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 ...
2
votes
0answers
487 views

init error: file missing - cl-generic after any time I edit settings.org file

I am using org mode to organize my various Emacs settings. Within my init.el file I just have (taking out initial comments): ;;; Code: (package-initialize) (eval-when-compile (require 'use-package))...
9
votes
2answers
603 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 ...
1
vote
0answers
88 views

Emacs freezes while editing a tex file

Emacs freezes while I was moving cursor in a latex file with AucTeX-mode (and LaTeX-mode). Emacs becomes black and I can do nothing, including C-g. I followed the approach in this answer, and obtained ...
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"...
3
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 ...
6
votes
1answer
1k views

How do I change the working directory used by pdb/gud?

When running M-x pdb from Emacs, the current directory seems to be set to that of the directory of the script you are running, so pdb ~/path/to/project/__main__.py Would set the working directory ...
1
vote
1answer
815 views

Missing modules when debugging Python code in Emacs

For a number of reasons - the main one being that Emacs is amazing! - I am trying to do all my Python development at work in Emacs instead of Pycharm, which I was using previously. The one component ...
2
votes
1answer
55 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 ...
7
votes
2answers
166 views

Why expression fails in init file, but works fine during session [duplicate]

I want to understand why an expression of the form (load-theme 'my-kewl-theme t) fails1 when run as the last expression in my init (~/.emacs) file, but works fine if I evaluate it as soon as soon as ...
1
vote
1answer
28 views

Construct window with list of keybindings for the Emacs Debugger

I always forget the keybindings for the Emacs debugger. I'd like to have a small window open at the same time the debugger window opens with a list of keybindings (I'm thinking of something that would ...
3
votes
1answer
54 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 ...
4
votes
3answers
72 views

Is there any setting in Emacs to choose perlbrew over perl?

I have a Perl project (developed in Ubuntu 14.04) which cannot be built on perl 5.18.2, but it works on Perlbrew 5.22.0. I have tried to use M-x perldb in Emacs but it looks like Emacs calls Perl 5.18....
1
vote
1answer
322 views

Flycheck.erl checker that uses functions from projectile

Below is my attempt at adapting "erlang" syntax checker (from flycheck.el) for my needs. It tries to use GNU make for compilation instead of erlc. Apart from that nothing is changed. (flycheck-define-...
4
votes
2answers
848 views

Python remote debugging?

How do I debug remote python/twisted code from within Emacs? The closest I got with an internet search was Geben, if I understand correctly, but it has not been maintained for a few years now.
2
votes
2answers
85 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(...
6
votes
2answers
3k views

How do you configure emacs for julia?

What is a recomended way for making emacs as julia code editor? The things which I would like to have are: autocomplete julia shell in emacs with abbility to send the code from buffer debugging
4
votes
1answer
606 views

how to increase the debugging message level

I believe that there is a way to increase the debug level, but I don't recall how. Perhaps I am using the wrong terms, but web searches and looking on StackExchange are not providing me anything ...
3
votes
1answer
669 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 ....
0
votes
1answer
101 views

After `M-x pdb` switch to `compilation-mode` automatically?

M-x pdb is great while debugging. When the python process exits though, often there is a traceback left behind in the gud buffer that I'd like to view using compilation-mode so I can use next-error ...
2
votes
1answer
39 views

A possible incompatibility between `toggle-frame-maximized` and a mode using `visual-line-mode`

I have (toggle-frame-maximized) in my init file. If I enable the ospl-mode (btw very handy mode) given in the answer https://emacs.stackexchange.com/a/473/, then I minimize the frame, Emacs (GNU Emacs ...
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)...
3
votes
1answer
145 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) ...
1
vote
0answers
727 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 ...
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 ...
1
vote
0answers
483 views

Debugging a “Warning (bytecomp): reference to free variable” message

I just upgraded to a new bleeding edge version of Emacs in OS X: brew install emacs --HEAD --use-git-head --with-cocoa --with-gnutls --with-rsvg --with-imagemagick I understand that this version is ...
7
votes
3answers
457 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-...