X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Friece-debug.el;h=c2ba3c6c7abd1a39368b8885fadecc316ae2ffef;hb=1d93da31ebf937e79bbb252a7190a56ee1fc82d1;hp=d3132ce2a6411fe9ac0762aad37a13579c29f4a9;hpb=1862e5558b8b7b2b909f7b2d4787b9c0f0b9f687;p=riece diff --git a/lisp/riece-debug.el b/lisp/riece-debug.el index d3132ce..c2ba3c6 100644 --- a/lisp/riece-debug.el +++ b/lisp/riece-debug.el @@ -19,12 +19,29 @@ ;; You should have received a copy of the GNU General Public License ;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. ;;; Code: (require 'riece-globals) +(require 'riece-options) + +(defun riece-debug-1 (message detail) + (message "riece-debug: %s" message) + (save-excursion + (set-buffer riece-debug-buffer) + (goto-char (point-max)) + (let ((time (format-time-string "%Y-%m-%d:%H:%M:%S"))) + (if detail + (insert "*** " time ": " message "\n" detail "\n") + (insert "*** " time ": " message "\n"))))) + +(defun riece-debug (message &optional detail) + "Print a one-line debug MESSAGE at the bottom of the frame. +If the optional 2nd argument DETAIL is specified, it is stored into +`riece-debug-buffer'." + (ignore (riece-debug-1 message detail))) (defun riece-debug-reset-standard-output () "Reset `riece-temp-buffer' to be used as `standard-output'." @@ -60,7 +77,8 @@ backtrace to standard-output." (goto-char (point-min)) (if (re-search-forward "^ signal(" nil t) (delete-region (point-min) (match-beginning 0))) - (message "Error in `%s': %S\n%s" ,location error (buffer-string)))) + (riece-debug (format "Error in `%s': %S" ,location error) + (buffer-string)))) nil))) (put 'riece-ignore-errors 'lisp-indent-function 1)