all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Marcin Borkowski <mbork@mbork.pl>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
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	[thread overview]
Message-ID: <874mew32pf.fsf@mbork.pl> (raw)
In-Reply-To: <877fjs92y2.fsf@web.de>



On 2016-01-02, at 02:37, Michael Heerdegen <michael_heerdegen@web.de> wrote:

> Marcin Borkowski <mbork@mbork.pl> 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	other threads:[~2016-01-02  6:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-31 14:26 How do I display pdfs to the right and not below the current window? Marcin Borkowski
2016-01-02  1:37 ` Michael Heerdegen
2016-01-02  6:39   ` Marcin Borkowski [this message]
2016-01-03  0:43     ` Michael Heerdegen
2016-01-03  7:18       ` Marcin Borkowski
2016-01-04  3:18         ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874mew32pf.fsf@mbork.pl \
    --to=mbork@mbork.pl \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.