From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 23 08:49:32 2024 Received: (at submit) by debbugs.gnu.org; 23 Nov 2024 13:49:32 +0000 Received: from localhost ([127.0.0.1]:57191 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEqVv-0007yR-OF for submit@debbugs.gnu.org; Sat, 23 Nov 2024 08:49:31 -0500 Received: from lists.gnu.org ([209.51.188.17]:60200) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEqVt-0007yJ-FL for submit@debbugs.gnu.org; Sat, 23 Nov 2024 08:49:29 -0500 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 1tEqVt-0006Ba-2c for bug-gnu-emacs@gnu.org; Sat, 23 Nov 2024 08:49:29 -0500 Received: from mail.eshelyaron.com ([107.175.124.16] helo=eshelyaron.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tEqVr-0001qZ-Po for bug-gnu-emacs@gnu.org; Sat, 23 Nov 2024 08:49:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1732369765; bh=H3EYa/Rpub9BVxiXSRKjp+yOlhwPPScYuReMafwx/no=; h=From:To:Subject:Date:From; b=DIVO0IdAgCBgyH60jWGDFJ1e9HXShhNnxbxSlUshP+w+D7+Cxj+qmrjpsnalMEOFV ZbznvUSIPxg324TCLVtF06rRoxXMzcHZIVzWNVX4YilN/NSh4yx7cuEoBNFDdX9lSy 0BZfcwU9Mz42wDJZXkQbYMEsizMKEy6aXm5eHTQD88GYx3LzwOuwSfW51WyfT7xFH1 PpEqXfWnfS0vMFWzTBm70AXbDHyosnpHQj0FL/yOOVzL+D9lwoLe+LbWii2mwtFSaq UwTliQd0S/GIfsUZRRzR3+kI+qwRcY4kLh1SpW+/647CldFo709guAMhvAs5yPDnIP 2H7Vic+GD6/Ew== From: Eshel Yaron To: bug-gnu-emacs@gnu.org Subject: 31.0.50; [FR] explicit minor mode precedence X-Debbugs-Cc: Stefan Monnier , Sean Whitton X-Hashcash: 1:20:241123:bug-gnu-emacs@gnu.org::XOy5Nt1ODkcFYpko:7WpL Date: Sat, 23 Nov 2024 14:49:23 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=107.175.124.16; envelope-from=me@eshelyaron.com; helo=eshelyaron.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, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Hi, I'm creating this feature request to track an idea that Stefan brought up in bug#74404: > BTW, maybe we should add some notion of minor mode precedence since such > problems are actually fairly common. We could do something similar to > what we do with `add-hook`, so `add-minor-mode` takes care of obeying > the ordering constraints. Currently, the last minor mode to be defined takes precedence over previously defined minor modes, at least in terms of keybindings. This makes it hard-to-impossible for minor modes that need high precedence to "guard" their keybindings from minor modes defined at any later time. An explicit mechanism for specifying minor mode precedence could help. Best, Eshel From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 23 09:03:03 2024 Received: (at control) by debbugs.gnu.org; 23 Nov 2024 14:03:03 +0000 Received: from localhost ([127.0.0.1]:57218 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEqj1-0000D3-1c for submit@debbugs.gnu.org; Sat, 23 Nov 2024 09:03:03 -0500 Received: from mail.eshelyaron.com ([107.175.124.16]:59804 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEqiy-0000CT-7d; Sat, 23 Nov 2024 09:03:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1732370579; bh=AHF61jvcCDwEmYO0CpnP047aRB1BAo07fzWm3T8I+/8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=qS7pNAefzz/w0d0Ua/l1S6DPx+kr5qrzAzCsnExFnaYGgEbRGGaxlU7gUENsRk0ht rrewOVvPzx5FBqfZsjRiBnhq38Ia8d10QZ31DoSn1tc3rNDOjx5WS16sUk8Z0keeXl XJiXz0YEQIy8ij38lTE49ONiRCSaxigoKxyX76bjqBpcgAo93ldTt7NVorc6txNGbS 4yd7jRJRncU1eIC5+DdSFdSXiJTh3Wg7FBb3GYAfl6XL7sYKs514h4Hnfq5U9rn+VR Eu8fVAKAIG57DL5Xi9LkMk9ORb9zcdw7EsjJX/Ddl8xvPR5Zm5EfwxIjzMWKk2PIGE p5vgzT8YKItuw== From: Eshel Yaron To: Sean Whitton Subject: Re: bug#74404: [PATCH] Give Completion Preview bindings higher precedence In-Reply-To: <87mshry40g.fsf@melete.silentflame.com> (Sean Whitton's message of "Fri, 22 Nov 2024 18:08:47 +0800") References: <86ttc5vljy.fsf@gnu.org> <87mshry40g.fsf@melete.silentflame.com> Date: Sat, 23 Nov 2024 15:02:56 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control Cc: Eli Zaretskii , 74404@debbugs.gnu.org, Stefan Monnier X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) close 74492 31.1 quit Hi, Sean Whitton writes: > Hello, > > On Sun 17 Nov 2024 at 12:16pm -05, Stefan Monnier via "Bug reports for > GNU Emacs, the Swiss army knife of text editors" wrote: > >> BTW, maybe we should add some notion of minor mode precedence since such >> problems are actually fairly common. We could do something similar to >> what we do with `add-hook`, so `add-minor-mode` takes care of obeying >> the ordering constraints. > > We could also have a customisation option that allows the user to > override the default priorities. As minor modes are always interned > symbols, this would be possible in a way that it isn't for hook > priorities. I've opened bug#74492 to discuss this broader topic of explicit minor mode precedence. For now, I've pushed my patch solving this particular issue with Completion Preview mode to master (commit 30bcba27c8c). With that, I'm closing this bug. Thanks, Eshel From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 23 22:36:07 2024 Received: (at 74492) by debbugs.gnu.org; 24 Nov 2024 03:36:07 +0000 Received: from localhost ([127.0.0.1]:60231 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tF3Pq-0008Jd-T2 for submit@debbugs.gnu.org; Sat, 23 Nov 2024 22:36:07 -0500 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:10640) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tF3Pm-0008J2-CW for 74492@debbugs.gnu.org; Sat, 23 Nov 2024 22:36:05 -0500 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 528C6441268; Sat, 23 Nov 2024 22:35:55 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1732419354; bh=zEreAn0x65c79qgd+dgL0DndCtr+i/G0W8kglUuGqhg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=HfNLXMXo+LWsTbQGPslC++W5o3XNtjaI1a/JLS1tWxYUnk/pYh+tOE5EyxL6jHV54 EA74bOXW/tc29r+AEuSjhpQS8cmw5M0XqIkvnFLBpqIpw8S1vYGqr0GpGmgHdfHDsH uqfqbx2aoMQLu4FXHgFy9YjIMpQ1rNOKLeiZAtH02Rb6jAWztfQJnXOxQV0wTaP8rl iLw5Zll3LIozL8tH5zcbYKj/jNWubcxp6s9C62APr7hjARyGAz8TD8q/d5IAspP5Zm nZsctg1+U7bGifnSuD7eRJW42vw39ySfiAxoNOKYvVz/lPpyr58dUhjJOyk9RAcOeM zwiGmXytQ3VUQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id F3E4944125C; Sat, 23 Nov 2024 22:35:53 -0500 (EST) Received: from pastel (104-195-225-43.cpe.teksavvy.com [104.195.225.43]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id C3E221206EB; Sat, 23 Nov 2024 22:35:53 -0500 (EST) From: Stefan Monnier To: Eshel Yaron Subject: Re: bug#74492: 31.0.50; [FR] explicit minor mode precedence In-Reply-To: (Eshel Yaron's message of "Sat, 23 Nov 2024 14:49:23 +0100") Message-ID: References: Date: Sat, 23 Nov 2024 22:35:53 -0500 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL -0.018 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 74492 Cc: 74492@debbugs.gnu.org, Sean Whitton X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> BTW, maybe we should add some notion of minor mode precedence since such >> problems are actually fairly common. We could do something similar to >> what we do with `add-hook`, so `add-minor-mode` takes care of obeying >> the ordering constraints. > > Currently, the last minor mode to be defined takes precedence over > previously defined minor modes, at least in terms of keybindings. This > makes it hard-to-impossible for minor modes that need high precedence to > "guard" their keybindings from minor modes defined at any later time. > An explicit mechanism for specifying minor mode precedence could help. We should first try and figure out what it is that's really needed, tho. So I took a quick look at Emacs's own code and so far I found: ;; Define-minor-mode added our keymap to minor-mode-map-alist, but we want it ;; on minor-mode-overriding-map-alist instead. (setq minor-mode-map-alist (delq (assq 'completion-in-region-mode minor-mode-map-alist) minor-mode-map-alist)) in `minibuffer.el` which is related but can't just use a precedence because we want to change the keymap dynamically anyway. ;; Add a custom keymap for `visual-line-mode' so that activating ;; this minor mode does not override Org's keybindings. ;; FIXME: Probably `visual-line-mode' should take care of this. (let ((oldmap (cdr (assoc 'visual-line-mode minor-mode-map-alist))) (newmap (make-sparse-keymap))) (set-keymap-parent newmap oldmap) (define-key newmap [remap move-beginning-of-line] nil) (define-key newmap [remap move-end-of-line] nil) (define-key newmap [remap kill-line] nil) (make-local-variable 'minor-mode-overriding-map-alist) (push `(visual-line-mode . ,newmap) minor-mode-overriding-map-alist)) in `org.el` which is related but couldn't just use a precedence either. ;; Make sure we are first in minor-mode-map-alist (let ((c (assq 'orgtbl-mode minor-mode-map-alist))) ;; FIXME: maybe it should use emulation-mode-map-alists? (and c (setq minor-mode-map-alist (cons c (delq c minor-mode-map-alist))))) in `org-table.el` should could definitely use a precedence. and that's it. There used to be more for things like IDO or Viper, but IIRC that was solved with the introduction of `emulation-mode-map-alists`. I know there are more cases of "minor mode precedence" issues. E.g. I remember seeing recently an issue in VM where the `w3m` minor mode bindings used when rendering some HTML email body shadowed the buffer's major mode, but again a case where precedence between minor modes wouldn't help. I don't think the examples above justify adding the kind of precedences I suggested. Maybe if we find more examples out there in the wild, the picture might change. Otherwise, maybe we should look for something else that would solve the kinds of problems listed here. Stefan From unknown Fri Aug 15 15:36:15 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 22 Dec 2024 12:24:17 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator