emacs-devel
[Top][All Lists]
Advanced

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

Suggesting `frame-split-biggest-window' Re: customize location and shape


From: N. Jackson
Subject: Suggesting `frame-split-biggest-window' Re: customize location and shape of a new window in a frame
Date: Wed, 12 Sep 2018 19:21:25 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Thanks Eric,

At 13:12 -0700 on Wednesday 2018-09-12, Eric Abrahamsen wrote:
>
> On 09/12/18 15:36 PM, N. Jackson wrote:
>> At 14:22 -0700 on Tuesday 2018-09-11, Eric Abrahamsen wrote:
>>>
>>> (add-to-list 'gnus-window-to-buffer
>>>        `(bbdb-gnus . "*BBDB*"))
>>>
>>> (gnus-add-configuration
>>>   (article
>>>     ,(cond
>>>       (gnus-use-trees
>>>        '(vertical 1.0
>>>               (summary 0.25 point)
>>>               (tree 0.25)
>>>               (horizontal 1.0
>>>                           (article 1.0)
>>>                           (bbdb-gnus 0.4))))
>>>       (t
>>>        '(vertical 1.0
>>>               (summary 0.25 point)
>>>               (horizontal 1.0
>>>                           (article 1.0)
>>>                           (bbdb-gnus 0.4))))))
>>
>> Evaluating the second form gives:
>>
>> Debugger entered--Lisp error: (void-function article)
>
> Yup, that was a cut-and-paste problem from my larger config. Just stick
> a ` before the "(article" part.

After quoting with a ' (not a `) and removing the comma before the
`cond', this does exactly what I was looking for. I now have the
following in my .gnus file:

  ;;; 2018-09-12 Arrange for Gnus to place BBDB window sensibly.
  (add-to-list 'gnus-window-to-buffer
               `(bbdb-gnus . "*BBDB*"))
  (gnus-add-configuration
   '(article
     (cond
      (gnus-use-trees
       '(vertical 1.0
                  (summary 0.25 point)
                  (tree 0.25)
                  (horizontal 1.0
                              (article 1.0)
                              (bbdb-gnus 0.4))))
      (t
       '(vertical 1.0
                  (summary 0.25 point)
                  (horizontal 1.0
                              (article 1.0)
                              (bbdb-gnus 0.4)))))))


However, it seems odd to be able to get this:

  +-------------------------------+
  |                               |
  |           Summary             |
  |                               |
  +-------------------------------+
  |                               |
  |                               |
  |           Article             |
  |                               |
  |                               |
  |-------------------------------|
  |            BBDB               |
  +-------------------------------+
  
and this:

  +-------------------------------+
  |                   |           |
  |      Summary      |   BBDB    |
  |                   |           |
  +-------------------------------+
  |                               |
  |                               |
  |                               |
  |            Article            |
  |                               |
  |                               |
  |                               |
  +-------------------------------+

simply by customizing the variable `bbdb-mua-pop-up', but in order
to get

  +-------------------------------+
  |                               |
  |           Summary             |
  |                               |
  +-------------------------------+
  |                   |           |
  |                   |           |
  |                   |           |
  |      Article      |   BBDB    |
  |                   |           |
  |                   |           |
  |                   |           |
  +-------------------------------+

the user has to do some fairly heavy-duty configuration in Gnus. I'm
impressed by the power of this feature in Gnus, but it feels like
overkill for a case like this.

It seems to me that what is really needed is a new function or three.

Currently `bbdb-pop-up-window' uses `split-window' to display its
window. The problem here is that `split-window' takes a WINDOW
argument so BBDB first has to figure out which window to split.

If there was a function (frame-split-biggest-window FRAME SIZE SIDE
PIXELWISE) to split the "biggest" [*] window in the frame, then
neither BBDB nor any other Elisp code would need to keep reinventing
this wheel.

(The other two functions, more for interactive use, would be
`frame-split-biggest-window-below' and
`frame-split-biggest-window-right'.)

[*] To find the "biggest" window when splitting below, find the
tallest window or windows and split the widest of them; when
splitting right, find the widest window or windows and split the
tallest of them.




reply via email to

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