On Sun, 13 Apr 2008 05:55:57 +0300, Giorgos Keramidas <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> I tried swapping the `e' and `E' keys in summary and article mode
> today.  The main reason is I find it harder to type `Shift-e' all the
> time on my laptop, and I expire articles far more often than I edit
> their text.
>
> My first attempt was:
>
>   (add-hook 'gnus-summary-mode-hook 'keramida-alter-summary-map)
>   (add-hook 'gnus-article-prepare-hook 'keramida-alter-summary-map)
>   (defun keramida-alter-summary-map ()
>     (local-set-key "e" 'gnus-summary-put-mark-as-expirable-next)
>     (local-set-key "E" 'gnus-summary-edit-article))
>
> but then I found out that 'e' doesn't work in an *Article* buffer,
> producing the message:
>
>   This command can only be used in the summary buffer

Got it, sorry for posting too fast.  Making gnus-summary-buffer the
current buffer works, but `gnus-summary-put-mark-as-expirable-next'
is an interactive function.  The following version works fine:

  (add-hook 'gnus-summary-mode-hook 'keramida-alter-summary-map)
  (add-hook 'gnus-article-prepare-hook 'keramida-alter-summary-map)
  (defun keramida-alter-summary-map ()
    (local-set-key "e"
      (lambda (n)
        (interactive "p")
        (gnus-summary-put-mark-as-expirable-next n)))
    (local-set-key "E" 'gnus-summary-edit-article))

Does this seem a reasonable way of writing the hook?  I've never used an
`interactive' lambda before, so I'm not sure if it's considered bad style.

- Giorgos

_______________________________________________
info-gnus-english mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/info-gnus-english

Reply via email to