help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: How do I display pdfs to the right and not below the current window?


From: Marcin Borkowski
Subject: Re: How do I display pdfs to the right and not below the current window?
Date: Sat, 02 Jan 2016 07:39:08 +0100
User-agent: mu4e 0.9.13; emacs 25.0.50.1


On 2016-01-02, at 02:37, Michael Heerdegen <address@hidden> wrote:

> Marcin Borkowski <address@hidden> writes:
>
>
>> (add-to-list 'display-buffer-alist '("\\.pdf$" . 
>> (display-buffer-pop-up-window-split-horizontally)))
>> (defun display-buffer-pop-up-window-split-horizontally (buffer alist)
>>   "Call `display-buffer-pop-up-window', setting
>> `split-height-threshold' and `split-width-threshold' so that
>> the split is always horizontal."
>>   (let ((split-height-threshold nil)
>>      (split-width-threshold 0))
>>     (display-buffer-pop-up-window buffer alist)))
>>
>> And here are my questions:
>
>
>> 1. Do I use the right variable?
>
>> 2. Is my way of ensuring that the split will be horizontal a good one?
>
> I think so.
>
>> 3. I'd also like to be able to make the newly created window a bit
>> narrower than half the width of the original one (or rather, ensure that
>> the original window is at least 80 columns wide).  How do I achieve
>> that?
>
> I think you would have to bind `split-window-preferred-function',
> calculate the preferred size yourself and pass it directly to
> `split-window-below' etc.

Thanks for your answer, it works (I'll share my code soon).

Now I have another problem.  This code

(split-window-right (round (* 0.5 (window-width window))))

will split the window into "unequal halves".  I understand the reason,
but is there a simple way to override this behavior?  IOW, how to define
`calculate-columns' so that (split-window-right (calculate-columns col))
makes it so that subsequent (window-width) returns exactly col?

> Michael.

Best,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Faculty of Mathematics and Computer Science
Adam Mickiewicz University



reply via email to

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