From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id sMOFGmWg1WDFPQAAgWs5BA (envelope-from ) for ; Fri, 25 Jun 2021 11:22:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id AM0/FmWg1WAlGwAA1q6Kng (envelope-from ) for ; Fri, 25 Jun 2021 09:22:45 +0000 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 760CA19B3A for ; Fri, 25 Jun 2021 11:22:44 +0200 (CEST) Received: from localhost ([::1]:49102 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lwi2s-00089w-VK for larch@yhetil.org; Fri, 25 Jun 2021 05:22:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:53278) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwhw8-0004HO-Dq for emacs-orgmode@gnu.org; Fri, 25 Jun 2021 05:15:44 -0400 Received: from mout.gmx.net ([212.227.17.21]:59953) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lwhw5-0004DN-KA for emacs-orgmode@gnu.org; Fri, 25 Jun 2021 05:15:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1624612532; bh=8npvVtZWaNe/jGmFRipz2oyHVi1XtuW4ZKc4cs93/78=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=Cm2nFZB6OZxIoAoElPVGXQZr4fbJJdDbVbldEsS0CpFKm+vMUJSDxKNR8hnVjDx9a 3oxImGptJbnBl+6KvUtxtnEBNmAiynJ6u2WK09Twewc5O4wTop9ahUuPDgekcecK8T Lm9tJNIHbWCsxeqUkgqsbfBQqJdmb+FHMSiuXcfk= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from strobelfs ([178.1.126.121]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M4s0t-1lvsSC47vz-001vvA; Fri, 25 Jun 2021 11:15:32 +0200 From: Stephen Berman To: 48199-done@debbugs.gnu.org Subject: Re: bug#48199: 28.0.50; Org mode surprisingly usurps Calendar key binding References: <87eeen243m.fsf@gmx.net> <878s4nomas.fsf@gmx.net> Date: Fri, 25 Jun 2021 11:15:30 +0200 In-Reply-To: <878s4nomas.fsf@gmx.net> (Stephen Berman's message of "Sun, 09 May 2021 19:21:31 +0200") Message-ID: <87zgvei9u5.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:Tts7J9Pq+t1MWNjK7hd5keYB0WZTqQsiccv+XyPYnOQH4aIZetT KqdFmItjWjY8kKogBdBShp4v6qRFbf4r7fKXVZqcYR8ZAVu1SvmGOIglX6JHwS86kJDwBsV 9aLObPZc55GO5BFnfCpbZ3wU1aejqnNDo7Jbiv5Z8VTq2XGwhdgZHN9gSVZcD/LFrHY2Bie Sfpz4ZEGEpzxhtrqxHP6g== X-UI-Out-Filterresults: notjunk:1;V03:K0:a4DzqTuixMg=:HY+SzbmTu+Ic8emcSpdXTj +CCNovElcpaIRVstOta2VsZs58tfP4Wyhu98OgP/A5JB9cHe4Db6Rpy19C4WUHkEMUQcqVwxC Lcl1u3DuPYSMxjPpEymLkzWtdA2hV6xEBXhmVex0QlrQN7b8/gX/eidDQ7QHIgn7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.21; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net 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_H2=-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.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624612965; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=VG56vVXQ3SOi4Jia144Fs+b05JiBBo8gA6hJ8iYWQT0=; b=cQyGF71rh7IXzHIVnCZsW5u3SDe4VLla5Q9MDNX8he30gkKdDHiztqa37SZncHe3AUfnBG FUzvTF5XXG3o3OIs3iAGb2zzgPg6VzHnMwLooV8Illh5XAbtOSj48lJOjmK4jS3wug6gNV 7YrV2/zvLNWUQjfeHOhMmmty9zCE5zdzZhLzJjVtDDXAnWMTcXoa6svljhUNLKU0DvykfL YkwiQuYHErDxdQjNQhhR9GLtE9U9S6MQnrE39neKVi1NdGA/0xvuYaSe9VaqTnzhhIThUG UAltmAV30vAC+3TDye2A3kiSz7up0+zhX+qPmc/3xGVC7WCJY7IbQAFkZeliDQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624612965; a=rsa-sha256; cv=none; b=locx1mVyZB0aIVhRt+6CLoWB7k297MR0EZYED06AZKdL6lj5WJZ0GxdSpqDZ44A2xBqO0B hoHzOf9MHFKc1u8C/swSb0njSGFszuk9eZmkLBY29l5yfXwnr2hD6NMl9jdsHFcL5+FySk xsXP6WnYNruk+1oo2NPUsCdGXaTjqMkzXRzpIGRSyyZiGx8c+56b3N6dFoYVZcHqQluzc3 pKwKgk5oEeIPHzf6hbZn3uHj4kVeXa1jCl4UuGHSSRfxjh+mANbbivi2isH//aYkrmc5nS gqeWk0vdkf223p+2JHfv2GsiXdiKrohAXOr4nqIacHYPPbK7WyTfUlO80jukqQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=Cm2nFZB6; dmarc=pass (policy=none) header.from=gmx.net; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -0.63 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmx.net header.s=badeba3b8450 header.b=Cm2nFZB6; dmarc=pass (policy=none) header.from=gmx.net; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 760CA19B3A X-Spam-Score: -0.63 X-Migadu-Scanner: scn0.migadu.com X-TUID: 1bHhUNJW7nTf On Sun, 09 May 2021 19:21:31 +0200 Stephen Berman = wrote: > [I added emacs-orgmode@gnu.org in the Cc:] > > On Mon, 03 May 2021 18:07:25 +0200 Stephen Berman wrote: > >> By default `i' is a prefix key in calendar-mode for commands that inser= t >> diary entries. But if you happen to display a buffer that activates >> org-mode machinery, then `i' in calendar-mode becomes bound to >> org-agenda-diary-entry and typing it can raise a wrong-type-argument >> error. This can happen by visiting a file in Org mode. To reproduce: >> >> 0. emacs -Q >> 1. (sanity check:) Type `M-x calendar RET' and then in the Calendar >> buffer type `i C-h': the *Help* buffer displays all the commands >> invoked by `i' plus one or more keys. >> 2. Visit the file `ORG-NEWS' (e.g. by typing `C-h n C-x C-f O TAB RET')= . >> 3. Type `M-x calendar RET' and then in the Calendar buffer type `i' >> =3D> Wrong type argument: commandp, org-agenda-diary-entry >> >> This can also catch users by surprise, e.g. in Gnus. To reproduce, >> replace step 2 above by the following: >> >> 2a. Type `M-x gnus', answer `y' at the prompt; in the Gnus buffer type >> `B RET news.gmane.io RET'. >> 2b. In the *Gnus Browse Server* buffer type `C-s humani' to put point o= n >> the gmane.emacs.humanities group; type RET to enter it. >> 2c. Type `j <87sg6wulu6.fsf@localhost> RET', which displays an article >> containing an org-mode source code block. >> 3. As above, resulting in the same error (when done from emacs -Q). >> >> The Org mode manual (info "(org) Agenda Commands") does describe its us= e >> of the `i' binding in the Calendar, and if Org mode has its own version= s >> of the commands that use `i' by default in calendar-mode, then >> overriding the calendar-mode bindings is no problem for Org Agenda >> users, but those bindings should not be overridden just by displaying a >> buffer that happens to be in org-mode or happens to contain an Org >> source code block. > > The following patch fixes the problem for me: > > diff --git a/lisp/org/org-compat.el b/lisp/org/org-compat.el > index 1f4e2e8308..b68e5b58fc 100644 > --- a/lisp/org/org-compat.el > +++ b/lisp/org/org-compat.el > @@ -1151,8 +1151,8 @@ org--setup-calendar-bindings > ((guard (not (lookup-key calendar-mode-map "c"))) > (local-set-key "c" #'org-calendar-goto-agenda)) > (_ nil)) > - (unless (and (boundp 'org-agenda-diary-file) > - (eq org-agenda-diary-file 'diary-file)) > + (when (and (boundp 'org-agenda-diary-file) > + (not (eq org-agenda-diary-file 'diary-file))) > (local-set-key org-calendar-insert-diary-entry-key > #'org-agenda-diary-entry))) > > > > I have to admit, though, that I don't understand why the version with > `unless' results in the bug, since in the recipes I gave > org-agenda-diary-file is unbound and, indeed, when I instrument the > unpatched org--setup-calendar-bindings and step through it on calling > `calendar', the org-calendar-insert-diary-entry-key local-set-key call > is skipped as expected. But "c" does get locally set, so if I type `c' > in the Calendar buffer, it displays the Org Agenda, and if I then type > `i' in the Calendar buffer, I now get prompted with a choice menu for > the type of diary entry, but whichever I choose, the result is the > user-error "Don't know which date to use for diary entry", evidently > because there is indeed no org-agenda-diary-file with the necessary text > properties. So somehow the "i" binding is made even though the code > should prevent this (and does under Edebug but not when executed > normally). > > With the above patch, after typing `c' in the Calendar buffer, `i' is > still unbound, as it should be, but if I changed the value of > org-agenda-diary-file from the default 'diary-file to some file, then > `i' works with Org Agenda as documented. > > Steve Berman On Thu, 24 Jun 2021 17:04:02 +0200 Nicolas Goaziou wrote: > Hello, > > Stephen Berman writes: > >> Yeah, the next time Org is merged to the Emacs master branch, forcing m= e >> to first stash and then reapply my patch locally, I'll ask if anyone >> objects to the patch being committed to master. > > Sure, go ahead. Thanks, done in commit 19f2f26 on master. Closing the bug. Steve Berman