Mercurial > hg > xemacs-beta
diff lisp/prim/cmdloop.el @ 171:929b76928fce r20-3b12
Import from CVS: tag r20-3b12
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:47:52 +0200 |
parents | 15872534500d |
children | 8eaf7971accc |
line wrap: on
line diff
--- a/lisp/prim/cmdloop.el Mon Aug 13 09:47:00 2007 +0200 +++ b/lisp/prim/cmdloop.el Mon Aug 13 09:47:52 2007 +0200 @@ -164,53 +164,54 @@ ;;;; Object-oriented programming at its finest -(defun display-error (error-object stream) ;(defgeneric report-condition ...) - "Display `error-object' on `stream' in a user-friendly way." - (funcall (or (let ((type (car-safe error-object))) - (catch 'error - (and (consp error-object) - (symbolp type) - ;;(stringp (get type 'error-message)) - (consp (get type 'error-conditions)) - (let ((tail (cdr error-object))) - (while (not (null tail)) - (if (consp tail) - (setq tail (cdr tail)) - (throw 'error nil))) - t) - ;; (check-type condition condition) - (get type 'error-conditions) - ;; Search class hierarchy - (let ((tail (get type 'error-conditions))) - (while (not (null tail)) - (cond ((not (and (consp tail) - (symbolp (car tail)))) - (throw 'error nil)) - ((get (car tail) 'display-error) - (throw 'error (get (car tail) - 'display-error))) - (t - (setq tail (cdr tail))))) - ;; Default method - #'(lambda (error-object stream) - (let ((type (car error-object)) - (tail (cdr error-object)) - (first t) - (print-message-label 'error)) - (if (eq type 'error) - (progn (princ (car tail) stream) - (setq tail (cdr tail))) - (princ (or (gettext (get type 'error-message)) type) - stream)) - (while tail - (princ (if first ": " ", ") stream) - (prin1 (car tail) stream) - (setq tail (cdr tail) - first nil)))))))) - #'(lambda (error-object stream) - (princ (gettext "Peculiar error ") stream) - (prin1 error-object stream))) - error-object stream)) +;; Now in src/print.c; used by Ferror_message_string and others +;(defun display-error (error-object stream) ;(defgeneric report-condition ...) +; "Display `error-object' on `stream' in a user-friendly way." +; (funcall (or (let ((type (car-safe error-object))) +; (catch 'error +; (and (consp error-object) +; (symbolp type) +; ;;(stringp (get type 'error-message)) +; (consp (get type 'error-conditions)) +; (let ((tail (cdr error-object))) +; (while (not (null tail)) +; (if (consp tail) +; (setq tail (cdr tail)) +; (throw 'error nil))) +; t) +; ;; (check-type condition condition) +; (get type 'error-conditions) +; ;; Search class hierarchy +; (let ((tail (get type 'error-conditions))) +; (while (not (null tail)) +; (cond ((not (and (consp tail) +; (symbolp (car tail)))) +; (throw 'error nil)) +; ((get (car tail) 'display-error) +; (throw 'error (get (car tail) +; 'display-error))) +; (t +; (setq tail (cdr tail))))) +; ;; Default method +; #'(lambda (error-object stream) +; (let ((type (car error-object)) +; (tail (cdr error-object)) +; (first t) +; (print-message-label 'error)) +; (if (eq type 'error) +; (progn (princ (car tail) stream) +; (setq tail (cdr tail))) +; (princ (or (gettext (get type 'error-message)) type) +; stream)) +; (while tail +; (princ (if first ": " ", ") stream) +; (prin1 (car tail) stream) +; (setq tail (cdr tail) +; first nil)))))))) +; #'(lambda (error-object stream) +; (princ (gettext "Peculiar error ") stream) +; (prin1 error-object stream))) +; error-object stream)) (put 'file-error 'display-error #'(lambda (error-object stream)