From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id IHJZBX0LgGfiaAEA62LTzQ:P1 (envelope-from ) for ; Thu, 09 Jan 2025 17:46:37 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id IHJZBX0LgGfiaAEA62LTzQ (envelope-from ) for ; Thu, 09 Jan 2025 18:46:37 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=XUlXWC5n; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1736444796; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=X0eDJu2wfh3yg11kaYMeoZo5G7osMIk1mv8Pia9QngQ=; b=DdY8veigV1IUJ4WE8rjc3/xaI6EJ1F9ixNPTnXTfFJ8+6vLvAxHcOQseIiqgWXBlaoEwlO IEEIEcBYFUtAObl9QYMRxULgp//ITS8EAymZVd0B5++pGDaKJwxao0PE8vUo0GiNVR6ot4 Z0+/ZHGZEyKij2Wip63KDkc4F4GzyhGYDSM+QeJF2LXfRgbreWII0BRKc4vIRVPSyvllVA ewQnxgvr5GNcDTYA2jhbdeHbO9ne/+ZedAZOsoHpjYBw1y2/r+mOJnf6ECrj65ElI3f6tC FJSuTvc4APDyH5lXye01f+sh6YiRAbplngYCv/gZIAGGyb1axc1JyEl06musPw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=XUlXWC5n; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1736444796; a=rsa-sha256; cv=none; b=Hw3ee72zwMxuQrQRZcvFJOjfm3c4p1bOOoGm064yp1hT5kLQYyG8YjLCemT9VYEuRqlBCr QFTa8OPppf/zBwBrIAwp4TUTLCqKfB0PX0RZP7LIGRpJGhfokOsr1rPPh+RQniNpTAgzVI KL1do6IC1az0Vq5ojyQFyOUB5pOv42L0UcpTdCdBH8H3eewx2qT84N9oSagerOrNolSZQ6 ApU5et1XOTYNw4hLDEaTMx0/W8b339Covpf5DOJYXeVdJC1RM8LkfWgqUxk7E+NYLIwh0T i6GbHx6LwCiy3+zGmyjXynQoq2lSyvZWXfOwzWvioFHT9h+RHBDL3XkWkOJhGw== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A606680BCC for ; Thu, 09 Jan 2025 18:46:36 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVwbH-0008Qy-K8; Thu, 09 Jan 2025 12:45:43 -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 1tVwb4-0008QD-Nm for emacs-orgmode@gnu.org; Thu, 09 Jan 2025 12:45:37 -0500 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tVwb2-0005AM-AL for emacs-orgmode@gnu.org; Thu, 09 Jan 2025 12:45:30 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 96C76240101 for ; Thu, 9 Jan 2025 18:45:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1736444724; bh=fWJY5QikxBnLbtRm2sxisAxci7scJCTyxh+8rwD7UsQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: From; b=XUlXWC5nna1tkCKdKwCpzdtyBDHti8Zb/D4tzFtgRZfkJEec8UqRtrOGPhQ00wgu8 lEZhSX5+lvtnnHH8cgL6EEMHz8yxQsCxsIxOdjwwlEBfmF71zn2Q3NcyqwpgF6ni/M vSacylyVgJN1FyVsmibuMuLmBDcqO+mnm1uTvRMgR3YpjLb3O3C42WqCps2ak9O0Mj lZWFX3dun5mgGbWU0/K75AU9ByZUWpSdPGi9HQO9U5mcJGleidqvke2nK5OqZwK4Aq VhiAuZiNJiKStZa3ykg4RegAvuyjuAU7v01o0UzbKH3vMI8VYe4+EQ5tVXh8cpFKOE 4EHPv7TyQvhXQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4YTXHm0QMVz6tw2; Thu, 9 Jan 2025 18:45:24 +0100 (CET) From: Ihor Radchenko To: Visuwesh Cc: emacs-orgmode@gnu.org Subject: Re: [PATCH] Turn org-mouse features into minor-modes In-Reply-To: <8734htvkvz.fsf@gmail.com> References: <87seqad1sl.fsf@gmail.com> <874j2p7crt.fsf@localhost> <878qrmudzu.fsf@gmail.com> <8734htvkvz.fsf@gmail.com> Date: Thu, 09 Jan 2025 17:47:45 +0000 Message-ID: <87a5bz6fr2.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: -5.04 X-Spam-Score: -5.04 X-Migadu-Queue-Id: A606680BCC X-TUID: E9syiBNfUQvJ Visuwesh writes: > Subject: [PATCH] org-mouse: Make it possible to turn on and off the feature Thanks for the update! See my comments inline. > +*** ~org-mouse~ is no longer activated by default by anymore + by anymore+ > +To enable the ~org-mouse~ features, the new minor-modes > +~org-mouse-minor-mode~ and ~org-mouse-agenda-minor-mode~ should be > +enabled. > + > +To turn on the features in all ~org-mode~ and ~org-agenda-mode~ > +buffers, you can use the globalized versions > +~global-org-mouse-minor-mode~ and ~global-org-mouse-agenda-minor-mode~. Please also add a small code snippet users may put into config to enable the previous behavior. Something like #+begin_src emacs-lisp (global-org-mouse-minor-mode +1) (global-org-mouse-agenda-minor-mode +1) #+end_src We likely want to autoload the minor modes. > +(defvar-local org-mouse--old-mouse-map (copy-keymap org-mouse-map)) > ... > + (when org-mouse-minor-mode > + ;; Without `copy-keymap', later `org-defkey' calls modify the > + ;; value of keymap `org-mouse--old-mouse-map' holds. > + (setq org-mouse--old-mouse-map (copy-keymap org-mouse-map))) > + (setq org-mouse-map (copy-keymap org-mouse--old-mouse-map)) > + (org-defkey org-mouse-minor-mode-map [S-mouse-2] nil) > + (org-defkey org-mouse-minor-mode-map [drag-mouse-3] nil) > + (when org-mouse-minor-mode > + (when (memq 'context-menu org-mouse-features) > + (org-defkey org-mouse-map [mouse-3] nil) > + (org-defkey org-mouse-map [C-drag-mouse-1] #'org-mouse-move-tree) > + (org-defkey org-mouse-map [C-down-mouse-1] #'org-mouse-move-tree-start)) > ... `org-mouse--old-mouse-map' is awkward. May we use :enable + menu item instead? -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at . Support Org development at , or support my work at