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

Re: bugs related to tabs

On 2019-05-22 07:59, Boruch Baum wrote:
> On 2019-05-22 15:54, Katsumi Yamaoka wrote:
> > ...
> > 1.
> >   In the emacs-w3m home page <http://emacs-w3m.namazu.org/>,
> > when I type <S-return> (`w3m-view-this-url-new-session') on
> > the name link `Features', the new tab appears and it shows
> > the Features section of the page.  That's ok.  However, if I
> > switch the tab to the original one, I can see the Features
> > section shown also there.  But what the original tab displays
> > should not be changed of course.
> I can reproduce this bug by performing "M-x
> w3m-view-this-url-new-session" and "C-u C-u M-x w3m-view-this-url", but
> it does seem to function correctly when performing "M-x
> w3m-goto-url-new-session".

Does the following fix the situation for you?

(defun w3m-view-this-url-new-session ()
  "Display the page of the link under point in a new session.
If the region is active, use the `w3m-open-all-links-in-new-session'
command instead."
  (if (w3m-region-active-p)
      (call-interactively 'w3m-open-all-links-in-new-session)
    (let ((url (w3m-url-valid (w3m-anchor))))
      (if url
        (w3m-goto-url-new-session url)
;      (w3m--message t 'w3m-error "No URL at point")))))
       (w3m-message "No URL at point")))))

There is much duplication between the code of w3m-goto... and
w3m-view..., the only difference I can see from the user's perspective
is that w3m-view... doesn't prompt the user. If that's correct, then
much more of the code could be combined, and that would make maintenance
that much easier.

CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0