[Top][All Lists]

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

Re: Interactive specs

From: Juri Linkov
Subject: Re: Interactive specs
Date: Sun, 11 Dec 2005 12:52:19 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

While looking for more places with similar problems in interactive specs
I found that four commands in diff-mode.el have the following spec:

  (interactive (if current-prefix-arg
                   (list (mark) (point))
                 (list (point-min) (point-max))))

It doesn't keep its arguments in the command history, but this is ok
according to the current rule that doesn't put the command in the
history if it doesn't read arguments in the minibuffer.

But (mark) and (point) should be replaced with region-beginning/region-end.
I am not sure how exactly to do this.  One variant I propose is:

    (if (or current-prefix-arg (and transient-mark-mode mark-active))
        (region-beginning) (point-min))
    (if (or current-prefix-arg (and transient-mark-mode mark-active))
        (region-end) (point-max))))

Juri Linkov

reply via email to

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