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: Hongyi Zhao
Subject: Re: How to have a frame dedicated to buffers of a certain kind? (was: use pdf-tools in Emacs.)
Date: Wed, 3 May 2023 09:45:02 +0800

This is great, thank you so much!

On Wed, May 3, 2023 at 3:00 AM Tassilo Horn <tsdh@gnu.org> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> Hi Zhao,
>
> >> BTW, I wonder if you really want to have a dedicated tex frame or
> >> just a dedicated pdf frame + one editing/normal frame.  If it's
> >> actually the latter, I wouldn't introduce another th/tex-frame
> >> parameter but simply test for (null (frame-parameter frame
> >> 'th/pdf-frame)) everywhere.
> >
> > Please go ahead with the latter and let me test it.
>
> It's attached to this mail.  I've tested these three scenarios:
>
> 1. Start emacs, find tex source and then view it using AUCTeX View
>    command where the last step creates a new pdf-dedicated frame.
> 2. Start emacs, find pdf document which opens the pdf in a new
>    pdf-dedicated frame.  Double-click in the pdf finds the tex source
>    in the other (non-pdf) frame.
> 3. Start "emacs foo.pdf" which shows the pdf in the initial frame and
>    the code makes sure this frame has the th/pdf-frame parameter.
>    Double-click in the pdf which spawns a new frame showing the tex
>    source.
>
> In all three cases I tested forward/backward synctex search which seems
> to work as you like.
>
> But that's the last code for this topic from me.  I like helping and
> giving hints but my spare time is too limited to write ready-made
> solutions to problems that don't scratch an itch of my own. :-)
>
> 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? 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)
(add-hook 'TeX-after-compilation-finished-functions
          #'(lambda () (pdf-tools-deactivate-strip)))

Any enhancements/comments will be appreciated.

>
> Bye,
> Tassilo

Regards,
Zhao



reply via email to

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