From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Heime Newsgroups: gmane.emacs.help Subject: Re: Make new buffers into new frames Date: Sun, 29 Sep 2024 12:44:04 +0000 Message-ID: References: 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="38823"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Heime via Users list for the GNU Emacs text editor To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Sep 29 14:45:04 2024 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 1sutIN-0009uD-Vx for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 29 Sep 2024 14:45:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sutHa-0006z8-3Q; Sun, 29 Sep 2024 08:44:14 -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 1sutHX-0006yw-Tn for help-gnu-emacs@gnu.org; Sun, 29 Sep 2024 08:44:11 -0400 Original-Received: from mail-40135.protonmail.ch ([185.70.40.135]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sutHV-0001Hs-Pe for help-gnu-emacs@gnu.org; Sun, 29 Sep 2024 08:44:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1727613847; x=1727873047; bh=bmdKKDYmeQvB7+8h6ktanZRlgO7ynCCk8XiLAz2aRvY=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=ilXHNppwn5AI/W9N+cmiE6Ch9nkr1UjfpBxqIM3C+yoGUA7UpKhMaWKmwOqH9sdRG bgOcF2jrRawWGkmeWjdlQVJ2eGj9CepO0rRNQO+z52AYcTz1J5VZ3pLV+nDRfVvd6Y l1El4xOeX4VOQ7NoBqLEp1KBJ8Jb4rEIulpSc16AQ78U3x/LbUMcSwEXenLQzgcuTK mV0pzMqSEUZJsLmx5sgZVYSs161LhLPq2Jl7CfWLOmp9ZCduaotmNCUv+YzaczKxWQ +eQClvWdx7QFO7c110fAv3GpZPckk5EiRXpBxxC1XoQ2S7Tb3JOLlwVGJIjHJXTf0Y uEctb51C8KDkA== In-Reply-To: Feedback-ID: 57735886:user:proton X-Pm-Message-ID: 1b7cef9dabf63ed3631da1b9f4c29c53de882101 Received-SPF: pass client-ip=185.70.40.135; envelope-from=heimeborgia@protonmail.com; helo=mail-40135.protonmail.ch 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_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, TO_EQ_FM_DIRECT_MX=0.001 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:148098 Archived-At: On Sunday, September 29th, 2024 at 7:40 PM, Heime wrote: > I want to display the user named buffer when calling buffer-into-frame in= to > a new frame. The buffer will have a button, which when pressed another bu= ffer > will be made to display my-message, which is some text. > > I also want my-message to be displayed in a buffer and in the same new fr= ame. > > (defun display-message (my-message &optional bfrn) > "Display textual message into the buffer BFRN." > > (let* ( (bfname (or bfrn "Info")) > (dbuffer (get-buffer-create (concat "=F0=92=86=B3 " bfname))) ) > > (with-current-buffer dbuffer > (erase-buffer) > (insert my-message) > (goto-char (point-min))) > > (display-buffer dbuffer))) > > ;; ------------------------------------------------------- > > (defun buffer-into-frame (&optional bfrn) > "TODO" > > (interactive > (list (let ( (rqmatch nil) > (cseq '("Default" "Torium")) ) > (completing-read " Display Name: " cseq nil rqmatch "Selection Buffer")))= ) > > (let* ( (bfname (or bfrn "S_election Buffer")) > (dbuffer (get-buffer-create (concat "=F0=92=86=B3 " bfname))) ) > > (with-current-buffer dbuffer > (erase-buffer) > > ;; Insert a button that shows the info when pressed > (insert-button " - " > 'action (display-message my-message "Info Buffer") > 'follow-link t) > > (insert " Running Non-Interactive Commands"))) ) Have made a dedicated frame frame-display-unit. With trm-display-info used to display a message, and=20 trm-button-choices handling the button choices. But things go wrong when I press the button with (invalid-function #) (defvar frame-display-unit nil "Dedicated frame for displaying specific buffers.") ;; ----------------------------------------------------------- (defun trm-display-info (message &optional bfrn) "Display textual message into the buffer BFRN." (let* ( (bfname (or bfrn "Display Button Choice")) (dbuffer (get-buffer-create (concat "=F0=92=86=B3 " bfname))) ) (with-current-buffer dbuffer (erase-buffer) (insert message) (goto-char (point-min))) (display-buffer dbuffer) )) ;; ---------------------------------------------------- (defun trm-button-choices (&optional bfrn) "TODO" (interactive (list (let ( (rqmatch nil) (cseq '("Default" "Choices")) ) (completing-read " Display Name: " cseq nil rqmatch "Choices"))= )) (let* ( (bfname (or bfrn "Choices")) (dbuffer (get-buffer-create (concat "=F0=92=86=B3 " bfname))) ) ;; Initialize the dedicated frame if it doesn't exist (unless (frame-live-p frame-display-unit) (setq frame-display-unit (make-frame '((name . "Frame Display Unit"))= ))) (with-current-buffer dbuffer (erase-buffer) ;; Insert a button that shows the info when pressed (insert-button " - " 'action (trm-display-info my-message "Info") 'follow-link t) (insert " Running Non-Interactive Commands")) ;; Display the buffer in the dedicated frame (select-frame-set-input-focus frame-display-unit) (set-window-buffer (frame-selected-window frame-display-unit) dbuffer)))