>>>> "Raymond" == Raymond Toy
<toy.raymond(a)gmail.com> writes:
>>>> "Mats" == Mats Lidell
<matsl(a)xemacs.org> writes:
Mats> Hi,
Mats> Some strange things in your report I'm afraid.
>> I found this problem using git mode when adding a new
directory (which
>> isn't supported in git.el). I can reproduce the crash using the
>> following steps with xemacs -vanilla:
>> (load "emacs-simple")
Mats> What is emacs-simple? I don't have it? Is that somehow related to
Mats> git.el[1] (which I don't have either.)
Raymond> Dang. Did I forget to attach emacs-simple? It's attached now. :-)
Or maybe not. Why didn't gnus C-c C-a attach the file? Let's try that again
with text/plain instead of application/emacs-lisp.
And just in case, I'm pasting the relatively small file that just
contains display-message-or-buffer directly too.
Ray
---
(defun display-message-or-buffer (message
&optional buffer-name not-this-window frame)
"Display MESSAGE in the echo area if possible, otherwise in a pop-up buffer.
MESSAGE may be either a string or a buffer.
A buffer is displayed using `display-buffer' if MESSAGE is too long for
the maximum height of the echo area, as defined by `max-mini-window-height'
if `resize-mini-windows' is non-nil.
Returns either the string shown in the echo area, or when a pop-up
buffer is used, the window used to display it.
If MESSAGE is a string, then the optional argument BUFFER-NAME is the
name of the buffer used to display it in the case where a pop-up buffer
is used, defaulting to `*Message*'. In the case where MESSAGE is a
string and it is displayed in the echo area, it is not specified whether
the contents are inserted into the buffer anyway.
Optional arguments NOT-THIS-WINDOW and FRAME are as for `display-buffer',
and only used if a buffer is displayed."
(cond ((and (stringp message) (not (string-match "\n" message)))
;; Trivial case where we can use the echo area
(message "%s" message))
((and (stringp message)
(= (string-match "\n" message) (1- (length message))))
;; Trivial case where we can just remove single trailing newline
(message "%s" (substring message 0 (1- (length message)))))
(t
;; General case
(with-current-buffer
(if (bufferp message)
message
(get-buffer-create (or buffer-name "*Message*")))
(unless (bufferp message)
(erase-buffer)
(insert message))
(let ((lines
(if (= (buffer-size) 0)
0
(count-screen-lines nil nil nil (minibuffer-window)))))
(cond ((= lines 0))
((and (or (<= lines 1)
(<= lines
(if resize-minibuffer-frame
(cond ((integerp resize-minibuffer-window-max-height)
resize-minibuffer-window-max-height)
(t
1))
1)))
;; Don't use the echo area if the output buffer is
;; already dispayed in the selected frame.
(not (get-buffer-window (current-buffer))))
;; Echo area
(goto-char (point-max))
(when (bolp)
(backward-char 1))
(message "%s" (buffer-substring (point-min) (point))))
(t
;; Buffer
(goto-char (point-min))
(display-buffer (current-buffer)
not-this-window frame))))))))
---
_______________________________________________
XEmacs-Beta mailing list
XEmacs-Beta(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-beta