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.help Subject: Re: Jumping from one position to other position Date: Sun, 6 Dec 2020 08:24:20 +0300 Message-ID: References: <2f54a399-a632-4000-97f4-d0775165de9b@default> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36663"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.0 (3d08634) (2020-11-07) Cc: Help GNU Emacs To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 06 06:28:42 2020 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 1klmbC-0009Rm-EF for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 06 Dec 2020 06:28:42 +0100 Original-Received: from localhost ([::1]:53214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1klmbB-0000iy-Bz for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 06 Dec 2020 00:28:41 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1klmaj-0000iZ-Qr for help-gnu-emacs@gnu.org; Sun, 06 Dec 2020 00:28:13 -0500 Original-Received: from static.rcdrun.com ([95.85.24.50]:58847) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1klmah-0008O9-TC for help-gnu-emacs@gnu.org; Sun, 06 Dec 2020 00:28:13 -0500 Original-Received: from localhost ([::ffff:197.157.0.57]) (AUTH: PLAIN admin, TLS: TLS1.2,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by static.rcdrun.com with ESMTPSA id 00000000002C0006.000000005FCC6BE7.00004C92; Sun, 06 Dec 2020 05:28:07 +0000 Content-Disposition: inline In-Reply-To: <2f54a399-a632-4000-97f4-d0775165de9b@default> Received-SPF: pass client-ip=95.85.24.50; envelope-from=bugs@gnu.support; helo=static.rcdrun.com X-Spam_score_int: 14 X-Spam_score: 1.4 X-Spam_bar: + X-Spam_report: (1.4 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_SBL_CSS=3.335, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.help:126083 Archived-At: * Drew Adams [2020-12-06 00:30]: > > All the time I have to jump from one function to other function. What > > I used so far is C-SPC C-SPC to leave mark at the point and deactivate > > it. Then I can jump to other places and come back with C-u SPC. > > > > What I would like is to keep somehow automatically source position as > > new mark, when I do C-u SPC at position X that I jump to position Y, > > and then from Y with C-u SPC again back to X. > > > > But Emacs does not work this way. > > > > If anybody have better way of jumping from one place A to place B and > > returning again to place A, and again to place B, let me know. > > (`C-SPC') `C-x C-x' Repeat to move back. > `C-g' do deactivate region. Thank you for references. In some programming cases M-, and M-. can bring me to referenced or referencing functions. It helps but is not same. I think maybe to maybe function for a key to remember the current marker and jump to last marker, then again same key to remember that other marker and jump to last remembered. It should be one key like s-m or similar, definitely not two or combinations of too many keys. F5 would serve me better than current: C-SPC C-SPC followed by C-u SPC that is not really doing what I mean but is helpfull. > There are also libraries that give you ways to > browse among the marks, including by choosing > the text surrounding them using completion. Small stuff is better kept in one's own configuration then relying on libraries. Then on each Emacs installation I would need to either remember which is external library or make sure it is installed PLUS using my own configuration. It is double action which I always try to prevent. (info "(emacs) Mark Ring") says: ,---- | To return to a marked position, use ‘set-mark-command’ with a prefix | argument: ‘C-u C-’. This moves point to where the mark was, and | deactivates the mark if it was active. Each subsequent ‘C-u C-’ | jumps to a prior position stored in the mark ring. The positions you | move through in this way are not lost; they go to the end of the ring. `---- Just that I am not satisfied with it. It does not bring me back how I mean. I am using this for years. But maybe this can help: ,---- | The variable ‘mark-ring-max’ specifies the maximum number of entries | to keep in the mark ring. This defaults to 16 entries. If that many | entries exist and another one is pushed, the earliest one in the list is | discarded. Repeating ‘C-u C-’ cycles through the positions | currently in the ring. `---- Because if I specify `mark-ring-max' to be 2 then maybe this is what I need. So I will test this feature while programming. Majority of times I jump back I do not want to jump to previous 3rd or 4th position but just to previous position and back. Useful logical jumping would be for me: 1 2 3 4 5 6 7 8 7 8 7 8 7 8 ~~~~~~~~~~~ this is where mode of jumping changes then one could maybe decide to go back to mode to reach again 1-6 positions.