Ihor Radchenko <yanta...@posteo.net> writes:

> Björn Bidar <bjorn.bi...@thaodan.de> writes:
>
>>> Then, why not simply the attached patch?
>>>
>> Because the patch circumvents the other-frame mechanism when the
>> other-frame is dead.
>
> May it be that `org-link-frame-setup' is configured by the user to use
> current frame, but the user manually used gnus-other-frame and closed
> the frame? In my mind, your patch then introduced unexpected behavior.

The `org-link-frame-setup' introduced the first unexpected behavior I
think since `org-gnus-follow-link' unconditionally uses the previously
existing frame, going with that opening Gnus outside of the
gnus-other-frame-object in the frame setup function would go against
that.

If the user created a frame setup function which used the current frame
then the current frame would become the Gnus other-frame as there can be
one only Gnus frame. So the patch wouldn't lead to unexpected behavior
even for such a user, it's more likely the user would be confused that
the Gnus frame was changed to be the current one.

>> ... Further the org-link-frame-setup doesn't take
>> gnus-other-frame into account either.
>
> Why would it need to take it into account?

The org-gnus-follow-link function tries to take into account whenever
the user previously used `gnus-other-frame' to open Gnus by selecting
the appropriate frame.

However the current org-link-frame-setup function doesn't do so and
calls the `gnus' function which would not use the previously existing
Gnus frame. The correct approach is to call gnus-other-frame to activate
Gnus when `gnus-other-frame-object' exist since that won't activate Gnus
in the current window but in the previous or a new frame. 

The side effect is that if there's a gnus-other-frame-object that is
always alive when `org-gnus-follow-link' tries to select it. 

Reply via email to