From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Daniel_Mart=C3=ADn?= Newsgroups: gmane.emacs.devel Subject: A feature to go to last edit locations Date: Sun, 12 Feb 2023 18:41:20 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22486"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (darwin) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 12 18:42:14 2023 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 1pRGMg-0005fm-8j for ged-emacs-devel@m.gmane-mx.org; Sun, 12 Feb 2023 18:42:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRGM0-000367-Ia; Sun, 12 Feb 2023 12:41:32 -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 1pRGLy-00032M-El for emacs-devel@gnu.org; Sun, 12 Feb 2023 12:41:30 -0500 Original-Received: from sonic307-54.consmr.mail.ir2.yahoo.com ([87.248.110.31]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pRGLv-000833-Q7 for emacs-devel@gnu.org; Sun, 12 Feb 2023 12:41:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1676223683; bh=ZujJX+aHTVUr1U07vfzp4/+DI0t/BeqQGXT4Ce9nVmQ=; h=From:To:Subject:Date:References:From:Subject:Reply-To; b=ppso6wMcGKlsgSz8RgjZ/Jr7wD4L1vHT0Dk2j0LyDBfpZZ22CmCwkVkucBZCJScnNI0XVx8j0BuCPCQh2bWDnLGPbheYGeJLwJRkAnE6yW9KMfZFkdJ1FktDBIkv6/pk6eiZxhOTnr9J2ThXEQKGvLFytPr8TULbbSUNA5UufCbb/GWL/NGW/1bgUlB0e76xblkQRIiGaVqNswmAVDymXER2BZ/ToiBd1kGR3Ffh4O05lYRmITJXcFmgxAfK7sHUoDFTmFzkqcCJG2jKdFVG/ZiTSMQPz4lWdFh4hhw5IRIR92LEoxR/b+j7M/JF0QNoOYcE9GNw+cLpnDfY13JbDA== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1676223683; bh=gwJuxqgOgOl0zNx70SDGpmqJC11B5GaTIZhGkU7q8/R=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=rxWDFdHDivdoeFp0GYJi5NZVd8BUBi9XidwOM8MF2XGNFbPAHh5M9FMvtlxNP/DXgZlvYft1vxRoMUmFlrhZCezciIVLn+vcgT+vwerrBubl570WDo1yzh+01ucmYIjJBARoJRT9gHNglsS1p6iKxDyY03WP5X74/J9pWuNK/f5mi8MUdj4lICziWeIAd1WR0QNzVxYVpurtUB0ATzL+hH/mC1SBne+5/JRd3ZHE2VcpiHkf5e9Z5ur+EEg6tbBAFWAnSA0virwfTIYc6vYUOFn9OnTIOBOjiwEP/FenFWR/s3/U2WOmHuT6XEXNkq3NxxZtTj1kzAv0K7fGmuEMKQ== X-YMail-OSG: u3LCuBYVM1mn7sjlN915l9uaE.6IEUzg3.SUtv3qZmzy6Yf6IQJ40r7ywkACXh9 SRTsoS2bbTHR4V9xr1CwGrzqrTwm3O2k4YW9dHVxnsfSMsljZAgOmP..2hkamQExRqDG6_eW94E8 1uT3Hq7AU3TyVjxbCbaAwWb5rsmX2WAW1njGdu.Z7MCKlcRcEdNn7PwaoS2a2fJ6w9MdJ2_LnhJW NRFheCPplIZaBvmQLN_WatPsSW4soKW_aBESKrUpE5hG_FAJ244jQuWD3uZyogoN.1P8S8t73MEH tMsouhrRui_TXCzw9owO4CaPBLvtQYujmPnmg2sAhlWf69Y1uRV9ZgwsZKPx80291XKcQB73CXYH OyJfkaBarsR9eQ2vGlFVrDiU6c0EAf6nftgaSArG590CTcQP5zMEMGiXcA9xNO.RRjfpWlLd7qda Oua8XX_eblKj8_IulcLoi7Hw5UnhCoIOLlTjZAKjVdD2H1Cp.T18gaXSBAqCtXrKXyIkw_aDvyUA QcRMcJ_yNYdWH7PjsPMLrkEOsbYX5CcxB3HCk.5xL.Yl5dpAKYnAHkoDR8Wj8Q3eA_UbKFpzkbB4 ZnIhR2AbMAN..kZalphLQVQYqlF.e_2OUVInd2o7ATUUqVHIrULNSTtGb4cuAbM5pmP16lzYSfHr sZV_xdhocTzWDi47NCTrvrQlk9V2esJcxlfr6N6rtp98DB.QT19eY6uSzw20OYTcPTyei5t2Jj_H GDqOjCNiO6Chs9lsV4tb7NhQITuSIryXQZpXVMOngtaFVFQ0i2nwWS2cI43nW5q0zUAmkJc2UnxR OODnOD1Bsf8HIwn317gtfU8skd03bCgAj7Ody0r2.G X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ir2.yahoo.com with HTTP; Sun, 12 Feb 2023 17:41:23 +0000 Original-Received: by hermes--production-ir2-65c64dfd66-qc44z (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID abb9b91b5f4f7b4152c6a2fab5e32350; Sun, 12 Feb 2023 17:41:21 +0000 (UTC) X-Mailer: WebService/1.1.21183 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=87.248.110.31; envelope-from=mardani29@yahoo.es; helo=sonic307-54.consmr.mail.ir2.yahoo.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:303188 Archived-At: Some IDEs and text editors provide a feature to go to the position of the last edit location across all buffers. For example, in Eclipse or IntelliJ IDEA, this feature is under Navigate, Last Edit Location. In Vim, this feature is called a "change list jump" [1], but it seems to work in a per-buffer basis. The closest thing in Emacs is pop-global-mark, but it's not quite the same feature. The global mark ring requires that the user sets the mark in advance, and most editing commands do not set the mark. Information about last edit locations is already kept in buffer-undo-list, but this list is per-buffer and does not contain timestamps, so generating a "global" list for all buffers out of this data structure does not seem very possible or efficient at the moment; it may need a new data structure, perhaps at the C level. My question is: Is there any interest on this new feature? If so, I have some questions about how it may fit in Emacs: - When popping entries from this new "last edit locations ring", should we give users the option to skip some changes? For example, to not go to changes in the minibuffer (which will probably be inactive), or to other kinds of buffers. - Should this feature restore killed buffers from files, if possible? pop-global-mark does not do that, but the Last Edit Location feature in IDEs tries to do that, AFAIK. - Should this feature be linked to undo information? That is, if undo is disabled for a buffer, should the edit change locations in that buffer be preserved? - I think there should be a configurable threshold to skip adding entries that are close to each other. For instance, an editing session that goes like Hello, world! M- World! would generate 3 last edit location entries which are probably uninteresting to users. We should give them an option to skip recording some changes (perhaps those that are in the same line, or less than a number of character positions apart from another entry in the ring). What do you think? Third-party packages like goto-last-change.el [2] or session.el [3] (see session-jump-to-last-change) implement this feature in a per-buffer basis, but I wonder if we could do better and implement something that works across buffers. [1]: https://vimhelp.org/motion.txt.html#changelist [2]: https://www.emacswiki.org/emacs/goto-last-change.el [3]: https://www.emacswiki.org/emacs/session.el