Subject: Re: bug#17272: 24.4.50; obsolete messages hides warning on startup

From: Juri Linkov <[email-masked]>
Date: Thu, 07 Nov 2019 00:22:04 +0200

> If you start emacs with the following loaded file (emacs -Q -l .emacs.test)
>
> ;;; .emacs.test
> (require 'longlines)
> (desktop-save-mode 1)
> (desktop-read "/home/robert") ;; $HOME....
>
> When it starts you see the message
>
>      Package longlines is obsolete!
>
> But - if the .emacs.desktop is locked the message:
>
>     Warning: desktop file appears to be in use by PID 6464.
>     Using it may cause conflicts.  Use it anyway? (y or n) 
>
> is hiding 'behind' the obsolete message and you don't see it until you
> press a key - the emacs startup appears to have stopped but there's no
> visual clue as to what it is waiting for. 

Here is the patch that fixes this (required changes from bug#38076):

diff --git a/lisp/subr.el b/lisp/subr.el
index 03cf3da278..33464d6032 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -4517,7 +4556,9 @@ do-after-load-evaluation
 	      (byte-compile-warn "%s" msg))
 	  (run-with-timer 0 nil
 			  (lambda (msg)
-			    (message "%s" msg))
+                            (if (minibufferp)
+                                (minibuffer-message "%s" msg)
+                              (message "%s" msg)))
                           msg)))))
 
   ;; Finally, run any other hook.