Dear all, interactive-p is obsolete since Emacs 23.2 and should be replaced by called-interactively-p. The org-called-interactively-p macro takes care of using either interactive-p or called-interactively-p. I've just updated the latest git and Org uses org-called-interactively-p wherever it makes sense. Please report any weird compilation warnings and/or problems. Thanks! -- Bastien
[-- Attachment #1.1: Type: text/plain, Size: 797 bytes --] On 29 Jun 2011, Bastien wrote: > Dear all, > > interactive-p is obsolete since Emacs 23.2 and should be replaced by > called-interactively-p. > > The org-called-interactively-p macro takes care of using either > interactive-p or called-interactively-p. > > I've just updated the latest git and Org uses > org-called-interactively-p wherever it makes sense. > > Please report any weird compilation warnings and/or problems. I still see a lot warnings complaining about `interactive-p'. I figured that it happens because the byte-compiler still sees the `interactive-p's Appended is a patch to the macro that checks on expand which interactive predicate we need. I don't see those warnings anymore and a quick check showed that it behaves as the complete version (at least on emacs24). Michael [-- Attachment #1.2: 0001-org-macs-Determine-on-macro-expand-which-interactive.patch --] [-- Type: text/plain, Size: 1230 bytes --] From e6c8ce384d7e848367a900681f10a13fffea882b Mon Sep 17 00:00:00 2001 From: Michael Markert <markert.michael@googlemail.com> Date: Thu, 30 Jun 2011 00:25:09 +0200 Subject: [PATCH] org-macs: Determine on macro expand which interactive predicate we need. Signed-off-by: Michael Markert <markert.michael@googlemail.com> --- lisp/org-macs.el | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/org-macs.el b/lisp/org-macs.el index 27e1d88..731642d 100644 --- a/lisp/org-macs.el +++ b/lisp/org-macs.el @@ -48,13 +48,13 @@ (declare-function org-string-match-p "org-compat" (&rest args)) (defmacro org-called-interactively-p (&optional kind) - `(if (featurep 'xemacs) - (interactive-p) + (if (featurep 'xemacs) + `(interactive-p) (if (or (> emacs-major-version 23) (and (>= emacs-major-version 23) (>= emacs-minor-version 2))) - (with-no-warnings (called-interactively-p ,kind)) ;; defined with no argument in <=23.1 - (interactive-p)))) + `(with-no-warnings (called-interactively-p ,kind)) ;; defined with no argument in <=23.1 + `(interactive-p)))) (if (and (not (fboundp 'with-silent-modifications)) (or (< emacs-major-version 23) -- 1.7.5.4 [-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
I suggest to talk to Eric Schulte before applying this patch....
- Carsten
On 30.6.2011, at 00:29, Michael Markert wrote:
> On 29 Jun 2011, Bastien wrote:
>
>> Dear all,
>>
>> interactive-p is obsolete since Emacs 23.2 and should be replaced by
>> called-interactively-p.
>>
>> The org-called-interactively-p macro takes care of using either
>> interactive-p or called-interactively-p.
>>
>> I've just updated the latest git and Org uses
>> org-called-interactively-p wherever it makes sense.
>>
>> Please report any weird compilation warnings and/or problems.
>
> I still see a lot warnings complaining about `interactive-p'.
> I figured that it happens because the byte-compiler still sees the
> `interactive-p's
>
> Appended is a patch to the macro that checks on expand which interactive
> predicate we need.
> I don't see those warnings anymore and a quick check showed that it
> behaves as the complete version (at least on emacs24).
>
> Michael
>
> <0001-org-macs-Determine-on-macro-expand-which-interactive.patch>
Michael's patch looks great to me, I can confirm that it does stifle the warnings on Emacs24, and everything compiles and works as expected -- at least as far as the Org-mode test suite is able to differentiate. In addition to applying this patch I've also added another patch which supplies the optional KIND argument to every invocation of org-called-interactively-p. Cheers -- Eric Carsten Dominik <carsten.dominik@gmail.com> writes: > I suggest to talk to Eric Schulte before applying this patch.... > > - Carsten > > On 30.6.2011, at 00:29, Michael Markert wrote: > >> On 29 Jun 2011, Bastien wrote: >> >>> Dear all, >>> >>> interactive-p is obsolete since Emacs 23.2 and should be replaced by >>> called-interactively-p. >>> >>> The org-called-interactively-p macro takes care of using either >>> interactive-p or called-interactively-p. >>> >>> I've just updated the latest git and Org uses >>> org-called-interactively-p wherever it makes sense. >>> >>> Please report any weird compilation warnings and/or problems. >> >> I still see a lot warnings complaining about `interactive-p'. >> I figured that it happens because the byte-compiler still sees the >> `interactive-p's >> >> Appended is a patch to the macro that checks on expand which interactive >> predicate we need. >> I don't see those warnings anymore and a quick check showed that it >> behaves as the complete version (at least on emacs24). >> >> Michael >> >> <0001-org-macs-Determine-on-macro-expand-which-interactive.patch> > > -- Eric Schulte http://cs.unm.edu/~eschulte/
Hi Eric and Michael, Eric Schulte <schulte.eric@gmail.com> writes: > Michael's patch looks great to me, I can confirm that it does stifle the > warnings on Emacs24, and everything compiles and works as expected -- at > least as far as the Org-mode test suite is able to differentiate. Thanks to Michael for the patch, it does indeed fix the warnings. > In addition to applying this patch I've also added another patch which > supplies the optional KIND argument to every invocation of > org-called-interactively-p. I thought the absence of argument was taken care by the org-called-interactively-p macro -- see the (with-no-warning ...) sexp in it, and the comment. Eric, any reason for explicitely adding an argument? I understand it's better for readability and it will ease the future replacement of org-called-interactively-p by called-interactively-p, but I was just curious to know if there was some other reasons. Thanks! -- Bastien
Michael Markert <markert.michael@googlemail.com> writes:
> Appended is a patch to the macro that checks on expand which interactive
> predicate we need.
> I don't see those warnings anymore and a quick check showed that it
> behaves as the complete version (at least on emacs24).
Thanks for this patch Michael!
--
Bastien
Bastien <bzg@altern.org> writes: > Hi Eric and Michael, > > Eric Schulte <schulte.eric@gmail.com> writes: > >> Michael's patch looks great to me, I can confirm that it does stifle the >> warnings on Emacs24, and everything compiles and works as expected -- at >> least as far as the Org-mode test suite is able to differentiate. > > Thanks to Michael for the patch, it does indeed fix the warnings. > >> In addition to applying this patch I've also added another patch which >> supplies the optional KIND argument to every invocation of >> org-called-interactively-p. > > I thought the absence of argument was taken care by the > org-called-interactively-p macro -- see the (with-no-warning ...) > sexp in it, and the comment. > > Eric, any reason for explicitely adding an argument? > > I understand it's better for readability and it will ease the future > replacement of org-called-interactively-p by called-interactively-p, > but I was just curious to know if there was some other reasons. > This extra argument supplies more information to the macro (e.g., an idea of /how/ interactive is considered /interactive/) through taking on the value of 'any or 'interactive. This information is thrown out in older versions of Emacs but is passed on to the called-interactively-p function in Emacs24 and should influence its behavior. Cheers -- Eric > > Thanks! -- Eric Schulte http://cs.unm.edu/~eschulte/
Hi Eric,
Eric Schulte <schulte.eric@gmail.com> writes:
> This extra argument supplies more information to the macro (e.g., an
> idea of /how/ interactive is considered /interactive/) through taking on
> the value of 'any or 'interactive. This information is thrown out in
> older versions of Emacs but is passed on to the called-interactively-p
> function in Emacs24 and should influence its behavior.
Thanks for the explanations.
--
Bastien