From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Must prevent switching from recursive edit buffers Date: Wed, 18 Dec 2024 10:50:03 +0300 Message-ID: <2756a07624cab7ceb1c68dd24e671ef7.support1@rcdrun.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11187"; mail-complaints-to="usenet@ciao.gmane.io" To: Help GNU Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Dec 18 08:51:29 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 1tNoq8-0002nV-P8 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 18 Dec 2024 08:51:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNopT-0003oK-GU; Wed, 18 Dec 2024 02:50:47 -0500 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 1tNopR-0003nq-BZ for help-gnu-emacs@gnu.org; Wed, 18 Dec 2024 02:50:45 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNopP-0001BL-KX for help-gnu-emacs@gnu.org; Wed, 18 Dec 2024 02:50:44 -0500 Original-Received: from localhost ([::ffff:41.75.185.143]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000001BF24.0000000067627EAE.000B7A30; Wed, 18 Dec 2024 00:50:05 -0700 Received-SPF: pass client-ip=217.170.207.13; envelope-from=support1@rcdrun.com; helo=stw1.rcdrun.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.248, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no 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:148873 Archived-At: I would like to find the solution to prevent me as user to switch away from the recursive edit. Recursive edit is not file editing. In my case it is editing of the database values, in general strings. That is what I am using currently 7200 times per month, and do not need different solution at this moment. I would like to ensure, that if I am switching away from a buffer which I am editing with `recursive-edit', that I am warned, or that I can ensure that switch is detected, so that I can invoke other functions such as asking user to save buffer, or automatically saving it, or closing the buffer. I am testing this variable: (add-hook 'window-buffer-change-functions 'my-speak nil t) I can see: Its value is (my-speak) Local in buffer *mail*; global value is nil (defun my-speak (&optional window) (rcd-message "%s" window) (rcd-speak "Hello there")) And I can here voice when I for example, split the window. And I can see message: # Which is alright, but I cannot hear message when I switch away from buffer. If I give it global value, then it will give me message. That means it will be invoked in the other buffer, but then how do I recognize that previous buffer is the one with recursive edit? Maybe I could make function to switch to window quickly, recognize if it has recursive edit, or maybe recognize if some buffer local variable has been set, to stop that recursive edit or record value from inside. I see this on above change: # Best would be to have list of recursive edit buffers but sadly I do not know how to get it. All I can see is in modeline [(Mail WK Fill)] which indicates there is one or 3-4 or 10 pending recursive buffers, but they are not shown in any list. If I list all buffers, and delete all of them, recursive-edit buffers still remain hidden. Maybe solution could be setting up global functions for 'window-buffer-change-functions to detect at other window, if recursive-edit buffer is still open, in order to close it, save buffer into the database; (abort-recursive-edit) is not quite a solution, as that means my editing my be lost. Basically, I would like to keep 1 recursive-edit at maximum, not more. I appreciate if someone finds better approach to solve the problem of pending recursive-edit buffers. Jean