From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Hongyi Zhao Newsgroups: gmane.emacs.help 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 Message-ID: References: <87edo52mtg.fsf@gnu.org> <87o7n8jwzw.fsf@gnu.org> <87jzxwjghd.fsf@gnu.org> <87fs8kjedb.fsf@gnu.org> <87ildfdqwu.fsf@gnu.org> <87fs8jauv0.fsf@gnu.org> <87y1mafo4i.fsf@gnu.org> <87354h9osf.fsf@gnu.org> <878re8h87w.fsf@gnu.org> <875y9ak17o.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39380"; mail-complaints-to="usenet@ciao.gmane.io" Cc: stefan-husmann@t-online.de, help-gnu-emacs@gnu.org To: Tassilo Horn Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 03 03:45:51 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pu1Z0-000A3q-VX for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 03 May 2023 03:45:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pu1YW-0003mQ-DM; Tue, 02 May 2023 21:45:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pu1YU-0003mH-Cp for help-gnu-emacs@gnu.org; Tue, 02 May 2023 21:45:18 -0400 Original-Received: from mail-ej1-x634.google.com ([2a00:1450:4864:20::634]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pu1YS-00086R-Jy; Tue, 02 May 2023 21:45:17 -0400 Original-Received: by mail-ej1-x634.google.com with SMTP id a640c23a62f3a-94a34a14a54so916184166b.1; Tue, 02 May 2023 18:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683078314; x=1685670314; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Mj1lvF5JBL9XO/348J66QSIA0YpknTl/pb7abA9L/rQ=; b=Mr54I+w3S1mx6XRPfnOCOWSrqe4NyD1dCUlK+ZF0SseyoNwdgO2EC/oOXQ7ZTpC8PY TyafV0wSU12kt2leEqYjoP7jTAhxOlzvn/ux658/Ojho77B5/oKdYgYV1sE5w+j/74wy od+w20qr06vGWxRvUqwOmarfR2jvfwj3h1+Ui7UqOdm4uaJgnppt805KXf2DhTOtiAa0 lM8UIGw8sfNoqf+FL4rB0tfflIcKxdn1sHyPqInDlx1XRC1HXahnS4XW8sRjdRUYDcdP ntujjSCc9xTIW9aoRkNp0SXgSR07CczAYFUb3GVb29huoI64Cb+La9zLvOZLMEceTJAR FBHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683078314; x=1685670314; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Mj1lvF5JBL9XO/348J66QSIA0YpknTl/pb7abA9L/rQ=; b=ihAJlH/Bij1GGv41WFdZ9kYCL0uz2gBcJTCTNYQdCUxLHHC/K+NNNPZk3nB9hSOI1J IhoWJu883/1rIAOTNxCO/MEMJsA++0xjyiFBzjmMYiiYjXdmERL2ih8oyXTGmAvz1itw 7AcDNjXNK96/BrTVt+vDHHGo3ZoCqGBo90Se/3a/ah/80AZjsVNgPjM6mRSMAuaexeAp KfsoxI/VqQsuxwWns/t/Kz667U2uhprxo8wI2dOCg1wKINDMtQ03czfRxERwgrXSBYH8 KIo3TShqlPegl/4Ef93Zlk4nf8TdpmsXrY8kCjuy8vDvVk/042ObKZfB8nl5EjuwOFE+ lDyw== X-Gm-Message-State: AC+VfDxCgzGwy/HdxDsRMY3y4BofYDB0bdoheFG9bqsYoi5mZSOTQKOZ q9XxK1NopVCe+PTdWtkL7ogVpRHjTYbb95ou4LSbEhl/slW+9c7K X-Google-Smtp-Source: ACHHUZ5gnHHrrTZajki5pY8GfsA2yoCnFBBRwQOAsTzb3L1IU7HrTXc3jJiR43jJrmM6S4rMrpcXocjDAsUr/BHqycc= X-Received: by 2002:a17:907:8690:b0:948:d1af:3a11 with SMTP id qa16-20020a170907869000b00948d1af3a11mr1913629ejc.50.1683078313939; Tue, 02 May 2023 18:45:13 -0700 (PDT) In-Reply-To: <875y9ak17o.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::634; envelope-from=hongyi.zhao@gmail.com; helo=mail-ej1-x634.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:143498 Archived-At: This is great, thank you so much! On Wed, May 3, 2023 at 3:00=E2=80=AFAM Tassilo Horn wrote: > > Hongyi Zhao 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-si= de (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