[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Print out my key-sequences
From: |
Andrea Crotti |
Subject: |
Re: Print out my key-sequences |
Date: |
Mon, 24 May 2010 20:02:09 +0200 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (darwin) |
Andrea Crotti <andrea.crotti.0@gmail.com> writes:
>
> I have to use setq-default to disable it by the way, is that correct?
> (defun growl-mode-off ()
> (interactive)
> (setq-default pre-command-hook (remq 'popup-last pre-command-hook)))
>
> Only one more problem, here I display all the keys, but I don't really
> care about stuff like
> "C-n", "C-p", "m" (all the keys are inserted).
>
> Is there any kind of distinction between simple and more complex
> combinations?
This is one possible way to solve the problem
--8<---------------cut here---------------start------------->8---
(defun popup-last ()
(interactive)
(let
((last-key (key-description (this-command-keys))))
(if
(or
(string-prefix-p "C-" last-key)
(string-prefix-p "M-" last-key))
(growl-popup last-key))))
--8<---------------cut here---------------end--------------->8---
But probably not the best one...