[Top][All Lists]

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

Re: Interactive hat.

From: Stefan Monnier
Subject: Re: Interactive hat.
Date: Thu, 26 Mar 2009 17:18:05 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux)

> No, that's not simpler or clearer.  It's just pushing the work onto the
> package maintainer.  And it's a LOT of work.  For example,

>     (interactive "^P\nr")

> becomes

>     (interactive
>       (progn (if (fboundp 'handle-shift-selection)
>                  (handle-shift-selection))
>              `(current-prefix-arg
>              ,(if (< (point) (mark))
>                   ,@((point) (mark))
>                 ,@((mark) (point))))))

Yes, that's because "r" hasn't yet received the treatment I just gave to
"^".  As explained in my message of a couple days ago, it should always
be easy to turn an interactive string into the corresponding lisp form.

> , or something equally repulsive, requiring infinitely more debugging
> than the string it replaces.

Actually, in all likelyhood,

      (progn (if (fboundp 'handle-shift-selection)
             (list current-prefix-arg (point) (mark))))

will work just fine (in 99% of the cases, the subsequent code has to
figure out anyway whether `start' is indeed before `end' in case the
function is called from Lisp rather than interactively).
So you're exaggerating a little bit.

> My proposal is to suggest to the maintainer she copy the macro from
> .../lisp/compatibility.el into her own sources, rename it
> `foo-defunh'[*] and write:

Feel free to recommend it.  I find it hideous.


reply via email to

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