emacs-devel
[Top][All Lists]
Advanced

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

Re: Patch to remove minor modes in tutorial


From: Giorgos Keramidas
Subject: Re: Patch to remove minor modes in tutorial
Date: Sat, 8 Jul 2006 06:14:33 +0300

Lennart Borgman <address@hidden> wrote:
> 
> Here is a new version of help-with-tutorial then. I have added some 
> information instead that could be useful:
> 
> (defun help-describe-nonstandard-key(value)
>  ...
>              (when map
>                (if (eq map global-map)
>                    (setq mapsym 'global-map)
>                  (mapatoms (lambda (s)
>                              (when (and (boundp s)
>                                         (keymapp (symbol-value s)))
>                                (unless (eq s 'map)
>                                  (when (equal map (symbol-value s))
>                                    (when (member map (current-active-maps))
>                                      (setq mapsym s)))))))))

Phew!  That was a long patch :)

Only a minor detail I noticed while trying to read it all:
Isn't

    (when condition
      (when condition2
        expr))

the same as:

    (when (and condition condition2)
      expr)

The nested (unless c (when c1 (when c2))) stuff is also probably
equivalent to:

    (when (and (not (eq s 'map))
               (equal map (symbol-value s))
               (member map (current-active-maps)))
      (setq mapsym s))

Then, there are also two (when c (when c2 ...)) expressions,
where we can save yet another nesting level:

    (when (and (boundp s)
               (keymapp (symbol-value s))
               (not (eq s 'map))
               (equal map (symbol-value s))
               (member map (current-active-maps)))
      (setq mapsym s))
               
unless I'm reading this in a very bogus manner :)





reply via email to

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