From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Distinguish between regional undo and undo to the beginning in undo-equiv-table Date: Fri, 05 Mar 2021 10:57:16 -0500 Message-ID: References: <195AF8D0-1BFD-419D-88A1-69EA1FEED4D6@gmail.com> <60DCC8C7-CCA4-4113-88BE-B81A395C494D@gmail.com> <4890CDDF-E0DD-464B-9268-AD404015129D@gmail.com> <06A32454-8DB2-492C-9A69-A825AD5B66A2@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34351"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel To: Yuan Fu Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Mar 05 17:01:46 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lICte-0008qA-9W for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Mar 2021 17:01:46 +0100 Original-Received: from localhost ([::1]:47208 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lICtd-00031j-9S for ged-emacs-devel@m.gmane-mx.org; Fri, 05 Mar 2021 11:01:45 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41210) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lICpT-00060y-Kf for emacs-devel@gnu.org; Fri, 05 Mar 2021 10:57:27 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:9479) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lICpO-0004BG-2t for emacs-devel@gnu.org; Fri, 05 Mar 2021 10:57:25 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 44FF7100250; Fri, 5 Mar 2021 10:57:20 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 1A407100225; Fri, 5 Mar 2021 10:57:18 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1614959838; bh=LoqQxeptDWm9UzJbtEcOgYKEZloZhYCVosSCbtYH0Hw=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=l7Tn34LWImqmFqP2F/drQG3dm0X45EGd5ni3QCrFUj7+QOldI9rPyixgiZk5lfNQr Fqdgb1H21P449RCjymCBStssGWppf248zEAEY6jWsVFWYRPa5gZyVuiHpRlynuZKzA 9LGl2RCmoKAnFoClxhpVXcbVlqFUWREgNsn5gA2u/4HSnRv7L8lXSneGjFUZhGWsTn /teLFpnvEwSaHcr3vJqg2MMwTLwCHcphDMEO8jOw5qvTQm0Ia8fHY2mrESscgJKgBd o1HsBViLCyMt6F4HWoZGbMMQG4xnm1S66M1OrqfMNGTWwyZDxgI7O5mNgHmADLU7U1 bIVMs0YHSbaIw== Original-Received: from alfajor (unknown [216.154.43.249]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 9F77A12022D; Fri, 5 Mar 2021 10:57:17 -0500 (EST) In-Reply-To: <06A32454-8DB2-492C-9A69-A825AD5B66A2@gmail.com> (Yuan Fu's message of "Thu, 4 Mar 2021 11:18:30 -0500") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:266029 Archived-At: >>> Then should we add a mapping for the buffer-undo-list to t at that >>> point? Or should we just do nothing? >> Good question. I think you have a better understanding of how the equiv >> table should be filled than I do at this point, so I'd trust your judgme= nt. > Ok, I looked into it in detail, undo-equiv-table is also used to check if > the previous command is really an undo, alongside with checking > last-command. Indeed [ tho, this test is not 100% reliable, because the hash-table is weak, so entries may disappear from it, leading to entries that used to map to non-nil suddenly mapping to nil. ] > So the undo record has to map to something, I decide to map it to > =E2=80=98empty unless there is already a mapping for the record. Here is= the > (standalone) final draft. Please have a look. Looks good, thanks. Stefan