* riece-emacs.el (riece-recent-messages): New function.
* riece.el (riece-submit-bug-report): Use riece-recent-messages
instead of (with-output-string (print-recent-messages ...)).
+2004-11-19 Daiki Ueno <ueno@unixuser.org>
+
+ * riece-xemacs.el (riece-recent-messages): New function.
+ * riece-emacs.el (riece-recent-messages): New function.
+ * riece.el (riece-submit-bug-report): Use riece-recent-messages
+ instead of (with-output-string (print-recent-messages ...)).
+
2004-11-18 Daiki Ueno <ueno@unixuser.org>
* riece.el (riece-submit-bug-report): New command.
(defalias 'riece-facep 'facep)
+;;; stolen (and renamed) from emacsbug.el.
+(defun riece-recent-messages (n)
+ "Return N most recent messages, most recent first.
+If N is nil, all messages will be returned."
+ (let ((message-buf (get-buffer "*Messages*")))
+ (if message-buf
+ (with-temp-buffer
+ (let (beg-pos end-pos)
+ (with-current-buffer message-buf
+ (setq end-pos (goto-char (point-max)))
+ (if n
+ (progn
+ (forward-line (- n))
+ (setq beg-pos (point)))
+ (setq beg-pos (point-min))))
+ (insert-buffer-substring message-buf beg-pos end-pos)
+ (reverse-region (point-min) (point-max))
+ (buffer-string))))))
+
(provide 'riece-emacs)
;;; riece-emacs.el ends here
(add-text-properties start end (list prop value 'start-open t 'end-open t)
object))
+(defun riece-recent-messages (n)
+ "Return N most recent messages, most recent first.
+If N is nil, all messages will be returned."
+ (with-output-to-string
+ (print-recent-messages n)))
+
(provide 'riece-xemacs)
;;; riece-xemacs.el ends here
"Submit via mail a bug report on Riece."
;; This strange form ensures that (recent-keys) is the value before
;; the bug subject string is read.
- (interactive (list (with-output-to-string
- (print-recent-messages 20))
- (recent-keys)))
+ (interactive (list (riece-recent-messages 20) (recent-keys)))
(require 'reporter)
(let ((reporter-prompt-for-summary-p t))
(unless riece-debug
"(closed server)"))
(setq pointer (cdr pointer))))
;; Insert recent keystrokes.
- (insert "\n\n"
- "Recent keystrokes:\n-----------------\n\n")
+ (insert "\n\nRecent keystrokes:\n"
+ "-----------------\n\n")
(let ((before-keys (point)))
(insert (key-description recent-keys))
(save-restriction
(search-forward " " nil t)
(insert "\n"))))
;; Insert recent minibuffer messages.
- (insert "\nRecent messages (most recent first):\n"
+ (insert "\n\nRecent messages (most recent first):\n"
"-----------------------------------\n"
recent-messages))))