开发者

Debugging emacs LaTeX config file without trial-and-error binary search

I have an extensive emacs configuration. Unfortunately, auto-fill-mode is broken within LaTeX-mode for some reason. How can I debug this without binary searching my emacs configuration for the error?

Alternatively, how can I make this function not set an undo point? It's annoying to have to press undo once per word and space in the document.

(local-set-key (kbd "SPC") 
               (lambda () (interactive) (fill-paragraph) 
                                        (insert " ")))
开发者_运维技巧


Well, you can try M-x debug-on-entry auto-fill-mode.

But my advice would be to use do the binary search you're trying avoid. There is nothing faster. My init setup is probably at least as extensive as yours, and I sometimes think there is a quicker way to guess what the problem is, and time and again I've been taught the lesson that binary search is the way to go. It just seems slow and silly at first.

Remember the parable of the wise man who convinced a ruler to pay him with one grain rice on the first chessboard square, 2 on the second square, 4 on the third, and so on. It really doesn't get any better than binary search when you have no idea where the problem is, and even often when you think you can guess the general location of the problem. Just do it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜