X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fdgnushack.el;h=3defe55299764386361355affd0f74552e335fd8;hb=5beb390633ce1e32cdf319c6ba19926244bbfdf2;hp=e3110d7373171418a1f5ba78201adac51aba80dc;hpb=fbfc2ce2eb761dec0a5a8206ca49d39e533fd80d;p=gnus diff --git a/lisp/dgnushack.el b/lisp/dgnushack.el index e3110d737..3defe5529 100644 --- a/lisp/dgnushack.el +++ b/lisp/dgnushack.el @@ -1,5 +1,5 @@ ;;; dgnushack.el --- a hack to set the load path for byte-compiling -;; Copyright (C) 1994-2011 Free Software Foundation, Inc. +;; Copyright (C) 1994-2012 Free Software Foundation, Inc. ;; Author: Lars Magne Ingebrigtsen ;; Version: 4.19 @@ -150,7 +150,8 @@ (unless (fboundp 'url-retrieve-synchronously) (defalias 'url-retrieve-synchronously 'url-retrieve)) (unless (fboundp 'url-queue-retrieve) - (defun url-queue-retrieve (url callback &optional cbargs silent) + (defun url-queue-retrieve (url callback &optional cbargs silent + inhibit-cookies) (url-retrieve url callback cbargs))) (autoload 'Info-directory "info" nil t) (autoload 'Info-index "info" nil t) @@ -549,4 +550,16 @@ or remove them using `make remove-installed-shadows'.\n\n")))))))) (error (princ "failed\n"))))) (setq path (cdr path)))))) +(unless (fboundp 'with-demoted-errors) + (defmacro with-demoted-errors (&rest body) + "Run BODY and demote any errors to simple messages. +If `debug-on-error' is non-nil, run BODY without catching its errors. +This is to be used around code which is not expected to signal an error +but which should be robust in the unexpected case that an error is signaled." + (declare (debug t) (indent 0)) + (let ((err (make-symbol "err"))) + `(condition-case ,err + (progn ,@body) + (error (message "Error: %S" ,err) nil))))) + ;;; dgnushack.el ends here