- (condition-case error
- (funcall function prefix string)
- (error
- (if riece-debug
- (message "Error in `%S': %S" function error)))))
- (condition-case error
- (run-hook-with-args-until-success after-hook prefix string)
- (error
- (if riece-debug
- (message "Error in `%S': %S" after-hook error)))))))
+ (riece-funcall-ignore-errors (symbol-name function)
+ function prefix string))
+ (riece-funcall-ignore-errors (symbol-name after-hook)
+ #'run-hook-with-args-until-success
+ after-hook prefix string))))
+
+(defsubst riece-chomp-string (string)
+ (if (string-match "\r\\'" string)
+ (substring string 0 (match-beginning 0))
+ string))