I'm rewriting my Emacs' .init file and I'd like to be able to stop loading it at some specific points.
It's like inserting a break point, but nothing to do with debugging.
I've tried using 'throw' and 'catch' but that's not really what I'm looking for.
Thanks
You can add (debug) at suitable places. That will open a debugger window, where you can hit c to continue and q to quit.
Related
I'm trying to get familiar with emacs and Clojure and its working out pretty well..
It's just that everytime I get a Clojure error, it will close any emacs-window except the one where the error occured and instead show me a giant empty window of "popwin-dummy".
I can't quite see how that's supposed to help me fixing any bug... Can you tell me how to disable this behaviour?
Have a nice day!
As a general protection against "Emacs messed up my window configuration" occurrences, add the following to your init file:
(winner-mode 1)
You can also toggle it for the current session with M-x winner-mode
Then whenever your window configuration is unexpectedly changed, use C-c<left> to call winner-undo (which you can do repeatedly if necessary).
C-c<right> takes you back to the most recent configuration (immediately, rather than step-by-step).
Frequently when debugging backtraces pop up in Emacs, the minibuffer stops working properly. Specifically, anything I try typing in it 'types backward'. See the following screenshot (I was trying to type 'haskell' in the minibuffer):
When I quit out of the debug pane, the minibuffer starts typing normally again.
What's causing this? Any suggestions on how I can make it stop?
As nmichaels says, this is possibly related to the bidi-display-reordering setting (which is true by default, see: https://www.gnu.org/software/emacs/manual/html_node/emacs/Bidirectional-Editing.html
Could it be that the abbrev-insert or any other part of your code inserts one of the Unicode characters that change the direction of your text?
The root cause of this is that something makes it so that after inserting a character, Emacs moves point back to before that character. Why? I'm not completely sure, but I have a hunch:
Emacs is very smart, so it probably noticed you're coding in a pure language and figures you probably don't want to change "point" with those nasty side effects, so it resets it back to its initial value for you.
I'm debugging someones code, and it freezes when I do something specific, but Eclipse doesn't stop on an error (I may have accidentally turned this off). When I press pause in the debugger, Eclipse shows me a bunch of suspended threads, where two of them are coloured red.
I want to find out if there is an error anywere, or if there's just an infinite loop somewhere (which doesn't seem likely, because Eclipse should break in the loop in that case).
I'd be great if anyone can help me with this Thanks in advance!
Maybe you have a deadlock?
You can use jconsole (goes with java jdk) to find out this. Launch jconsole, attach to your process, go to the Threads tab. Press "Detect deadlock"... It can be also useful to look at all threads states, for example you can have infinity loop in one thread and another thread blocked etc...
I've had this happen to me before, try inserting breakpoints every few lines of code, then stepping through those until it breaks, removing the breakpoints that don't have any errors between them. Remember the line of code that causes it to crash and make whatever changes are necessary to fix it.
When I'm debugging code in a framework, it usually goes through a bunch of different calls in different files before actually getting to the file I want to investigate. Is there a way to open the file I want when I start geben, put the breakpoint in that file then tell geben to run (press g)?
Otherwise I have to keep stepping over/into until geben finally get's to the file I want, at which point I can then go to the line I want and set the breakpoint.
C-cf runs geben-find-file
IIRC, geben must already be in an active debugging session for that function to work; but once set the breakpoints are persistent, so it's not too onerous.
geben-breakpoint-menu menu is very convenient for setting conditionals, if you hadn't noticed that.
I've been using a copy of emacs (in a Debian VM I ssh to with putty) at work for a couple of months now, and up until now everything has been working brilliantly... but this morning I'm trying to edit a file in shell-script-mode, and am seeing some weird behavior with text around the cursor.
Basically, when I type the following ( [ ] represents my cursor):
export DATABASE[]
After I've typed the first few characters of the variable name the export statement disappears and the variable name aligns to the left margin, and all I end up seeing is (with the cursor out in the wilderness):
DATABASE []
If I then hit CTRL-L, the screen refreshes, and I see the text as it should be displayed... until I start typing, and then the buffer start acting strangly again (characters disappearing, moving, cursor ending up in the wrong place, etc)
I've not, to my knowledge, added anything to my .emacs file since this last worked as I expect it to, so I'm at a loss as to what could be happening here. It doesn't seem specific to sh-mode either - I've tested a few other file types and observed similar strange behavior. Are there any emacs afficianados out there who might be able to point me in the right direction to figure out what's wrong here?
Thanks in advance
I'm not sure what to suggest, but this sounds awfully like an issue with the terminal: I suspect that Emacs redraws the current line whenever it changes and I guess it tries to do so incrementally. If something's got out of whack with your terminal, then it seems quite plausible that the current word would get written at the start of the line (all Emacs sent) and your cursor would get abandoned "out in the wilderness" :-)
Obviously, this is a new change. Since it doesn't sound like the sort of issue that would be caused by Elisp configurations in your .emacs, you should check whether you've recently upgraded one of
PuTTY
Emacs version
SSH version (unlikely...)
Then maybe the relevant tool will have something in the changelog (which maybe you can disable via a config?)
One thing you could check: you say this isn't just SH-mode. Is it "any mode with syntax highlighting"? Maybe Emacs just sends over the wire the text with the current colour?
I had a similar problem of disappearing text using PuTTY / Emacs / Remote AWS Ubuntu when running ABCL LISP in a shell window.
The solution was: I had changed my foreground and background font colors (essentially reversed) in PuTTY but had neglected to change the bold fonts, so they were disappearing into the background.