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

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

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


From: Marcin Borkowski
Subject: How do I display pdfs to the right and not below the current window?
Date: Thu, 31 Dec 2015 15:26:40 +0100
User-agent: mu4e 0.9.13; emacs 25.0.50.1

Hi list,

this is what I've come up with:

--8<---------------cut here---------------start------------->8---
(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)))
--8<---------------cut here---------------end--------------->8---

And here are my questions:

1. Do I use the right variable?  There are quite a few places I could
stick my `display-buffer-pop-up-window-split-horizontally', I'm not sure
this is the best one.

2. Is my way of ensuring that the split will be horizontal a good one?

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?

4. Do you agree that something like this should be (at least as an
option, but preferably as the default) in Emacs core?  Stock Emacs can
display pdfs with doc-view (I use pdf-tools).  Nowadays most people have
rather wide screens, and displaying a (portrait, not landscape) pdf in
a wide but short (in a sense of height) window does not make a lot of
sense.

Of course, when items 1-3 are resolved, I'll be happy to submit
a patch.

WDYT?

-- 
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]