all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: emacs-devel@gnu.org, Po Lu <luangruo@yahoo.com>
Subject: Re: Systematizing back navigation
Date: Tue, 21 Nov 2023 07:35:24 +0200	[thread overview]
Message-ID: <70ABA96C-74EE-40B2-BB0F-A0FDAA412BE7@gnu.org> (raw)
In-Reply-To: <87il5vixat.fsf@yahoo.com>

On November 21, 2023 5:45:46 AM GMT+02:00, Po Lu <luangruo@yahoo.com> wrote:
> There is presently a bewildering set of actions taken in response to an
> XF86Back key press.  In most buffers, it is equivalent to typing C-x
> <left>, switching to the buffer previously displayed in the current
> window.  In Help buffers, it navigates to the last Help notice
> displayed, and in Info buffers, it navigates to the last node displayed.
> 
> Such behavior is confusing because XF86Back cannot be relied on to
> restore an earlier state of affairs, be that a previous window
> configuration, Info node or current buffer.  To give an example, if the
> Info directory is opened, then the node "(elisp)Numeric Conversions",
> the scratch buffer, and the Info buffer once more, XF86Back will return
> to the Info directory instead of *scratch*.  If XF86Back is pressed
> thereafter, Info will print a message to the effect that there is no
> previous node in the Info buffer's history without restoring any earlier
> window configuration.
> 
> Moreover, restoring merely the last buffer to have been selected does
> not suffice at times: when I press Back after typing "F" in a Gnus
> Article buffer displays a message buffer occupying the whole frame, I am
> brought to the Summary buffer, while it is the previous window
> configuration incorporating both the Summary and Article buffers that
> should be restored in this case.
> 
> The object of such keys as XF86Back and its Android analogs is to undo
> the effects of the last navigation: a call to display-buffer, switching
> to a different window, clicking on a link in an Info buffer, and the
> like.  In the first instance, this calls for a unified undo system which
> preserves changes to the window configuration, that they might be
> reverted when Back is pressed.
> 
> As this cannot account for forms of navigation that spare the window
> configuration, Info and Help buffers must also make a note of new nodes
> visited within this undo system and supply means by which these
> alterations can be undone.
> 
> There are two shortcomings to this I can't yet address.  If window
> configurations are saved, then the selected window is also accounted a
> navigation operation and is subject to change when Back is pressed.  Not
> only is this unwanted, it also impedes addressing the second
> shortcoming, which is that it ought to be possible for the effect of
> Back to be limited to a single window, such as by restoring the selected
> buffer of that single window rather than that of the window whose
> selected buffer is the last to have changed.
> 
> Thus instead of implementing and installing a prototype of this at a
> venture, I want to ask everyone else's advice, and also for ideas as
> regards when and whether this Back mechanism should act as described in
> the last paragraph.
> 
> TIA.
> 
> 

I think you are over-engineering this.  That a key has different bindings in different major modes is nothing new in Emacs.  Moreover, smartphone apps are also inconsistent in what the Back button does in each situation.

So I don't see why we need to worry about this, let alone pretend there's some deep internal issue here.  Perhaps you bumped into some specific situation, and then tried to generalize it too much.  In that case, I suggest to describe the original issue, not its generalizations.

Thanks.



  reply	other threads:[~2023-11-21  5:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87il5vixat.fsf.ref@yahoo.com>
2023-11-21  3:45 ` Systematizing back navigation Po Lu
2023-11-21  5:35   ` Eli Zaretskii [this message]
2023-11-21  6:35     ` Po Lu
2023-11-21  6:57       ` Eli Zaretskii
2023-11-21 11:43         ` Dmitry Gutov
2023-11-21  6:39   ` Adam Porter
2023-11-21 11:44     ` Dmitry Gutov
2023-11-21 13:15   ` sbaugh
2023-11-21 17:01   ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=70ABA96C-74EE-40B2-BB0F-A0FDAA412BE7@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.