[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: if and only if an Error message
From: |
Emanuel Berg |
Subject: |
Re: if and only if an Error message |
Date: |
Sat, 19 Jul 2014 13:48:53 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Michael Heerdegen <michael_heerdegen@web.de> writes:
> It's not harmful. But it's not a user option, so if
> you set its value, you should know what you are doing
> and how the flag is used internally.
If I had to know what I'm doing nothing would ever be
done. Even more so, if I know it, then why do it...
But put it this way: how do I find out a variable isn't
a user option?
> I would start trying something like this ...
Thank you!
Yes, check this out -
(setq error-buffer-name "*Errors*")
;; inhibit the debugger -
;; try this if nothing else: a wonderful thing to not
;; have it hop out over half the screen for something
;; that can be communicated in a few words
(setq debug-on-error nil)
(setq eval-expression-debug-on-error nil)
;; this does three things, see the comments
(defun say-and-log-error (data _ fun)
(let*((error-str (format "%S in %S" data fun))
(error-buffer (get-buffer-create error-buffer-name))
(error-win (get-buffer-window error-buffer)) )
(message error-str) ; echo the error message
(with-current-buffer error-buffer
(goto-char (point-max))
(insert error-str "\n") ) ; log it
(if error-win
(with-selected-window error-win ; move focus of error window
(goto-char (point-max)) ; if available
(recenter -1)) ))) ; (is there a better way?)
;; use it instead of the default one
(setq command-error-function
(lambda (&rest args)
(apply #'say-and-log-error args)) )
;; show the error buffer
(defun show-errors ()
(interactive)
(switch-to-buffer (get-buffer-create error-buffer-name))
(goto-char (point-max)) ; the same situation: the last line of data
(recenter -1) ) ; should be on the last window line
; whenever possible
; test here:
; (message 'error-as-not-string)
--
underground experts united
- if and only if an Error message (was: Re: Emacs hangs with 100pc CPU during query-replace), (continued)
- if and only if an Error message (was: Re: Emacs hangs with 100pc CPU during query-replace), Emanuel Berg, 2014/07/18
- Re: if and only if an Error message, Michael Heerdegen, 2014/07/19
- Message not available
- Re: if and only if an Error message, Emanuel Berg, 2014/07/19
- Re: if and only if an Error message, Michael Heerdegen, 2014/07/19
- Message not available
- Re: if and only if an Error message, Emanuel Berg, 2014/07/19
- Re: if and only if an Error message, Michael Heerdegen, 2014/07/19
- Re: if and only if an Error message, Michael Heerdegen, 2014/07/19
- Message not available
- Re: if and only if an Error message, Emanuel Berg, 2014/07/19
- Re: if and only if an Error message, Michael Heerdegen, 2014/07/19
- Re: if and only if an Error message, Michael Heerdegen, 2014/07/19
- Message not available
- Re: if and only if an Error message,
Emanuel Berg <=
- RE: if and only if an Error message, Drew Adams, 2014/07/19
- Re: if and only if an Error message, Michael Heerdegen, 2014/07/19
- Message not available
- Re: if and only if an Error message, Emanuel Berg, 2014/07/20
- Re: if and only if an Error message, Michael Heerdegen, 2014/07/21
- Message not available
- Re: if and only if an Error message, Emanuel Berg, 2014/07/21
- avoiding global variables (was: Re: if and only if an Error message), Emanuel Berg, 2014/07/20
- Re: avoiding global variables, Thien-Thi Nguyen, 2014/07/21
- Message not available
- Re: avoiding global variables, Emanuel Berg, 2014/07/21
- Message not available
- Re: Emacs hangs with 100pc CPU during query-replace, Emanuel Berg, 2014/07/18
- Re: Emacs hangs with 100pc CPU during query-replace, Thorsten Jolitz, 2014/07/19