@@ -585,58 +585,64 @@ Used by Eldev startup script."
585585 (condition-case-unless-debug error
586586 (condition-case error
587587 (eldev-output-reroute-messages
588- (let ((eldev-project-dir (or eldev-project-dir (expand-file-name default-directory)))
589- ; ; Eldev uses a different default.
590- (load-prefer-newer t ))
591- ; ; If `inhibit-message' is t when a signal is raised, Emacs won't
592- ; ; print error stacktraces even if `debug-on-error' is t. Add a
593- ; ; workaround.
594- (eldev-advised (#'debug :around (lambda (original &rest arguments )
595- (let ((inhibit-message nil ))
596- (apply original arguments))))
597- (eldev-parse-options command-line nil t t )
598- ; ; Since this is printed before `~/.eldev/config' is loaded it can
599- ; ; ignore some settings from that file, e.g. colorizing mode.
600- (eldev-trace " Started up on %s" (replace-regexp-in-string " +" " " (current-time-string )))
601- (eldev-trace " Running on %s" (emacs-version ))
602- (eldev-trace " Project directory: `%s' " eldev-project-dir)
603- (condition-case error
604- (eldev--set-up)
605- (eldev-too-old (setf eldev-too-old (cdr error ))))
606- (setf command-line (eldev-parse-options command-line nil t ))
607- (if command-line
608- (progn
609- (setf command (intern (car command-line)))
610- (let* ((real-command (or (cdr (assq command eldev--command-aliases)) command))
611- (handler (or (cdr (assq real-command eldev--commands)))))
612- (if handler
613- (let ((hook (eldev-get handler :command-hook )))
614- (when (and eldev-too-old (not (eldev-get handler :works-on-old-eldev )))
615- (signal 'eldev-too-old eldev-too-old))
616- (setf command-line (if (eldev-get handler :custom-parsing )
617- (cdr command-line)
618- (eldev-parse-options (cdr command-line) real-command)))
619- (if (eq real-command command)
620- (eldev-verbose " Executing command `%s' ..." command)
621- (eldev-verbose " Executing command `%s' (alias for `%s' )..." command real-command))
622- (when eldev-executing-command-hook
623- (eldev-trace " Executing `eldev-executing-command-hook' ..." )
624- (run-hook-with-args 'eldev-executing-command-hook real-command))
625- (when (symbol-value hook)
626- (eldev-trace " Executing `%s' ..." hook)
627- (run-hooks hook))
628- ; ; We want `message' output on stdout universally, but
629- ; ; older Emacses are very verbose and having additional
630- ; ; unexpected messages in our stdout would screw up
631- ; ; tests. So we set the target to stdout only now.
632- (let ((eldev-message-rerouting-destination :stdout ))
633- (apply handler command-line))
634- (setf exit-code 0 ))
635- (eldev-error " Unknown command `%s' " command)
636- (eldev-print " Run `%s help' for a list of supported commands" (eldev-shell-command t )))))
637- (eldev-usage)
638- (eldev-print " Run `%s help' for more information" (eldev-shell-command t ))
639- (setf exit-code 0 )))))
588+ (eldev-advised (#'display-warning :around (lambda (original type message &optional level &rest args )
589+ (let ((eldev-message-rerouting-wrapper (pcase level
590+ (:error #'eldev-error )
591+ (:debug #'eldev-verbose )
592+ (_ #'eldev-warn ))))
593+ (apply original type message level args))))
594+ (let ((eldev-project-dir (or eldev-project-dir (expand-file-name default-directory)))
595+ ; ; Eldev uses a different default.
596+ (load-prefer-newer t ))
597+ ; ; If `inhibit-message' is t when a signal is raised, Emacs won't
598+ ; ; print error stacktraces even if `debug-on-error' is t. Add a
599+ ; ; workaround.
600+ (eldev-advised (#'debug :around (lambda (original &rest arguments )
601+ (let ((inhibit-message nil ))
602+ (apply original arguments))))
603+ (eldev-parse-options command-line nil t t )
604+ ; ; Since this is printed before `~/.eldev/config' is loaded it can
605+ ; ; ignore some settings from that file, e.g. colorizing mode.
606+ (eldev-trace " Started up on %s" (replace-regexp-in-string " +" " " (current-time-string )))
607+ (eldev-trace " Running on %s" (emacs-version ))
608+ (eldev-trace " Project directory: `%s' " eldev-project-dir)
609+ (condition-case error
610+ (eldev--set-up)
611+ (eldev-too-old (setf eldev-too-old (cdr error ))))
612+ (setf command-line (eldev-parse-options command-line nil t ))
613+ (if command-line
614+ (progn
615+ (setf command (intern (car command-line)))
616+ (let* ((real-command (or (cdr (assq command eldev--command-aliases)) command))
617+ (handler (or (cdr (assq real-command eldev--commands)))))
618+ (if handler
619+ (let ((hook (eldev-get handler :command-hook )))
620+ (when (and eldev-too-old (not (eldev-get handler :works-on-old-eldev )))
621+ (signal 'eldev-too-old eldev-too-old))
622+ (setf command-line (if (eldev-get handler :custom-parsing )
623+ (cdr command-line)
624+ (eldev-parse-options (cdr command-line) real-command)))
625+ (if (eq real-command command)
626+ (eldev-verbose " Executing command `%s' ..." command)
627+ (eldev-verbose " Executing command `%s' (alias for `%s' )..." command real-command))
628+ (when eldev-executing-command-hook
629+ (eldev-trace " Executing `eldev-executing-command-hook' ..." )
630+ (run-hook-with-args 'eldev-executing-command-hook real-command))
631+ (when (symbol-value hook)
632+ (eldev-trace " Executing `%s' ..." hook)
633+ (run-hooks hook))
634+ ; ; We want `message' output on stdout universally, but
635+ ; ; older Emacses are very verbose and having additional
636+ ; ; unexpected messages in our stdout would screw up
637+ ; ; tests. So we set the target to stdout only now.
638+ (let ((eldev-message-rerouting-destination :stdout ))
639+ (apply handler command-line))
640+ (setf exit-code 0 ))
641+ (eldev-error " Unknown command `%s' " command)
642+ (eldev-print " Run `%s help' for a list of supported commands" (eldev-shell-command t )))))
643+ (eldev-usage)
644+ (eldev-print " Run `%s help' for more information" (eldev-shell-command t ))
645+ (setf exit-code 0 ))))))
640646 (eldev-error (let* ((arguments (cdr error ))
641647 hint
642648 hint-about-command)
0 commit comments