all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Grant Rettke <gcr@wisdomandwonder.com>
To: Kevin Rodgers <kevin.d.rodgers@gmail.com>
Cc: Emacs Help <help-gnu-emacs@gnu.org>
Subject: Re: Reporting when keymapping stomped... best approach
Date: Thu, 12 Jun 2014 12:18:35 -0500	[thread overview]
Message-ID: <CAAjq1mduJT388XBYhB7ANWh0LWhu12EVbPGXUSoNinf7bpHBng@mail.gmail.com> (raw)
In-Reply-To: <lnbij9$i3v$1@ger.gmane.org>

Understood, thanks for explaining.
Grant Rettke | AAAS, ACM, ASA, FSF, IEEE, SIAM, Sigma Xi
gcr@wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson


On Thu, Jun 12, 2014 at 1:50 AM, Kevin Rodgers
<kevin.d.rodgers@gmail.com> wrote:
> On 6/10/14 1:15 PM, Grant Rettke wrote:
>>
>> My goal is to issue a warning whenever a keymapping is stomped on my
>> myself or anyone else. For example, say I replace self-insert for 1
>> like this:
>>
>> (global-set-key (kbd "1") 'scheme-mode)
>>
>> Then I want to look up in the global keymap space whether the desired
>> key already exists, and if it does, then I want to warn the user what
>> function was rebound to that keymap. Eg:
>>
>> (defadvice global-set-key (before check-keymapping activate)
>>    (let ((key (ad-get-arg 0))
>>          (command (ad-get-arg 1)))
>>      (when command
>>        (warn (concat "Just stomped on a global keymapping bound to: "
>> command)))))
>>
>>
>> The only problem is that this doesn't work, as global-undo-tree starts
>> complaining and I'm not sure where to start looking . Setting
>> debug-on-error to true doesn't even reveal anything useful.
>>
>> Where might I start debugging further?
>
>
> Stefan already provided the solution, but FYI I think the problem with your
> original attempt is that you try to concat `command' (which is a symbol in
> most cases) to a string.  His solution works because he uses the %S format
> specifier.
>
> I don't know why setting debug-on-error didn't work as expected.
>
> --
> Kevin Rodgers
> Denver, Colorado, USA
>
>



      reply	other threads:[~2014-06-12 17:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-10 19:15 Reporting when keymapping stomped... best approach Grant Rettke
2014-06-10 19:24 ` Stefan Monnier
2014-06-10 23:56   ` Grant Rettke
2014-06-12  6:50 ` Kevin Rodgers
2014-06-12 17:18   ` Grant Rettke [this message]

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

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

  git send-email \
    --in-reply-to=CAAjq1mduJT388XBYhB7ANWh0LWhu12EVbPGXUSoNinf7bpHBng@mail.gmail.com \
    --to=gcr@wisdomandwonder.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=kevin.d.rodgers@gmail.com \
    /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 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.