From unknown Sat Jun 14 19:33:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39274: Warn when using obsolete command interactively Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 24 Jan 2020 23:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39274 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 39274@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs Received: via spool by submit@debbugs.gnu.org id=B.1579908380822 (code B ref -1); Fri, 24 Jan 2020 23:27:02 +0000 Received: (at submit) by debbugs.gnu.org; 24 Jan 2020 23:26:20 +0000 Received: from localhost ([127.0.0.1]:54858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iv8LE-0000DB-B9 for submit@debbugs.gnu.org; Fri, 24 Jan 2020 18:26:20 -0500 Received: from lists.gnu.org ([209.51.188.17]:42505) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iv8LC-0000D3-Oe for submit@debbugs.gnu.org; Fri, 24 Jan 2020 18:26:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40862) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv8Kt-0005YO-Fl for bug-gnu-emacs@gnu.org; Fri, 24 Jan 2020 18:26:18 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, TIME_LIMIT_EXCEEDED, URIBL_BLOCKED autolearn=unavailable version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv8Ka-0004RR-O4 for bug-gnu-emacs@gnu.org; Fri, 24 Jan 2020 18:25:59 -0500 Received: from ted.gofardesign.uk ([67.225.143.91]:37366) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iv8KZ-0004P8-0p for bug-gnu-emacs@gnu.org; Fri, 24 Jan 2020 18:25:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=hffZds53HQow6XapkHa7MejEnKL+xhPLwQqYd4glbVI=; b=cWo7LQ2lRA0UJAyoY87PfgkcvV phgHe+XtFPpfYHrSnhERFyWvHi0UtartV+ZRxdZ5U4xKkhwucyVRakFjg7ZlC6bLf7yUZBAoRecJH i303DrZs5MkCcYunA2ne/Bv8saZqsZP6eB1z/QtsHbnbVGO2SNeOUcRG3jA+Yghy3LeeOZqFS8ZqU Nv2kQVZ/NgNY2uSn8Uy0dJsd9XwawNRpaalt4m9rRHCU5F7yFNjeMvsnbT4aYfOJdFIJPBxGnNOoB 6dXjkW1Oy6LanSkiCgvWYmcBI/jgL27Jwq8CuE6mJUgoJXzjdYSVuI0eLCXCFspFznAi6ON7gLZ8O X0dypTkQ==; Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:49708 helo=localhost) by ted.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1iv8KX-000a20-Mz for bug-gnu-emacs@gnu.org; Fri, 24 Jan 2020 18:25:38 -0500 From: Stefan Kangas Date: Sat, 25 Jan 2020 00:25:35 +0100 Message-ID: <878slw8mj4.fsf@marxist.se> MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ted.gofardesign.uk X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: ted.gofardesign.uk: stefan@marxist.se X-Source: X-Source-Args: X-Source-Dir: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 67.225.143.91 X-Spam-Score: 0.3 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Severity: wishlist When I run an obsolete command interactively, e.g. `M-x eshell-report-bug', there is no indication that this is an obsolete command which will be removed in a future version of Emacs. It's good that there is a warning from the byte-compiler, but it doesn't help with commands that are normally only used interactively. This leads to a situation where users can happily be using these commands, and when upgrading find that they no longer exist. They also don't know what to use instead without researching online. Please add a warning along these lines: (message "The `%s' command is obsolete since version %s, use `%s' instead" obsolete-name version current-name) Best regards, Stefan Kangas From unknown Sat Jun 14 19:33:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39274: Warn when using obsolete command interactively Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Jan 2020 07:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39274 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Kangas Cc: 39274@debbugs.gnu.org Received: via spool by 39274-submit@debbugs.gnu.org id=B39274.157993842121467 (code B ref 39274); Sat, 25 Jan 2020 07:47:02 +0000 Received: (at 39274) by debbugs.gnu.org; 25 Jan 2020 07:47:01 +0000 Received: from localhost ([127.0.0.1]:54938 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ivG9l-0005aB-ER for submit@debbugs.gnu.org; Sat, 25 Jan 2020 02:47:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50053) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ivG9i-0005Zx-EG for 39274@debbugs.gnu.org; Sat, 25 Jan 2020 02:47:00 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53502) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ivG9d-00077q-06; Sat, 25 Jan 2020 02:46:53 -0500 Received: from [176.228.60.248] (port=1550 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ivG9b-0007o8-JR; Sat, 25 Jan 2020 02:46:52 -0500 Date: Sat, 25 Jan 2020 09:46:38 +0200 Message-Id: <837e1gq8pt.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <878slw8mj4.fsf@marxist.se> (message from Stefan Kangas on Sat, 25 Jan 2020 00:25:35 +0100) References: <878slw8mj4.fsf@marxist.se> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Stefan Kangas > Date: Sat, 25 Jan 2020 00:25:35 +0100 > > Please add a warning along these lines: > > (message "The `%s' command is obsolete since version %s, use `%s' instead" > obsolete-name version current-name) Where and when will this warning be displayed? From unknown Sat Jun 14 19:33:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39274: Warn when using obsolete command interactively Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Jan 2020 19:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39274 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 39274@debbugs.gnu.org Received: via spool by 39274-submit@debbugs.gnu.org id=B39274.157997989110242 (code B ref 39274); Sat, 25 Jan 2020 19:19:02 +0000 Received: (at 39274) by debbugs.gnu.org; 25 Jan 2020 19:18:11 +0000 Received: from localhost ([127.0.0.1]:56332 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ivQwd-0002f7-Ft for submit@debbugs.gnu.org; Sat, 25 Jan 2020 14:18:11 -0500 Received: from ted.gofardesign.uk ([67.225.143.91]:53640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ivQwb-0002eu-Ty for 39274@debbugs.gnu.org; Sat, 25 Jan 2020 14:18:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=AvHpGCnIcBHotD72Hk+k/H1z8I2qJfqskhpcPCMioy0=; b=tHTolmuVMUpIZpLMhPJ4bM3T8l C3EJHhiuyGE6v8+f1/oQxqgUOilEDVg9zNNIGUECfCP6rQ6nFlEXvFAjGCj8XtapqZJ+NCnr9ckVr 7KtYP1cdMTBJNNBXK1fI2mcLIZxzbaTwIZz/JNHCctJwj6rvsmZ/QVUkPbrroz1qORqfrMtGXhu5T 5FtaOnBBMBJsvyeViHfUymo7jYs4sP+k8CVtgNYIa2twxNH6I7c+V1pSTDrdJD2Q7kViQJi+pekoD SK1b9jMUL2Cb5eo/eyjb/wcE/ohaJXQKZcso3oD38F+V9XNVGDqm/OSYL6+1GZ+z5Ky7SFUoUKiZ/ aOLhYS6w==; Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:45546 helo=localhost) by ted.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1ivQwW-0016UT-5Z; Sat, 25 Jan 2020 14:18:04 -0500 From: Stefan Kangas In-Reply-To: <837e1gq8pt.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 25 Jan 2020 09:46:38 +0200") References: <878slw8mj4.fsf@marxist.se> <837e1gq8pt.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Sat, 25 Jan 2020 20:18:01 +0100 Message-ID: <87sgk38hw6.fsf@marxist.se> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ted.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: ted.gofardesign.uk: stefan@marxist.se X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: >> Please add a warning along these lines: >> >> (message "The `%s' command is obsolete since version %s, use `%s' instead" >> obsolete-name version current-name) > > Where and when will this warning be displayed? I was thinking of something along the lines of the below patch. Best regards, Stefan Kangas --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=obsolete.diff diff --git a/lisp/simple.el b/lisp/simple.el index 8be27745b1..12a413ec0e 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1914,6 +1914,12 @@ execute-extended-command (while-no-input (setq binding (execute-extended-command--shorter (symbol-name function) typed)))) + (when-let (obsolete (with-temp-buffer + (when (help-fns--obsolete 'foo) + (buffer-string) + (goto-char (point-max)) + (delete-indentation 2)))) + (message obsolete)) (when binding (with-temp-message (format-message "You can run the command `%s' with %s" --=-=-=-- From unknown Sat Jun 14 19:33:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39274: Warn when using obsolete command interactively Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Jan 2020 19:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39274 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 39274@debbugs.gnu.org Received: via spool by 39274-submit@debbugs.gnu.org id=B39274.157998018110669 (code B ref 39274); Sat, 25 Jan 2020 19:23:02 +0000 Received: (at 39274) by debbugs.gnu.org; 25 Jan 2020 19:23:01 +0000 Received: from localhost ([127.0.0.1]:56336 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ivR1J-0002m1-3F for submit@debbugs.gnu.org; Sat, 25 Jan 2020 14:23:01 -0500 Received: from ted.gofardesign.uk ([67.225.143.91]:54026) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ivR1H-0002ln-Nv for 39274@debbugs.gnu.org; Sat, 25 Jan 2020 14:23:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=LHXJupoVdsmK/mcIQ4jXE/c/pKNdvYqkvNCxKZIPQPM=; b=BIEPXSlVx7s8tBY7CHKKn7F1C0 xrgq3FcR/TnkoXB7nAlkf8/Mv94EM61F7S+4KpK9u8BucLQBpf+DcpBaeasYfJ7tDOxwLWkLLKltT IQ6VYPjQ9v1FUCNyrzXNpdEQ084RxLpv+/wlsJZ2nX2bpAiG58fY+5/YV3zq6eAJ9pbeLGbl1nNlk 2TrStu0SX1ksBzhQ3zAMhr6ENMLwOCs0lcIoKcFwL+DZ/K7DiDInuM1SQ7IkA3zArh1WcsZj9EOSP /VCTrb7OrHqfYNIMc8S5YsxsQ0J+XVyBsQIofob7s+rwFOOWVfDNSkJqvACtYJmDDrZLwi1d+NZRJ ly/XfUfA==; Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:48812 helo=localhost) by ted.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1ivR1C-0017VV-6y; Sat, 25 Jan 2020 14:22:54 -0500 From: Stefan Kangas In-Reply-To: <87sgk38hw6.fsf@marxist.se> (Stefan Kangas's message of "Sat, 25 Jan 2020 20:18:01 +0100") References: <878slw8mj4.fsf@marxist.se> <837e1gq8pt.fsf@gnu.org> <87sgk38hw6.fsf@marxist.se> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Sat, 25 Jan 2020 20:22:52 +0100 Message-ID: <87pnf78ho3.fsf@marxist.se> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ted.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: ted.gofardesign.uk: stefan@marxist.se X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Stefan Kangas writes: >>> Please add a warning along these lines: >>> >>> (message "The `%s' command is obsolete since version %s, use `%s' instead" >>> obsolete-name version current-name) >> >> Where and when will this warning be displayed? > > I was thinking of something along the lines of the below patch. Sorry, that had a typo. See attached instead. Best regards, Stefan Kangas --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=obsolete2.diff diff --git a/lisp/simple.el b/lisp/simple.el index 8be27745b1..f1f0da1fed 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1914,6 +1914,12 @@ execute-extended-command (while-no-input (setq binding (execute-extended-command--shorter (symbol-name function) typed)))) + (when-let (obsolete (with-temp-buffer + (when (help-fns--obsolete function) + (buffer-string) + (goto-char (point-max)) + (delete-indentation 2)))) + (message obsolete)) (when binding (with-temp-message (format-message "You can run the command `%s' with %s" --=-=-=-- From unknown Sat Jun 14 19:33:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39274: Warn when using obsolete command interactively Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Jan 2020 20:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39274 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Stefan Kangas Cc: 39274@debbugs.gnu.org Received: via spool by 39274-submit@debbugs.gnu.org id=B39274.157998329315480 (code B ref 39274); Sat, 25 Jan 2020 20:15:02 +0000 Received: (at 39274) by debbugs.gnu.org; 25 Jan 2020 20:14:53 +0000 Received: from localhost ([127.0.0.1]:56357 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ivRpV-00041c-1O for submit@debbugs.gnu.org; Sat, 25 Jan 2020 15:14:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42495) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ivRpT-00041N-NT for 39274@debbugs.gnu.org; Sat, 25 Jan 2020 15:14:52 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ivRpO-00048N-CQ; Sat, 25 Jan 2020 15:14:46 -0500 Received: from [176.228.60.248] (port=2139 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ivRpM-0007oQ-HG; Sat, 25 Jan 2020 15:14:45 -0500 Date: Sat, 25 Jan 2020 22:14:31 +0200 Message-Id: <83eevnpa3c.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87pnf78ho3.fsf@marxist.se> (message from Stefan Kangas on Sat, 25 Jan 2020 20:22:52 +0100) References: <878slw8mj4.fsf@marxist.se> <837e1gq8pt.fsf@gnu.org> <87sgk38hw6.fsf@marxist.se> <87pnf78ho3.fsf@marxist.se> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > From: Stefan Kangas > Cc: 39274@debbugs.gnu.org > Date: Sat, 25 Jan 2020 20:22:52 +0100 > > >>> (message "The `%s' command is obsolete since version %s, use `%s' instead" > >>> obsolete-name version current-name) > >> > >> Where and when will this warning be displayed? > > > > I was thinking of something along the lines of the below patch. So for obsolete commands we will now display 2 messages, one after the other? From unknown Sat Jun 14 19:33:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39274: Warn when using obsolete command interactively Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Jan 2020 20:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39274 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 39274@debbugs.gnu.org Received: via spool by 39274-submit@debbugs.gnu.org id=B39274.157998425617003 (code B ref 39274); Sat, 25 Jan 2020 20:31:01 +0000 Received: (at 39274) by debbugs.gnu.org; 25 Jan 2020 20:30:56 +0000 Received: from localhost ([127.0.0.1]:56361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ivS52-0004QB-HS for submit@debbugs.gnu.org; Sat, 25 Jan 2020 15:30:56 -0500 Received: from ted.gofardesign.uk ([67.225.143.91]:58792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ivS50-0004Px-7g for 39274@debbugs.gnu.org; Sat, 25 Jan 2020 15:30:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=shoZXH/+izS5YseQffP6Fs9WZ6lCRREVUN0iYp4T/Ko=; b=eHg9ez+y5IUVZ+1/MD0auU7kMI 0Vtu/hbNRBSRns0rVvsYCJe8bVDvZoZgrmepwbIf4POgK/NSaPMayMoC9qSrrhjyzLQn63ROPj19e c0xEdKS/sglbq/4tDLnOQyTMM8B1oolP3TXFPPWuZ7byXCk870hsxbBX6517V4aK6Ora1YRTUcbk0 v9Ev/aZxGOyurJyssirnGeqC+VFxNfYJ9EFFWrwMY8tPQUWnCjANkfeYOUgpgaH+USEtZYjrMbvSj 3EKhHHxpBVtWbrUacH3fsEeVHOMORaW31A4zryfJjBfwK5IqYD6X6/ldxsE84wzMNsCMpt5TH9tF9 qM4F+6lA==; Received: from h-70-69.a785.priv.bahnhof.se ([155.4.70.69]:34584 helo=localhost) by ted.gofardesign.uk with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1ivS4t-001M5y-KW; Sat, 25 Jan 2020 15:30:47 -0500 From: Stefan Kangas In-Reply-To: <83eevnpa3c.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 25 Jan 2020 22:14:31 +0200") References: <878slw8mj4.fsf@marxist.se> <837e1gq8pt.fsf@gnu.org> <87sgk38hw6.fsf@marxist.se> <87pnf78ho3.fsf@marxist.se> <83eevnpa3c.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Date: Sat, 25 Jan 2020 21:30:45 +0100 Message-ID: <87muab8eiy.fsf@marxist.se> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ted.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: ted.gofardesign.uk: stefan@marxist.se X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > So for obsolete commands we will now display 2 messages, one after the > other? We could display only one or the other, like in the attached patch. Now that you mention it, that probably would make more sense. Best regards, Stefan Kangas --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=obsolete3.diff diff --git a/lisp/simple.el b/lisp/simple.el index 8be27745b1..f04bae2e90 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -1914,16 +1914,23 @@ execute-extended-command (while-no-input (setq binding (execute-extended-command--shorter (symbol-name function) typed)))) - (when binding - (with-temp-message - (format-message "You can run the command `%s' with %s" - function - (if (stringp binding) - (concat "M-x " binding " RET") - (key-description binding))) - (sit-for (if (numberp suggest-key-bindings) - suggest-key-bindings - 2)))))))) + (require 'help-fns) + (if-let ((obsolete (with-temp-buffer + (when (help-fns--obsolete function) + (buffer-string) + (goto-char (point-max)) + (delete-indentation 2))))) + (message obsolete) + (when binding + (with-temp-message + (format-message "You can run the command `%s' with %s" + function + (if (stringp binding) + (concat "M-x " binding " RET") + (key-description binding))) + (sit-for (if (numberp suggest-key-bindings) + suggest-key-bindings + 2))))))))) (defun command-execute (cmd &optional record-flag keys special) ;; BEWARE: Called directly from the C code. --=-=-=-- From unknown Sat Jun 14 19:33:28 2025 X-Loop: help-debbugs@gnu.org Subject: bug#39274: Warn when using obsolete command interactively Resent-From: Stefan Kangas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 01 Mar 2020 01:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39274 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Eli Zaretskii Cc: 39274@debbugs.gnu.org Received: via spool by 39274-submit@debbugs.gnu.org id=B39274.158302450926085 (code B ref 39274); Sun, 01 Mar 2020 01:02:01 +0000 Received: (at 39274) by debbugs.gnu.org; 1 Mar 2020 01:01:49 +0000 Received: from localhost ([127.0.0.1]:35605 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8CzN-0006me-Ec for submit@debbugs.gnu.org; Sat, 29 Feb 2020 20:01:49 -0500 Received: from ted.gofardesign.uk ([67.225.143.91]:34126) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j8CzL-0006mP-L7; Sat, 29 Feb 2020 20:01:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=marxist.se; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=jUby0DHrDkgBMoWJCPBBu5N7nlsVemtj0KUA2UvoKLk=; b=VUP1i8+9vB0YxK9JPATQO9ZKFZ bYcp3iF/A2/ph4Tb/640xbWQuaW7++xKl75sKdPjhGJPwRtoEwXM8cOu+3pM2V21dxbwmDkFjUpOv rw+6HWvb4g8UCt56x0GWkqAZR4EB0m+NRmhihASfMsIeUrKme4ztGfhyzpJk3eWCw4PKrAzDJic4M Qs2g4H6zNbddExAVZGQo7exKLu53kroFPpd2XCMe4JOHrvft9aAue9rnRVrQlKUV6UDK8mEMe15dH 8siG4c6NhZTgxmoF2Mq1Sh4mAFx+++Lnwa2a6WYIXu0w3h6Jn373r4rh41pwFx7kvMJnsOyI+b5n8 bDPmKuFw==; Received: from h-4-70-69.a785.priv.bahnhof.se ([155.4.70.69]:50020 helo=localhost) by ted.gofardesign.uk with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1j8CzE-001sDy-9x; Sat, 29 Feb 2020 20:01:40 -0500 From: Stefan Kangas In-Reply-To: <87muab8eiy.fsf@marxist.se> (Stefan Kangas's message of "Sat, 25 Jan 2020 21:30:45 +0100") References: <878slw8mj4.fsf@marxist.se> <837e1gq8pt.fsf@gnu.org> <87sgk38hw6.fsf@marxist.se> <87pnf78ho3.fsf@marxist.se> <83eevnpa3c.fsf@gnu.org> <87muab8eiy.fsf@marxist.se> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Date: Sun, 01 Mar 2020 02:01:38 +0100 Message-ID: <87eeuc6g7h.fsf@stefankangas.se> MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - ted.gofardesign.uk X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - marxist.se X-Get-Message-Sender-Via: ted.gofardesign.uk: authenticated_id: stefan@marxist.se X-Authenticated-Sender: ted.gofardesign.uk: stefan@marxist.se X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 39274 + wontfix notabug close 39274 thanks Stefan Kangas writes: > Eli Zaretskii writes: > >> So for obsolete commands we will now display 2 messages, one after the >> other? > > We could display only one or the other, like in the attached patch. > Now that you mention it, that probably would make more sense. After further testing, it turns out that this is not a good idea, since it runs a too high risk of obscuring other messages. I'm therefore closing this bug. Sorry about the noise, and thanks for the feedback. Best regards, Stefan Kangas