+2013-09-10 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * subr.el (with-demoted-errors): Add `format' argument.
+
2013-09-10 Michael Albinus <michael.albinus@gmx.de>
* net/tramp.el (tramp-cleanup): Remove. Functionality added to
* net/tramp-adb.el (tramp-adb-maybe-open-connection):
* net/tramp-sh.el (tramp-open-connection-setup-interactive-shell)
(tramp-maybe-open-connection):
- * net/tramp-smb.el (tramp-smb-maybe-open-connection): Use
- `tramp-cleanup-connection'.
+ * net/tramp-smb.el (tramp-smb-maybe-open-connection):
+ Use `tramp-cleanup-connection'.
- * net/tramp-sh.el (tramp-maybe-open-connection): Catch
- 'uname-changed inside the progress reporter.
+ * net/tramp-sh.el (tramp-maybe-open-connection):
+ Catch 'uname-changed inside the progress reporter.
2013-09-10 Glenn Morris <rgm@gnu.org>
* net/tramp.el (tramp-find-method, tramp-find-user): Call `propertize'
only if it is bound. It isn't for XEmacs.
- (with-tramp-progress-reporter): Do not let-bind `result'. This
- yields to scoping errors in XEmacs.
+ (with-tramp-progress-reporter): Do not let-bind `result'.
+ This yields to scoping errors in XEmacs.
(tramp-handle-make-auto-save-file-name): New function, moved from
tramp-sh.el.
* net/tramp-adb.el (tramp-adb-file-name-handler-alist): Add handler
for `make-auto-save-file-name'.
- (tramp-adb--gnu-switches-to-ash): Use
- `tramp-compat-replace-regexp-in-string'.
+ (tramp-adb--gnu-switches-to-ash):
+ Use `tramp-compat-replace-regexp-in-string'.
* net/tramp-cache.el (tramp-cache-print): Call
`substring-no-properties' only if it is bound. It isn't for XEmacs.
* net/tramp-cmds.el (tramp-bug): Call `propertize' only if it is
bound. It isn't for XEmacs.
- * net/tramp-compat.el (tramp-compat-copy-file): Catch
- `wrong-number-of-arguments' error.
+ * net/tramp-compat.el (tramp-compat-copy-file):
+ Catch `wrong-number-of-arguments' error.
(tramp-compat-replace-regexp-in-string): New defun.
* net/tramp-gvfs.el (tramp-gvfs-file-name-handler-alist): Add handler
(tramp-gvfs-file-name): Use `tramp-compat-replace-regexp-in-string'.
(tramp-synce-list-devices): Use `push' instead of `pushnew'.
- * net/tramp-gw.el (tramp-gw-open-network-stream): Use
- `tramp-compat-replace-regexp-in-string'.
+ * net/tramp-gw.el (tramp-gw-open-network-stream):
+ Use `tramp-compat-replace-regexp-in-string'.
- * net/tramp-sh.el (tramp-sh-file-name-handler-alist): Call
- `tramp-handle-make-auto-save-file-name'.
+ * net/tramp-sh.el (tramp-sh-file-name-handler-alist):
+ Call `tramp-handle-make-auto-save-file-name'.
(tramp-sh-handle-make-auto-save-file-name): Move to tramp.el.
(tramp-sh-file-gvfs-monitor-dir-process-filter)
- (tramp-sh-file-inotifywait-process-filter): Use
- `tramp-compat-replace-regexp-in-string'.
+ (tramp-sh-file-inotifywait-process-filter):
+ Use `tramp-compat-replace-regexp-in-string'.
(tramp-compute-multi-hops): Use `push' instead of `pushnew'.
* net/tramp-smb.el (tramp-smb-file-name-handler-alist): Add handler
for `make-auto-save-file-name'.
- (tramp-smb-handle-copy-directory): Call
- `tramp-compat-replace-regexp-in-string'.
+ (tramp-smb-handle-copy-directory):
+ Call `tramp-compat-replace-regexp-in-string'.
(tramp-smb-get-file-entries): Use `push' instead of `pushnew'.
(tramp-smb-handle-copy-file): Improve error message.
(tramp-smb-handle-rename-file): Rename directly only in case
* progmodes/cc-langs.el (c-type-decl-suffix-key): Now matches ")"
in Java Mode.
(c-recognize-typeless-decls): Set the Java value to t.
- * progmodes/cc-engine.el (c-forward-decl-or-cast-1): While
- handling a "(", add a check for, effectively, Java, and handle a
+ * progmodes/cc-engine.el (c-forward-decl-or-cast-1):
+ While handling a "(", add a check for, effectively, Java, and handle a
"typeless" declaration there.
2013-09-07 Roland Winkler <winkler@gnu.org>
(define-obsolete-function-alias 'condition-case-no-debug
'condition-case-unless-debug "24.1")
-(defmacro with-demoted-errors (&rest body)
+(defmacro with-demoted-errors (format &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")))
+but which should be robust in the unexpected case that an error is signaled.
+For backward compatibility, if FORMAT is not a constant string, it
+is assumed to be part of BODY, in which case the message format
+used is \"Error: %S\"."
+ (declare (debug t) (indent 1))
+ (let ((err (make-symbol "err"))
+ (format (if (and (stringp format) body) format
+ (prog1 "Error: %S"
+ (if format (push format body))))))
`(condition-case-unless-debug ,err
- (progn ,@body)
- (error (message "Error: %S" ,err) nil))))
+ ,(macroexp-progn body)
+ (error (message ,format ,err) nil))))
(defmacro combine-after-change-calls (&rest body)
"Execute BODY, but don't call the after-change functions till the end.