From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.help Subject: Re: Undo defalias Date: Fri, 03 Mar 2023 16:01:17 +0000 Message-ID: <7c6ec4cae3d516e8a406@heytings.org> References: <878rgioa5f.fsf@telefonica.net> <7c6ec4cae36f1fba2e3b@heytings.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16138"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 03 17:01:44 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pY7qq-0003vb-Mk for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 03 Mar 2023 17:01:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pY7qW-0002Qh-VX; Fri, 03 Mar 2023 11:01:24 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pY7qU-0002HW-Bq for help-gnu-emacs@gnu.org; Fri, 03 Mar 2023 11:01:22 -0500 Original-Received: from heytings.org ([95.142.160.155]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pY7qS-0004Mq-Nv for help-gnu-emacs@gnu.org; Fri, 03 Mar 2023 11:01:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1677859278; bh=uQuIREijvoXhV7U+PabRfpGzT2TQOLh4vFgwK2k7U34=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=0sR1nMQZT+RuNWR9EgpvKCRuKsIUqxWgGBLzE8h2gJf10ZQCVTTudVFhZ7QgCrlx6 nW+KBKffxT3ynPXi56/6jRVGrpfnF2IXcx26Wb0sJS1PFvjSjrvTS1hmrJYGkUKLcg hUYTbVV31+H+4S3PYMlOgXbI0/geST1OAVG7ijTTJ3aJ4N19sg+rTs7srLYnHVZvzN x3XkpAsOwUW7NUwyAbZjcB/PRZxgAuO+XMjFu8PVS1gAbHE6hEmqBvMWPDiQfWtg+m O58VUlLKzd7kbBC0B7I6M57Jdl3yyJM4fItFHIYewS8dkFiXmQXTV7AezGV0JUtguW Vw+wpNO9TB8sg== In-Reply-To: Received-SPF: pass client-ip=95.142.160.155; envelope-from=gregory@heytings.org; helo=heytings.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:142915 Archived-At: > > The POC you posted works only if `message` was redefined in some > particular way, such as when a loading a file that has > > (defalias 'message #'ignore) > > but then it wouldn't be the result of a bug but of deliberate harm :-) > My understanding is that this is what the OP did, and he wanted to "undo" what he did. With a Lisp function you can always open the source file again and C-M-x, but with a C function that's not possible. > > AFAIK most cases where `message` can end up aliased to `ignore` is when > you have code doing > > (cl-letf (((symbol-function 'message) #'ignore)) > ...) > > In that case, the previous value won't be found in `function-history`. > As for why is the `ignore` rebinding is still active... > But in that case the meaning of message is restored when the cl-letf is left, no? Am I missing something?