gnu-emacs-sources
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: singlebind.el --- Bind commands to single characters


From: Thorsten Bonow
Subject: Re: singlebind.el --- Bind commands to single characters
Date: Sun, 18 Mar 2007 19:57:11 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) XEmacs/21.4.19 (linux)

>>>>> "spamfilteraccount" == spamfilteraccount  <address@hidden> writes:

    spamfilteraccount> http://www.emacswiki.org/cgi-bin/emacs-en/singlebind.el

Hi,

thanks for your work---I like it. Two suggestions:

First: I checked with XEmacs 21.4 (patch 19) on my up to date Debian unstable
box and after quick testing I found out that XEmacs only chokes on singlebind.el
because it's version of `run-with-idle-timer' expects the first argument (the
seconds) to be greater than zero, contrary to the GNU Emacs version.

This could be easily "fixed" by replacing 

     (run-with-idle-timer 0 nil 'singlebind-wait-for-idle 
                                                 n buffer-modified)

with

          (if (featurep 'xemacs)
              (run-with-idle-timer 0.1 nil 'singlebind-wait-for-idle 
                                   n buffer-modified)
            (run-with-idle-timer 0 nil 'singlebind-wait-for-idle 
                                 n buffer-modified)))

or defining a variable which holds the seconds argument and sets different
values vor XEmacs and GNU Emacs.

Works on my box.

Second: I'm flying my emacsen in viper mode, i.e. using the vi emulation for
emacsen. Vi (and viper) has a different approach to keyboard macros and---I'm
quoting from the documentation---"[...] Vi-style macros are better in that 
respect,
since Vi lets the user overload the meaning of key sequences: keys typed in fast
succession are treated specially, if this key sequence is bound to a macro. 
[...]"

For example, I have

    (defun my-viper-hippie-expand ()
      "Wrapper function for `hippie-expand' to use with viper."
        (interactive)
          ;; forward-char is used because when switching to viper's 
command-mode, cursor
            ;; is moved back.
              (forward-char 1)
                (hippie-expand nil)
                  (viper-insert nil))
                  (define-key viper-vi-global-user-map "gg" 
'my-viper-hippie-expand)

in my setup, typing "gg" fast will try to expand the current word by calling
`hippie-expand'.

Repeating a key is nearly as fast as typing it once but has the advantage, when
overloading key sequences, that it is more unlikely to be mixed up with ordinary
typing. In my opinion it would be nice to have such a feature in singlebind.el.


At least making it available for the XEmacs crowd would be nice ;-)

Toto


-- 
Contact information and PGP key at
http://www-users.rwth-aachen.de/thorsten.bonow

"You know if you're going to make a wholesale generalization, say
it in German. It gives it that extra 'oomph.'" --Jon Stewart


reply via email to

[Prev in Thread] Current Thread [Next in Thread]