From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.devel Subject: Re: [External] : Re: A feature to go to last edit locations Date: Tue, 14 Feb 2023 00:14:12 +0300 Message-ID: References: <972bedcc-37c9-5180-ac41-90e25d854a63@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28084"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.2.9+54 (af2080d) (2022-11-21) Cc: Dmitry Gutov , Daniel =?utf-8?Q?Mart=C3=ADn?= , "emacs-devel@gnu.org" To: Drew Adams Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Feb 13 22:23:58 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 1pRgIl-0006y2-Q9 for ged-emacs-devel@m.gmane-mx.org; Mon, 13 Feb 2023 22:23:55 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pRgIF-0002NB-5W; Mon, 13 Feb 2023 16:23:23 -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 1pRgID-0002Mx-2h for emacs-devel@gnu.org; Mon, 13 Feb 2023 16:23:21 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pRgIB-0004Dr-9z for emacs-devel@gnu.org; Mon, 13 Feb 2023 16:23:20 -0500 Original-Received: from localhost ([::ffff:197.239.6.48]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 0000000000103956.0000000063EAAA49.000029C3; Mon, 13 Feb 2023 14:23:20 -0700 Mail-Followup-To: Drew Adams , Dmitry Gutov , Daniel =?utf-8?Q?Mart=C3=ADn?= , "emacs-devel@gnu.org" Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.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, RCVD_IN_SBL=0.141, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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:303241 Archived-At: * Drew Adams [2023-02-13 22:49]: > > Eli said something important, why go somewhere back randomly, but > > better going where user marked it to need it. > ^^^^^^^^^^^^^^^^^^^^^^^ > > Now I get it with single click: S-C- to record point and then > > S-C- and to go to previous or next one. > > You are reinventing (part of) what bookmarks do. Ok, though is not bad, as I do not rely on Emacs Lisp, rather on PostgreSQL. It could be re-written to use the now built-in SQLite. > If you don't want to have to name bookmarks for this, then you can use autonamed bookmarks: > https://www.emacswiki.org/emacs/BookmarkPlus#AutonamedBookmarks I do not use names automatically, only with C-u prefix. All points are automatically named. It is very easy to designate the record of the point as one to be chosen by name or the one to be temporary (your idea) or the one which was not named. Only those named points should be used similarly as bookmarks. > (Single key to set, single key to jump to.) > > For that you need Bookmark+, but as an alternative you can just > define a bookmark-setting command that provides default names of > your own design. Which single key? I have to use complex key combinations, or maybe function keys. > Rolling your own thingies which are essentially just bookmarks (and > using a database to store them, no less) is really not necessary. It makes things easy in my personal space. I can make package out of it that uses SQLite. I use it in similar way as previous-buffer, next-buffer, it is just more specific as by following Edi's advise to mark what I want. If necessary or not necesary, is personal opinion. I am editing text objects in the database, and often temporary files. Standard bookmark does not work in a buffer without file. "Emacs points" that I have implemented work on temporary buffer. Bookmark+ works on buffers without file. "Emacs points" will self-destruct on non-existing buffers without files: 2023-02-14-00:02:14 Self-destruction initiated on Emacs point ID 113 (reason: not found) Bookmark+ gives error on buffers without file: if: Jumping to bookmark: Cannot access file ` - no file -' or buffer `new' [2 times] I am editing database text, my "Emacs points" can remember table, column, table ID, to go back to the editing point (not fully implemented, need few minutes). No previous implementation can go to database backed text and point inside. Now you can see that it could be necessary, as not all cases are covered. And it has simple functionality that works already, due to database usage. Just few functions on top of others. Imagine me dwelling in kilobytes of your code, I would never make it, I feel discouraged and overwhelmed to understand it. > It may be fun to do, but Emacs already has what you describe, as > bookmarks. Sure, though it is not same. I use these database backed Emacs places as "points" rather, to move back and forth from point to point. - Save point - Toggle local (buffer based) movement or global movement - Go next, previous or last, first Names are automatically implemented, but user can name them explicitly and so far I did not start using it by names. So it is not yet "bookmark" in that sense, only point in buffer with or without file name, or buffer editing database entry. -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/