emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Some developement questions


From: Drew Adams
Subject: RE: Some developement questions
Date: Sun, 9 Sep 2018 16:05:59 -0700 (PDT)

> The prefix-arg thing works with some other Info navigation
> commands too. E.g. `C-u g Screen' goes to node `Screen' in a
> new, cloned buffer, `C-u f Emacs Lisp' follows an xref to the
> Emacs Lisp manual in a cloned buffer. (It doesn't work with
> `l', `r', `n', `p', `u', however. (Maybe it should.)

FWIW, in my own code I've added this to `n', `p', `u', `l', `r', `d', `]',
and `['. So it's now available with those keys, plus `g', `f', and `m'.

https://www.emacswiki.org/emacs/download/info%2b.el

This could be added to Emacs, if someone is interested. The
change is trivial.

One thing I changed, which is peripherally related:

Vanilla Emacs wraps the body of this and similar functions with
`save-window-excursion'. I think that's wrong. It's problematic,
for example, if you use a dedicated window for the new, cloned
buffer or when it is otherwise shown in a separate frame.

(defun Info-next (&optional fork)
  "Go to the next node of this node.
If FORK is non-nil (interactively with a prefix arg), show the node in
a new Info buffer.
If FORK is a string, it is the name to use for the new buffer."
  (interactive "P")
  (unless (derived-mode-p 'Info-mode) (switch-to-buffer "*info*"))
  (Info-goto-node (Info-extract-pointer "next") fork))

But maybe someone can set me straight about this: let me know
why the `save-window-excursion' was there and what a better fix
would be than just removing it. I haven't yet noticed any problem
from removing it.

I see that in Emacs 23 the code used `pop-to-buffer' here, and
that was changed to `switch-to-buffer'. It's also not clear to me
why that change was made. (I left `switch-to-buffer' in my version,
but it's not clear that "the selected window" would always be
used to display the new buffer.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]