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

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

Re: How to have a frame dedicated to buffers of a certain kind? (was: us


From: Tassilo Horn
Subject: Re: How to have a frame dedicated to buffers of a certain kind? (was: use pdf-tools in Emacs.)
Date: Wed, 03 May 2023 09:48:01 +0200
User-agent: mu4e 1.11.4; emacs 30.0.50

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

>> Also note that my solution or maybe your requirements have their
>> problems: now it's hard to add more rules to display-buffer-alist
>> because for all of them you have to encode the "but, please, not in the
>> pdf-frame" stuff.  It's pretty complicated.  FWIW, I simply use a large
>> wide frame with a side-by-site split where the tex source is displayed
>> in the left window and the pdf in the right window.  That works without
>> any special configuration and isn't less convenient, IMHO.
>
> Agreed. What's your configuration for this simple purpose?

None, I think.  split-window-preferred-function is split-window-sensibly
in recent emacsen and split-width-threshold is 160 by default which fits
my screen resolution and habit to have one fullscreen emacs frame.  So
when emacs splits, I get two side-by-side windows, each about 80 columns
wide.

> What I can think of is something like the following:
>
> ;; Split windows horizontally and display the PDF and TeX source side-by-side
> (setq split-width-threshold 1000)

That tells emacs that split-window-sensibly may only split a window
horizontally (i.e., into two side-by-side windows) if the window being
split is at least 1000 columns wide.  Basically, you ensure that
horizontal splits will never ever occur unless you have a screen that's
5 meters wide. :-)

> (add-hook 'TeX-after-compilation-finished-functions
>           #'(lambda () (pdf-tools-deactivate-strip)))

Instead of the lambda, #'pdf-tools-deactivate-strip will also do.  And
aside from that, this function is undefined in my (the current MELPA)
version of pdf-tools...

Bye,
Tassilo



reply via email to

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