emacs-devel
[Top][All Lists]
Advanced

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

Re: Interactive hat.


From: Alan Mackenzie
Subject: Re: Interactive hat.
Date: Thu, 26 Mar 2009 23:32:57 +0000
User-agent: Mutt/1.5.9i

Hi, Stefan!

On Thu, Mar 26, 2009 at 05:18:05PM -0400, Stefan Monnier wrote:
> > 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,

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

OK, perhaps I was exaggerating a bit.

> 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.

I think we'd both go with Johan's (region-beginning) and (region-end).

> > 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.

Actually I'm rather surprised about that.  But as I said, my main aim
here is to minimise the time and mental effort the change will cause
package maintainers.

How about I take your suggestion as meaning that page "Interactive Codes"
should be enhanced to give the lisp equivalent for each code letter, and
it is made clear that the string version is a convenient abbreviation
which works nearly all the time, and the lisp code is the fully general
version?

I could even write a patch.  Just not tonight.

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).




reply via email to

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