all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* C-SPC works; C-u C-SPC doesn't. How could be?
@ 2022-06-24  9:34 Ypo
  2022-06-24 16:06 ` Greg Minshall
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Ypo @ 2022-06-24  9:34 UTC (permalink / raw)
  To: Org-mode

[-- Attachment #1: Type: text/plain, Size: 490 bytes --]

Hi

I have a weird problem that only happens in org-mode. I know very 
little, but I can't think how could this could be possible:

C-SPC works, but

C-u C-SPC doesn't work.

In emacs -q it works as it should, though.


C-h k C-SPC returns:

C-SPC runs the command set-mark-command (found in global-map),
which is an interactive native compiled Lisp function in
‘simple.el’.

It is bound to C-@, C-SPC.

(set-mark-command ARG)

...



C-h k C-u C-SPC returns:

C-u C-SPC is undefined



[-- Attachment #2: Type: text/html, Size: 1519 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: C-SPC works; C-u C-SPC doesn't. How could be?
  2022-06-24  9:34 C-SPC works; C-u C-SPC doesn't. How could be? Ypo
@ 2022-06-24 16:06 ` Greg Minshall
  2022-06-25  0:49   ` Ypo
  2022-06-24 17:31 ` Bruno Barbier
       [not found] ` <62b5f498.1c69fb81.8f12b.b976SMTPIN_ADDED_MISSING@mx.google.com>
  2 siblings, 1 reply; 13+ messages in thread
From: Greg Minshall @ 2022-06-24 16:06 UTC (permalink / raw)
  To: Ypo; +Cc: Org-mode

Ypo,

fwiw, [C-h k C-SPC] has a paragraph that says
----
With prefix argument (e.g., C-u C-SPC), jump to the mark, and set the mark from
position popped off the local mark ring (this does not affect the global
mark ring).  Use C-x C-@ to jump to a mark popped off the global
mark ring (see ‘pop-global-mark’).
----

i don't know if that helps at all.

cheers, Greg


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: C-SPC works; C-u C-SPC doesn't. How could be?
  2022-06-24  9:34 C-SPC works; C-u C-SPC doesn't. How could be? Ypo
  2022-06-24 16:06 ` Greg Minshall
@ 2022-06-24 17:31 ` Bruno Barbier
       [not found] ` <62b5f498.1c69fb81.8f12b.b976SMTPIN_ADDED_MISSING@mx.google.com>
  2 siblings, 0 replies; 13+ messages in thread
From: Bruno Barbier @ 2022-06-24 17:31 UTC (permalink / raw)
  To: Ypo, Org-mode



Ypo <ypuntot@gmail.com> writes:

> C-h k C-u C-SPC returns:
>
> C-u C-SPC is undefined

In my emacs (28 and 29), with or without "-Q":

    C-h k C-u
=>
   (universal-argument)

My emacs doesn't let me query:

   C-h k C-u C-SPC


What about your question about debugging in the other thread ? Did you
try what I suggested there ?

   Subject: Re: Elisp assertion for debugging
   To: Ypo <ypuntot@gmail.com>, Org-mode <emacs-orgmode@gnu.org>
   Date: Sun, 19 Jun 2022 21:11:55 +0200



Bruno




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: C-SPC works; C-u C-SPC doesn't. How could be?
       [not found] ` <62b5f498.1c69fb81.8f12b.b976SMTPIN_ADDED_MISSING@mx.google.com>
@ 2022-06-25  0:32   ` Ypo
  2022-06-25  0:53     ` Ihor Radchenko
                       ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Ypo @ 2022-06-25  0:32 UTC (permalink / raw)
  To: Bruno Barbier, Org-mode

[-- Attachment #1: Type: text/plain, Size: 961 bytes --]

Hi, Bruno

Yes, I tried your assertion for bug-hunter, but it didn't work.

(unless (eq 'universal-argument (keymap-lookup global-map "C-u"))
        (error "C-u has been redefined"))

And you are right: In Emacs with -Q, C-u C-SPC works, but describe-key 
C-u C-SPC doesn't work.

Probably, in the near future, I will have to dissect my .init file by hand.

Thanks!


El 24/06/2022 a las 19:31, Bruno Barbier escribió:
>
> Ypo<ypuntot@gmail.com>  writes:
>
>> C-h k C-u C-SPC returns:
>>
>> C-u C-SPC is undefined
> In my emacs (28 and 29), with or without "-Q":
>
>      C-h k C-u
> =>
>     (universal-argument)
>
> My emacs doesn't let me query:
>
>     C-h k C-u C-SPC
>
>
> What about your question about debugging in the other thread ? Did you
> try what I suggested there ?
>
>     Subject: Re: Elisp assertion for debugging
>     To: Ypo<ypuntot@gmail.com>, Org-mode<emacs-orgmode@gnu.org>
>     Date: Sun, 19 Jun 2022 21:11:55 +0200
>
>
>
> Bruno
>
>

[-- Attachment #2: Type: text/html, Size: 2115 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: C-SPC works; C-u C-SPC doesn't. How could be?
  2022-06-24 16:06 ` Greg Minshall
@ 2022-06-25  0:49   ` Ypo
  0 siblings, 0 replies; 13+ messages in thread
From: Ypo @ 2022-06-25  0:49 UTC (permalink / raw)
  To: Greg Minshall; +Cc: Org-mode

[-- Attachment #1: Type: text/plain, Size: 517 bytes --]

Thanks, Greg.

Yes, I wanted to jump to the mark with C-u C-SPC.

Thanks

El 24/06/2022 a las 18:06, Greg Minshall escribió:
> Ypo,
>
> fwiw, [C-h k C-SPC] has a paragraph that says
> ----
> With prefix argument (e.g., C-u C-SPC), jump to the mark, and set the mark from
> position popped off the local mark ring (this does not affect the global
> mark ring).  Use C-x C-@ to jump to a mark popped off the global
> mark ring (see ‘pop-global-mark’).
> ----
>
> i don't know if that helps at all.
>
> cheers, Greg

[-- Attachment #2: Type: text/html, Size: 1040 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: C-SPC works; C-u C-SPC doesn't. How could be?
  2022-06-25  0:32   ` Ypo
@ 2022-06-25  0:53     ` Ihor Radchenko
  2022-06-25  1:15       ` Ypo
  2022-06-25  7:47     ` Bruno Barbier
       [not found]     ` <62b6bd46.1c69fb81.f4e75.9cf5SMTPIN_ADDED_MISSING@mx.google.com>
  2 siblings, 1 reply; 13+ messages in thread
From: Ihor Radchenko @ 2022-06-25  0:53 UTC (permalink / raw)
  To: Ypo; +Cc: Bruno Barbier, Org-mode

Ypo <ypuntot@gmail.com> writes:

> Yes, I tried your assertion for bug-hunter, but it didn't work.
>
> (unless (eq 'universal-argument (keymap-lookup global-map "C-u"))
>         (error "C-u has been redefined"))

You can also bisect interactively instead of using assertion.
Note that your assertion is not expected to catch anything considering
that the problem is only present inside .org files.

Best,
Ihor


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: C-SPC works; C-u C-SPC doesn't. How could be?
  2022-06-25  0:53     ` Ihor Radchenko
@ 2022-06-25  1:15       ` Ypo
  2022-06-25  3:28         ` Ihor Radchenko
  0 siblings, 1 reply; 13+ messages in thread
From: Ypo @ 2022-06-25  1:15 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Bruno Barbier, Org-mode

[-- Attachment #1: Type: text/plain, Size: 690 bytes --]

Hi Ihor.

elisp-bug-hunter sadly seems to have some bug, so I can't use it 
interactively anymore.

https://github.com/Malabarba/elisp-bug-hunter/issues/29

You are right, about the .org files though.

Thanks

El 25/06/2022 a las 2:53, Ihor Radchenko escribió:
> Ypo<ypuntot@gmail.com>  writes:
>
>> Yes, I tried your assertion for bug-hunter, but it didn't work.
>>
>> (unless (eq 'universal-argument (keymap-lookup global-map "C-u"))
>>          (error "C-u has been redefined"))
> You can also bisect interactively instead of using assertion.
> Note that your assertion is not expected to catch anything considering
> that the problem is only present inside .org files.
>
> Best,
> Ihor

[-- Attachment #2: Type: text/html, Size: 1628 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: C-SPC works; C-u C-SPC doesn't. How could be?
  2022-06-25  1:15       ` Ypo
@ 2022-06-25  3:28         ` Ihor Radchenko
  0 siblings, 0 replies; 13+ messages in thread
From: Ihor Radchenko @ 2022-06-25  3:28 UTC (permalink / raw)
  To: Ypo; +Cc: Bruno Barbier, Org-mode

Ypo <ypuntot@gmail.com> writes:

> elisp-bug-hunter sadly seems to have some bug, so I can't use it 
> interactively anymore.
>
> https://github.com/Malabarba/elisp-bug-hunter/issues/29
>
> You are right, about the .org files though.

I haven't seen any issues using M-x bug-hunter-init-file.
I follow the procedure described in
https://open.tube/videos/watch/4d819114-43bf-42df-af94-f94fc53dd0d9

Best,
Ihor


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: C-SPC works; C-u C-SPC doesn't. How could be?
  2022-06-25  0:32   ` Ypo
  2022-06-25  0:53     ` Ihor Radchenko
@ 2022-06-25  7:47     ` Bruno Barbier
       [not found]     ` <62b6bd46.1c69fb81.f4e75.9cf5SMTPIN_ADDED_MISSING@mx.google.com>
  2 siblings, 0 replies; 13+ messages in thread
From: Bruno Barbier @ 2022-06-25  7:47 UTC (permalink / raw)
  To: Ypo, Org-mode


Hi Ypo,

Ypo <ypuntot@gmail.com> writes:

> Hi, Bruno
>
> Yes, I tried your assertion for bug-hunter, but it didn't work.
>
> (unless (eq 'universal-argument (keymap-lookup global-map "C-u"))
>         (error "C-u has been redefined"))
>

I'm not sure in what way it didn't work and I didn't try bug-hunter yet.


FWIW, just in case it might help you, when I have such a problem, I just
define a function, something like:

   (defun my-check-bug ()
     "Throw an error when C-u is not the universal argument in org-mode."
     (with-temp-buffer
       (org-mode)
       (unless (eq 'universal-argument (keymap-lookup global-map "C-u"))
         (error "C-u has been redefined"))))


Then I add:

   (my-check-bug)
   
everywhere in my init files and I start emacs with --debug-init.

Good luck,

Bruno




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: C-SPC works; C-u C-SPC doesn't. How could be?
       [not found]     ` <62b6bd46.1c69fb81.f4e75.9cf5SMTPIN_ADDED_MISSING@mx.google.com>
@ 2022-06-26 17:22       ` Ypo
  2022-06-26 19:13         ` Bruno Barbier
                           ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Ypo @ 2022-06-26 17:22 UTC (permalink / raw)
  To: Bruno Barbier, Org-mode

[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]

Thanks, Bruno

I've debugged it manually because (keymap-lookup) doesn't seem to exist 
in my emacs, if that's possible.

The problem comes from:

(define-key org-mode-map (kbd "C-u C-n") #'org-next-item)

If I eval that line, "C-u C-SPC" stops working on org-mode.

Same problem in runemacs -q. Is it a bug?


El 25/06/2022 a las 9:47, Bruno Barbier escribió:
> Hi Ypo,
>
> Ypo<ypuntot@gmail.com>  writes:
>
>> Hi, Bruno
>>
>> Yes, I tried your assertion for bug-hunter, but it didn't work.
>>
>> (unless (eq 'universal-argument (keymap-lookup global-map "C-u"))
>>          (error "C-u has been redefined"))
>>
> I'm not sure in what way it didn't work and I didn't try bug-hunter yet.
>
>
> FWIW, just in case it might help you, when I have such a problem, I just
> define a function, something like:
>
>     (defun my-check-bug ()
>       "Throw an error when C-u is not the universal argument in org-mode."
>       (with-temp-buffer
>         (org-mode)
>         (unless (eq 'universal-argument (keymap-lookup global-map "C-u"))
>           (error "C-u has been redefined"))))
>
>
> Then I add:
>
>     (my-check-bug)
>     
> everywhere in my init files and I start emacs with --debug-init.
>
> Good luck,
>
> Bruno
>
>

[-- Attachment #2: Type: text/html, Size: 2138 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: C-SPC works; C-u C-SPC doesn't. How could be?
  2022-06-26 17:22       ` Ypo
@ 2022-06-26 19:13         ` Bruno Barbier
       [not found]         ` <62b8af84.1c69fb81.e0ca7.9738SMTPIN_ADDED_MISSING@mx.google.com>
  2022-06-26 20:55         ` Tim Cross
  2 siblings, 0 replies; 13+ messages in thread
From: Bruno Barbier @ 2022-06-26 19:13 UTC (permalink / raw)
  To: Ypo, Org-mode

Ypo <ypuntot@gmail.com> writes:

> Thanks, Bruno
>
> I've debugged it manually because (keymap-lookup) doesn't seem to exist 
> in my emacs, if that's possible.

Sorry, my bad. 'keymap-lookup' will only exist in 29.  I should have
used 'lookup-key':

     (lookup-key global-map (kbd "C-u"))
     
>
> The problem comes from:
>
> (define-key org-mode-map (kbd "C-u C-n") #'org-next-item)
>
> If I eval that line, "C-u C-SPC" stops working on org-mode.
>
> Same problem in runemacs -q. Is it a bug?

That line is the problem. It's hiding the real "C-u"
(universal-argument) in org-mode buffers. Once you've lost the standard
meaning of "C-u", you can't use C-u C-SPC and all other functions.

Maybe you could use the keys that are already defined by org, to move
between list items ?


    ‘S-<UP>’
    ‘S-<DOWN>’
         Jump to the previous/next item in the current list, but only if
         ‘org-support-shift-select’ is off(6).  If not, you can still use
         paragraph jumping commands like ‘C-<UP>’ and ‘C-<DOWN>’ to quite
         similar effect.

Bruno


>
>
> El 25/06/2022 a las 9:47, Bruno Barbier escribió:
>> Hi Ypo,
>>
>> Ypo<ypuntot@gmail.com>  writes:
>>
>>> Hi, Bruno
>>>
>>> Yes, I tried your assertion for bug-hunter, but it didn't work.
>>>
>>> (unless (eq 'universal-argument (keymap-lookup global-map "C-u"))
>>>          (error "C-u has been redefined"))
>>>
>> I'm not sure in what way it didn't work and I didn't try bug-hunter yet.
>>
>>
>> FWIW, just in case it might help you, when I have such a problem, I just
>> define a function, something like:
>>
>>     (defun my-check-bug ()
>>       "Throw an error when C-u is not the universal argument in org-mode."
>>       (with-temp-buffer
>>         (org-mode)
>>         (unless (eq 'universal-argument (keymap-lookup global-map "C-u"))
>>           (error "C-u has been redefined"))))
>>
>>
>> Then I add:
>>
>>     (my-check-bug)
>>     
>> everywhere in my init files and I start emacs with --debug-init.
>>
>> Good luck,
>>
>> Bruno
>>
>>


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: C-SPC works; C-u C-SPC doesn't. How could be?
       [not found]         ` <62b8af84.1c69fb81.e0ca7.9738SMTPIN_ADDED_MISSING@mx.google.com>
@ 2022-06-26 19:26           ` Ypo
  0 siblings, 0 replies; 13+ messages in thread
From: Ypo @ 2022-06-26 19:26 UTC (permalink / raw)
  To: Bruno Barbier, Org-mode

[-- Attachment #1: Type: text/plain, Size: 2762 bytes --]

Thanks, Bruno

I will save your advice for future debugging :-)

> Maybe you could use the keys that are already defined by org, to move
> between list items ?
>
>
>      ‘S-<UP>’
>      ‘S-<DOWN>’
>           Jump to the previous/next item in the current list, but only if
>           ‘org-support-shift-select’ is off(6).  If not, you can still use
>           paragraph jumping commands like ‘C-<UP>’ and ‘C-<DOWN>’ to quite
>           similar effect.

That requires me to change hands position, I must think about it.

Best regards :-)

El 26/06/2022 a las 21:13, Bruno Barbier escribió:
> Ypo<ypuntot@gmail.com>  writes:
>
>> Thanks, Bruno
>>
>> I've debugged it manually because (keymap-lookup) doesn't seem to exist
>> in my emacs, if that's possible.
> Sorry, my bad. 'keymap-lookup' will only exist in 29.  I should have
> used 'lookup-key':
>
>       (lookup-key global-map (kbd "C-u"))
>       
>> The problem comes from:
>>
>> (define-key org-mode-map (kbd "C-u C-n") #'org-next-item)
>>
>> If I eval that line, "C-u C-SPC" stops working on org-mode.
>>
>> Same problem in runemacs -q. Is it a bug?
> That line is the problem. It's hiding the real "C-u"
> (universal-argument) in org-mode buffers. Once you've lost the standard
> meaning of "C-u", you can't use C-u C-SPC and all other functions.
>
> Maybe you could use the keys that are already defined by org, to move
> between list items ?
>
>
>      ‘S-<UP>’
>      ‘S-<DOWN>’
>           Jump to the previous/next item in the current list, but only if
>           ‘org-support-shift-select’ is off(6).  If not, you can still use
>           paragraph jumping commands like ‘C-<UP>’ and ‘C-<DOWN>’ to quite
>           similar effect.
>
> Bruno
>
>
>>
>> El 25/06/2022 a las 9:47, Bruno Barbier escribió:
>>> Hi Ypo,
>>>
>>> Ypo<ypuntot@gmail.com>   writes:
>>>
>>>> Hi, Bruno
>>>>
>>>> Yes, I tried your assertion for bug-hunter, but it didn't work.
>>>>
>>>> (unless (eq 'universal-argument (keymap-lookup global-map "C-u"))
>>>>           (error "C-u has been redefined"))
>>>>
>>> I'm not sure in what way it didn't work and I didn't try bug-hunter yet.
>>>
>>>
>>> FWIW, just in case it might help you, when I have such a problem, I just
>>> define a function, something like:
>>>
>>>      (defun my-check-bug ()
>>>        "Throw an error when C-u is not the universal argument in org-mode."
>>>        (with-temp-buffer
>>>          (org-mode)
>>>          (unless (eq 'universal-argument (keymap-lookup global-map "C-u"))
>>>            (error "C-u has been redefined"))))
>>>
>>>
>>> Then I add:
>>>
>>>      (my-check-bug)
>>>      
>>> everywhere in my init files and I start emacs with --debug-init.
>>>
>>> Good luck,
>>>
>>> Bruno
>>>
>>>

[-- Attachment #2: Type: text/html, Size: 4014 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: C-SPC works; C-u C-SPC doesn't. How could be?
  2022-06-26 17:22       ` Ypo
  2022-06-26 19:13         ` Bruno Barbier
       [not found]         ` <62b8af84.1c69fb81.e0ca7.9738SMTPIN_ADDED_MISSING@mx.google.com>
@ 2022-06-26 20:55         ` Tim Cross
  2 siblings, 0 replies; 13+ messages in thread
From: Tim Cross @ 2022-06-26 20:55 UTC (permalink / raw)
  To: Ypo; +Cc: Bruno Barbier, emacs-orgmode


Ypo <ypuntot@gmail.com> writes:

> Thanks, Bruno
>
> I've debugged it manually because (keymap-lookup) doesn't seem to exist in my emacs, if that's possible.
>
> The problem comes from:
>
> (define-key org-mode-map (kbd "C-u C-n") #'org-next-item)
>
> If I eval that line, "C-u C-SPC" stops working on org-mode. 
>
> Same problem in runemacs -q. Is it a bug?
>

You cannot use C-u like this.

The C-u is a binding to the 'universal argument'. Your line breaks that
binding so that it no longer works. What you have done is (sort of)
created a new binding which shadows the old universal argument binding
and sets up C-u as a prefix. Now, when you hit C-u emacs is waiting for
C-n. 

You will need to use some other key binding. This can be difficult as
most of the good ones are already used. Packages like free-keys can help
identify spare/unused bindings. This is one reason I like evil-mode - I
have a wealth of available bindings, most of which easy to access
without leaving the keyboard (or 'home' row). For example, in org mode,
I have j/k for down/up line, S-j/S-k for down/up heading and M-j/M-k for
down/up list item. 


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-06-26 21:12 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-24  9:34 C-SPC works; C-u C-SPC doesn't. How could be? Ypo
2022-06-24 16:06 ` Greg Minshall
2022-06-25  0:49   ` Ypo
2022-06-24 17:31 ` Bruno Barbier
     [not found] ` <62b5f498.1c69fb81.8f12b.b976SMTPIN_ADDED_MISSING@mx.google.com>
2022-06-25  0:32   ` Ypo
2022-06-25  0:53     ` Ihor Radchenko
2022-06-25  1:15       ` Ypo
2022-06-25  3:28         ` Ihor Radchenko
2022-06-25  7:47     ` Bruno Barbier
     [not found]     ` <62b6bd46.1c69fb81.f4e75.9cf5SMTPIN_ADDED_MISSING@mx.google.com>
2022-06-26 17:22       ` Ypo
2022-06-26 19:13         ` Bruno Barbier
     [not found]         ` <62b8af84.1c69fb81.e0ca7.9738SMTPIN_ADDED_MISSING@mx.google.com>
2022-06-26 19:26           ` Ypo
2022-06-26 20:55         ` Tim Cross

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.