Hello, org-edit-src-exit suddenly completely destroys my code after coming back from vacation. No known recent changes in configuration. Very strange error! EXAMPLE: here a simple code before editing #+BEGIN_SRC R mtcars sum(mtcars$mpg, na.rm = TRUE) mean(mtcars$disp) #+END_SRC I enter to edit (org-edit-special), change the order of two lines and add a number: Result I should get in source buffer after exiting: #+BEGIN_SRC R mtcars mean(mtcars$disp) 123456789 sum(mtcars$mpg, na.rm = TRUE) #+END_SRC What I get in source buffer on org-edit-src-exit: (no joke!) #+BEGIN_SRC R rmtcars s ean(m sums$di(p)mt123456789 cars$mpg, na.rm = TRUE) mean #+END_SRC Came back from vacation and suddenly this happens. Only updates to server, elpa / melpa has not been updated the last three weeks. Emacs reinstallation did not help, launching without Emacs 26.1 build 2 (2021-01-31) modified by debian org version 9.4.6
Hi, This has been reported before. There's a patch that fixes this here : https://lists.gnu.org/archive/html/emacs-orgmode/2021-06/msg00007.html To fix this bug, you can can either apply this patch, downgrade org, or update emacs to 27. Could anyone with commit access have a look and apply this patch to master ? Regards, -- Sébastien Miquel
Hello,
thank you very much! Update to 27 solved the problem.
All the best,
Michael
Am 22.06.2021 um 15:33 schrieb Sébastien Miquel:
> Hi,
>
> This has been reported before.
>
> There's a patch that fixes this here :
> https://lists.gnu.org/archive/html/emacs-orgmode/2021-06/msg00007.html
>
> To fix this bug, you can can either apply this patch, downgrade org,
> or update emacs to 27.
>
> Could anyone with commit access have a look and apply this patch to
> master ?
>
> Regards,
>
[-- Attachment #1: Type: text/plain, Size: 928 bytes --] Hi, is org mode rebinding keys in the calendar? I ask, because I've been using traditional calendar+diary; now, when I try to insert an entry (i-d in calendar), I get "Wrong type argument: commandp, org-agenda-diary-entry" The following experiment points in Org's general direction: - emacs -Q - M-x calendar - with point on some date, i-d - diary buffer is open, with a new line primed with date - M-x load-library <RET> "org" - again, in calendar, i-d - the above error results. I'm not sure yet whether I fat-fingered something, so I'd like some hints in investigating before declaring this to be a bug. My emacs is a home build, fairly recent: GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 2.24.32, cairo version 1.16.0) of 2021-06-15 Org is: Org mode version 9.4.4 (release_9.4.4 @ /usr/local/share/emacs/28.0.50/lisp/org/) Thanks for any hints, cheers - t [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --]
Hi. > is org mode rebinding keys in the calendar? Yes. "c" calls the Org agenda. "i" in the calendar calls org-agenda-diary-entry when org-agenda-diary-file has been configured. (See function org--setup-calendar-bindings.) > I ask, because I've been using traditional calendar+diary; now, > when I try to insert an entry (i-d in calendar), I get > > "Wrong type argument: commandp, org-agenda-diary-entry" > The following experiment points in Org's general direction: > > - emacs -Q > - M-x calendar > - with point on some date, i-d > - diary buffer is open, with a new line primed with date > - M-x load-library <RET> "org" > - again, in calendar, i-d > - the above error results. > > I'm not sure yet whether I fat-fingered something, so I'd like > some hints in investigating before declaring this to be a bug. Thanks for providing a detailed path to the error. But I can't reproduce this error; I get - diary buffer is open, with a new line primed with date instead of the error. Since you start with -Q and command org-agenda-diary-entry is a command in org-agenda this looks suspicious AFAICT. Does the - M-x load-library <RET> "org" mix in some weird Org version and/or setting? And btw why load Org a second time? Best regards, -- Marco
[-- Attachment #1: Type: text/plain, Size: 1759 bytes --] On Wed, Jun 23, 2021 at 05:16:50PM +0200, Marco Wahl wrote: > Hi. > > > is org mode rebinding keys in the calendar? > > Yes. "c" calls the Org agenda. > > "i" in the calendar calls org-agenda-diary-entry when > org-agenda-diary-file has been configured. (See function > org--setup-calendar-bindings.) Thanks! This must be it, I'll have a look and report back. > > I ask, because I've been using traditional calendar+diary; now, > > when I try to insert an entry (i-d in calendar), I get > > > > "Wrong type argument: commandp, org-agenda-diary-entry" > > > The following experiment points in Org's general direction: > > > > - emacs -Q > > - M-x calendar > > - with point on some date, i-d > > - diary buffer is open, with a new line primed with date > > - M-x load-library <RET> "org" > > - again, in calendar, i-d > > - the above error results. > > > > I'm not sure yet whether I fat-fingered something, so I'd like > > some hints in investigating before declaring this to be a bug. > > Thanks for providing a detailed path to the error. But I can't > reproduce this error; I get > > - diary buffer is open, with a new line primed with date > > instead of the error. I must have mis-communicated. The above (i.e. diary buffer opens with no error) happens after the -Q. Note that it is the non-org diary. > Since you start with -Q and command org-agenda-diary-entry is a command > in org-agenda this looks suspicious AFAICT. > > Does the > > - M-x load-library <RET> "org" > > mix in some weird Org version and/or setting? And btw why load Org a > second time? No, it is the first load of org. I'll look into org-agenda diary file, as you suggest above. Cheers - t [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --]
[-- Attachment #1: Type: text/plain, Size: 523 bytes --] On Wed, Jun 23, 2021 at 05:28:36PM +0200, tomas@tuxteam.de wrote: [calendar insert-diary-entry doing funny things] OK, I solved it by setting `org-calendar-insert-diary-entry-key' to [106], which is a ?j. It was set to ?i, which hijacked calendar's original key map. Now I still don't know whether it's intended that Org hijacks that key in calendar, whether I did something stupid, but at least I have my toys back. Just remember to not push ?j. Anyway, you set me on the right track, so thanks for that! Cheers - t [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --]
On Wed, 23 Jun 2021 18:16:52 +0200 tomas@tuxteam.de wrote: > On Wed, Jun 23, 2021 at 05:28:36PM +0200, tomas@tuxteam.de wrote: > > [calendar insert-diary-entry doing funny things] > > OK, I solved it by setting `org-calendar-insert-diary-entry-key' to > [106], which is a ?j. It was set to ?i, which hijacked calendar's > original key map. > > Now I still don't know whether it's intended that Org hijacks that > key in calendar, whether I did something stupid, but at least I have > my toys back. Just remember to not push ?j. > > Anyway, you set me on the right track, so thanks for that! See also bug#48199 (also CC'd at https://lists.gnu.org/archive/html/emacs-orgmode/2021-05/msg00582.html). I continue to use the patch I posted there and have had no problems with it (but I don't use org-mode much). Steve Berman
[-- Attachment #1: Type: text/plain, Size: 1195 bytes --] On Thu, Jun 24, 2021 at 12:13:40PM +0200, Stephen Berman wrote: > On Wed, 23 Jun 2021 18:16:52 +0200 tomas@tuxteam.de wrote: > > > On Wed, Jun 23, 2021 at 05:28:36PM +0200, tomas@tuxteam.de wrote: > > > > [calendar insert-diary-entry doing funny things] > > > > OK, I solved it by setting `org-calendar-insert-diary-entry-key' to > > [106], which is a ?j. It was set to ?i, which hijacked calendar's > > original key map. > > > > Now I still don't know whether it's intended that Org hijacks that > > key in calendar, whether I did something stupid, but at least I have > > my toys back. Just remember to not push ?j. > > > > Anyway, you set me on the right track, so thanks for that! > > See also bug#48199 (also CC'd at > https://lists.gnu.org/archive/html/emacs-orgmode/2021-05/msg00582.html). > I continue to use the patch I posted there and have had no problems with > it (but I don't use org-mode much). Oh, I see, thanks. For me, it's a bit confusing that this bug receives so little attention. Hijacking other modes's keymaps isn't... friendly, after all. I can't imagine that it is happening by intention. Cheers & thanks for the background. -- tomás [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --]
On Thu, 24 Jun 2021 14:09:46 +0200 tomas@tuxteam.de wrote:
> On Thu, Jun 24, 2021 at 12:13:40PM +0200, Stephen Berman wrote:
>> On Wed, 23 Jun 2021 18:16:52 +0200 tomas@tuxteam.de wrote:
>>
>> > On Wed, Jun 23, 2021 at 05:28:36PM +0200, tomas@tuxteam.de wrote:
>> >
>> > [calendar insert-diary-entry doing funny things]
>> >
>> > OK, I solved it by setting `org-calendar-insert-diary-entry-key' to
>> > [106], which is a ?j. It was set to ?i, which hijacked calendar's
>> > original key map.
>> >
>> > Now I still don't know whether it's intended that Org hijacks that
>> > key in calendar, whether I did something stupid, but at least I have
>> > my toys back. Just remember to not push ?j.
>> >
>> > Anyway, you set me on the right track, so thanks for that!
>>
>> See also bug#48199 (also CC'd at
>> https://lists.gnu.org/archive/html/emacs-orgmode/2021-05/msg00582.html).
>> I continue to use the patch I posted there and have had no problems with
>> it (but I don't use org-mode much).
>
> Oh, I see, thanks. For me, it's a bit confusing that this bug receives
> so little attention. Hijacking other modes's keymaps isn't... friendly,
> after all. I can't imagine that it is happening by intention.
Yeah, the next time Org is merged to the Emacs master branch, forcing me
to first stash and then reapply my patch locally, I'll ask if anyone
objects to the patch being committed to master. Maybe that will get
someone's attention (and if not, I may just go ahead and commit it -- if
it then still gets no one's attention, it must be ok ;-).
Steve Berman
Hello,
Stephen Berman <stephen.berman@gmx.net> writes:
> Yeah, the next time Org is merged to the Emacs master branch, forcing me
> 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.
Regards,
--
Nicolas Goaziou
[-- Attachment #1: Type: text/plain, Size: 411 bytes --] On Thu, Jun 24, 2021 at 05:04:02PM +0200, Nicolas Goaziou wrote: > Hello, > > Stephen Berman <stephen.berman@gmx.net> writes: > > > Yeah, the next time Org is merged to the Emacs master branch, forcing me > > 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. Warm thanks, you both! :) Cheers - t [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --]
Stephen Berman <stephen.berman@gmx.net> writes:
> On Thu, 24 Jun 2021 14:09:46 +0200 tomas@tuxteam.de wrote:
>
>> On Thu, Jun 24, 2021 at 12:13:40PM +0200, Stephen Berman wrote:
>>> On Wed, 23 Jun 2021 18:16:52 +0200 tomas@tuxteam.de wrote:
>>>
>>> > On Wed, Jun 23, 2021 at 05:28:36PM +0200, tomas@tuxteam.de wrote:
>>> >
>>> > [calendar insert-diary-entry doing funny things]
>>> >
>>> > OK, I solved it by setting `org-calendar-insert-diary-entry-key' to
>>> > [106], which is a ?j. It was set to ?i, which hijacked calendar's
>>> > original key map.
>>> >
>>> > Now I still don't know whether it's intended that Org hijacks that
>>> > key in calendar, whether I did something stupid, but at least I have
>>> > my toys back. Just remember to not push ?j.
>>> >
>>> > Anyway, you set me on the right track, so thanks for that!
>>>
>>> See also bug#48199 (also CC'd at
>>> https://lists.gnu.org/archive/html/emacs-orgmode/2021-05/msg00582.html).
>>> I continue to use the patch I posted there and have had no problems with
>>> it (but I don't use org-mode much).
>>
>> Oh, I see, thanks. For me, it's a bit confusing that this bug receives
>> so little attention. Hijacking other modes's keymaps isn't... friendly,
>> after all. I can't imagine that it is happening by intention.
>
> Yeah, the next time Org is merged to the Emacs master branch, forcing me
> to first stash and then reapply my patch locally, I'll ask if anyone
> objects to the patch being committed to master. Maybe that will get
> someone's attention (and if not, I may just go ahead and commit it -- if
> it then still gets no one's attention, it must be ok ;-).
>
My view is that if org-mode is stealing the calendar bindings by default
i.e. user has not enabled some specific option/configuration to do this,
then this is a bug. Org should not interfere with the key bindings of
any mode unless asked to. Some people still like to use traditional
Emacs diary rather than org agenda for scheduling meetings/appointments,
but like to use (load) org for other things (like document authoring and
TODO lists). Org should only override the calendar bindings if
requested.
If your patch fixes this, I vote to apply it to master.
--
Tim Cross
[-- Attachment #1: Type: text/plain, Size: 321 bytes --] On Fri, Jun 25, 2021 at 06:54:25AM +1000, Tim Cross wrote: [...] > My view is that if org-mode is stealing the calendar bindings by default > i.e. user has not enabled some specific option/configuration to do this, > then this is a bug [...] AFAIU, Stephen just gave his green light to Stephen's patch :-) Cheers - t [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 198 bytes --]