Subject: bug#42777: 28.0.50; Obsolete eldoc-message function used in CEDET

From: João Távora <[email-masked]>
Date: Sun, 30 Aug 2020 15:23:13 +0100

Lars Ingebrigtsen <[email-masked]> writes:

>> This is odd because I did get a line from Eli to fix some compilation 
>> after my changes, and these were not among them.  I wonder if this file
>> is always byte-compiled.
>
> It is, but perhaps Eli didn't do a "make bootstrap" to get all the
> warnings.  (The CEDET files don't change that much these days, so
> they're rarely re-compiled.)

Anyway, I just had a look at this.  This isn't the normal situation of
an ElDoc user switching from the old "call eldoc-message directly"
protocol to the new callback-based protocol.

Rather, idle.el is mostly a reimplementation of ElDoc itself which uses
a substantial amount of ElDoc internals -- and repeats much of its code.
It is, in my opinion a file to be itself obsoleted.  Anyway, the
solution with less risk here is to use with-supressed-warnings, which is
what the attached patch does.

João

>From 2d951fbe6d5af21c839e2ff7ab89aeabff945621 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jo=C3=A3o=20T=C3=A1vora?= <[email-masked]>
Date: Sun, 30 Aug 2020 15:19:08 +0100
Subject: [PATCH] Suppress ElDoc compiler warnings in
 lisp/cedet/semantic/idle.el

Fixes: bug#42777

* lisp/cedet/semantic/idle.el (semantic-idle-summary-refresh-echo-area)
(semantic-idle-summary-idle-function): Use `with-supressed-warnings`.
---
 lisp/cedet/semantic/idle.el | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lisp/cedet/semantic/idle.el b/lisp/cedet/semantic/idle.el
index 76218249c5..8f58f53b14 100644
--- a/lisp/cedet/semantic/idle.el
+++ b/lisp/cedet/semantic/idle.el
@@ -768,7 +768,10 @@ semantic-idle-summary-idle-function
 	    (when (> strlen ea-width)
 	      (setq str (substring str 0 ea-width)))))
 	;; Display it
-        (eldoc-message str))))
+        ;; FIXME: stop using ElDoc's internals and just use ElDoc.
+        (with-suppressed-warnings
+            ((obsolete eldoc-message))
+          (eldoc-message str)))))
 
 (define-minor-mode semantic-idle-summary-mode
   "Toggle Semantic Idle Summary mode.
@@ -799,7 +802,10 @@ semantic-idle-summary-refresh-echo-area
 		(not (and (boundp 'edebug-active) edebug-active))
 		(not cursor-in-echo-area)
 		(not (eq (selected-window) (minibuffer-window))))
-           (eldoc-message eldoc-last-message)
+           ;; FIXME: stop using ElDoc's internals and just use ElDoc.
+           (with-suppressed-warnings
+               ((obsolete eldoc-message))
+             (eldoc-message eldoc-last-message))
          (setq eldoc-last-message nil))))
 
 (semantic-add-minor-mode 'semantic-idle-summary-mode "")
-- 
2.25.1