Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Having browse-url-text-emacs open in other window

13 views
Skip to first unread message

Mark Skilbeck

unread,
Jul 10, 2012, 6:14:03 AM7/10/12
to help-gn...@gnu.org
Hi, all.

I would like to configure browse-url-text-emacs to open documents in a
new window, i.e. not the current window. This is behaviour similar to
apropos, slime, and a whole bunch of other commands. I *could* get
down and dirty in the browse-url code--but, really, who wants to do
that?

Thanks, all.

--
- mgs.

if all you young men / were fish in the water
how many young girls / would undress and dive after

Bastien

unread,
Jul 10, 2012, 6:23:39 AM7/10/12
to Mark Skilbeck, help-gn...@gnu.org
Mark Skilbeck <m...@iammark.us> writes:

> I would like to configure browse-url-text-emacs to open documents in a
> new window, i.e. not the current window. This is behaviour similar to
> apropos, slime, and a whole bunch of other commands. I *could* get
> down and dirty in the browse-url code--but, really, who wants to do
> that?

C-u M-x browse-url-text-emacs RET

C-h v browse-url-new-window-flag RET

HTH,

--
Bastien

Mark Skilbeck

unread,
Jul 10, 2012, 6:41:31 AM7/10/12
to Bastien, help-gn...@gnu.org
On Tue, Jul 10, 2012 at 12:23:39PM +0200, Bastien wrote:
>
> C-u M-x browse-url-text-emacs RET
>
> C-h v browse-url-new-window-flag RET
>
> HTH,
>

Indeed, I saw this while browsing the documentation. However, it
doesn't do as it says-on-the-tin, at least not in my experience.
Instead of opening a new window (perhaps I should clarify that I mean:
split the window vertically if there's space, or horizontally
otherwise, a la M-x apropos) it looks for an already-present *text
broser* buffer and tries to send the new URL to this buffer. Do I have
it wrong? Did you test this yourself? Perhaps I should restart Emacs
to undo any customizations I've made and try again.

Cheers.

Bastien

unread,
Jul 11, 2012, 1:03:31 AM7/11/12
to Mark Skilbeck, help-gn...@gnu.org
Hi Mark,

Mark Skilbeck <m...@iammark.us> writes:

> Indeed, I saw this while browsing the documentation. However, it
> doesn't do as it says-on-the-tin, at least not in my experience.

Sorry I misread the documentation myself.

I would advise the function like this:

(defadvice browse-url (before browse-url-other-window activate)
(switch-to-buffer-other-window (get-buffer-create "*Browser*")))

HTH,

--
Bastien

Mark Skilbeck

unread,
Jul 11, 2012, 10:35:18 AM7/11/12
to Bastien, help-gn...@gnu.org
Cool! That works almost perfectly. However, there is a dangling
*Browser* buffer when I leave the browser process. I got around this
by doing:

(defadvice browse-url (before browse-url-other-window activate)
(switch-to-buffer-other-window nil t))

However, this isn't *entirely* desirable. If I have two windows, A and
B, split vertically with a buffer C not displayed, using the above
advice, either A or B (depending on which window is switched-into) is
changed to the C buffer on exiting the browser. It's not a show
stopper, in fact it's much better than the default behaviour of
opening the browser in the same window!

Thanks for your help.
0 new messages