From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Peter Newsgroups: gmane.emacs.help Subject: endless loop when redefining keys Date: Tue, 17 Oct 2023 17:55:18 +0200 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7680"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 17 18:03:16 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 1qsmXL-0001n6-ET for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 17 Oct 2023 18:03:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qsmVL-0008Jo-7G; Tue, 17 Oct 2023 12:01:11 -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 1qsmVD-0008Em-KL for help-gnu-emacs@gnu.org; Tue, 17 Oct 2023 12:01:08 -0400 Original-Received: from uucp.dinoex.org ([2a0b:f840::12]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qsmVB-0005o8-8J for help-gnu-emacs@gnu.org; Tue, 17 Oct 2023 12:01:03 -0400 Original-Received: from uucp.dinoex.org (uucp.dinoex.org [IPv6:2a0b:f840:0:0:0:0:0:12]) by uucp.dinoex.org (8.17.2/8.17.2) with ESMTPS id 39HG05Lf015777 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Tue, 17 Oct 2023 18:00:06 +0200 (CEST) (envelope-from pmc@citylink.dinoex.sub.org) X-MDaemon-Deliver-To: Original-Received: (from uucp@localhost) by uucp.dinoex.org (8.17.2/8.17.2/Submit) with UUCP id 39HG05YE015776 for help-gnu-emacs@gnu.org; Tue, 17 Oct 2023 18:00:05 +0200 (CEST) (envelope-from pmc@citylink.dinoex.sub.org) Original-Received: from disp.intra.daemon.contact (disp-e.intra.daemon.contact [IPv6:fd00:0:0:0:0:0:0:112]) by admn.intra.daemon.contact (8.17.1/8.17.1) with ESMTPS id 39HFu4eb049323 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK) for ; Tue, 17 Oct 2023 17:56:05 +0200 (CEST) (envelope-from pmc@citylink.dinoex.sub.org) Original-Received: from disp.intra.daemon.contact (localhost [127.0.0.1]) by disp.intra.daemon.contact (8.17.1/8.17.1) with ESMTPS id 39HFtIhS009410 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO) for ; Tue, 17 Oct 2023 17:55:19 +0200 (CEST) (envelope-from pmc@citylink.dinoex.sub.org) Original-Received: (from pmc@localhost) by disp.intra.daemon.contact (8.17.1/8.17.1/Submit) id 39HFtIaj009409 for help-gnu-emacs@gnu.org; Tue, 17 Oct 2023 17:55:18 +0200 (CEST) (envelope-from pmc@citylink.dinoex.sub.org) X-Authentication-Warning: disp.intra.daemon.contact: pmc set sender to pmc@citylink.dinoex.sub.org using -f Content-Disposition: inline X-Milter: Spamilter (Reciever: uucp.dinoex.org; Sender-ip: 0:0:2a0b:f840::; Sender-helo: uucp.dinoex.org; ) X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (uucp.dinoex.org [IPv6:2a0b:f840:0:0:0:0:0:12]); Tue, 17 Oct 2023 18:00:08 +0200 (CEST) Received-SPF: pass client-ip=2a0b:f840::12; envelope-from=pmc@citylink.dinoex.sub.org; helo=uucp.dinoex.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-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:145309 Archived-At: In my first approach to set keys (a few years ago) I had this for my function: (fset 'save-and-exit "^U^X^C") (global-unset-key (kbd "")) (global-set-key (kbd "") 'save-and-exit) Now I found that this does apparently not run my own (newly written) kill-buffer-hook functions, or at least doesn't ask their questions. So for a quick fix I removed the ^U from that code. And now I have an endless loop and need to kill emacs from unix. (Only when there is a modified buffer it should save) I know that the 'fset' is now superfluous, and that I could just bind to 'save-buffers-kill-emacs'. I kept it this way for now only for documentation. But then, why does it loop in this way? It is not from my macros - I removed these for test. To reproduce: - have a clean install - enter this into default.el: (fset 'save-and-exit "^X^C") (global-set-key (kbd "") 'save-and-exit) - run "emacs Testfile" and modify the Testfile - press When pressing ^U^X^C the Testfile is just saved unconditionally - as expected. When pressing ^X^C, there is a prompt to save Testfile. When clicking menu-File-Quit, there is a popup NOT asking for individual buffers, but for all of them at once. When closing the window from WM, the same popup. But when pressing it computes forever. ~~~~~~~~~~~~~~~~~~~ Aapparently there are side-effects with defining keys, which I do not yet understand and which can lead to unexpected looping.