unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lennart Borgman <lennart.borgman@gmail.com>
To: Arni Magnusson <arnima@hafro.is>
Cc: 6035@debbugs.gnu.org, Dmitry Dzhus <dima@sphinx.net.ru>
Subject: bug#6035: M-x gdb crashes
Date: Tue, 6 Jul 2010 11:32:59 +0200	[thread overview]
Message-ID: <AANLkTinnElV4joUX8yPW11_tm9fGbpAdwKenUYo9-VIN@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1007060828250.25194@hafstormur.hafro.is>

Ah, my bad, C-x C-char, I thought it was C-c C-char you were looking at.

C-c C-char is reserved for major modes only and should not be used by
minor modes AFAICS.

Yes, the manual says nothing about C-x. In my opinion it should, but
others disagreed in a recent discussion.

And yes, M-x gdb could use a global minor mode for the C-x C-a binding
to avoid the problem:

(define-key global-map "\C-x\C-a" (lambda () (interactive) (message
"C-x C-a here!!")))

(defvar my-test-mode-map
  (let ((map (make-sparse-keymap)))
    (define-key map "\C-x\C-a\C-l" (lambda () (interactive) (message
"C-x C-a C-l there!!")))
    (define-key map "\C-l" (lambda () (interactive) (message "C-l also!!")))
    map))

(define-minor-mode my-test-mode "Testing key binding"
  :global t
  )



On Tue, Jul 6, 2010 at 10:47 AM, Arni Magnusson <arnima@hafro.is> wrote:
> C-c C-char: reserved for major and minor modes (source: elisp manual)
>
> C-x C-char: free game for anyone, potential tug-of-wars between users and
> modes, but no should pose no danger of crashing a mode (source: my
> interpretation and experience)
>
> Given the nature of Emacs, some tug-of-war of keybindings can be expected.
> Many of my mode hooks, for example, rebind M-n and M-p to what I like them
> to do, overriding what the mode author thought I might like. This is
> harmless, and has not crashed any mode. The elisp manual (23.2.2) allows
> major modes to use these and other keystrokes, but I'm sure many Emacs users
> have bound them to generic functions they find useful in all modes.
>
> We sound like lawyers here, but all I'm asking is whether it's easy to
> prevent M-x gdb from crashing if C-x C-a is bound. If it's not easy, then so
> be it; the current error message accurately describes the quirk.
>
> Cheers,
>
> Arni
>
>
>
> On Tue, 6 Jul 2010, Lennart Borgman wrote:
>
>> On Tue, Jul 6, 2010 at 2:27 AM, Arni Magnusson <arnima@hafro.is> wrote:
>>>
>>> I can find no warning
>>> against redefining C-x C-char, such as C-x C-a.
>>
>> The elisp manual chapter mentioned before here
>>
>>  (info "(elisp) Key Binding Conventions")
>>
>> says that
>>
>>  * Sequences consisting of `C-c' followed by a control character or a
>>    digit are reserved for major modes.
>>
>> So it looks to me like GUD does follow that rule.
>>
>> Maybe the error message could include a link to that part of the elisp
>> manual, but that would rather be a general thing in Emacs, not
>> specific to GUD.
>>
>





  reply	other threads:[~2010-07-06  9:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-26  1:37 bug#6035: M-x gdb crashes Arni Magnusson
2010-04-26 18:54 ` Dmitry Dzhus
2010-07-06  0:27 ` Arni Magnusson
2010-07-06  1:06   ` Lennart Borgman
2010-07-06  8:47     ` Arni Magnusson
2010-07-06  9:32       ` Lennart Borgman [this message]
2021-12-04 20:47         ` bug#6035: gud-key-prefix Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTinnElV4joUX8yPW11_tm9fGbpAdwKenUYo9-VIN@mail.gmail.com \
    --to=lennart.borgman@gmail.com \
    --cc=6035@debbugs.gnu.org \
    --cc=arnima@hafro.is \
    --cc=dima@sphinx.net.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).