unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Fwd: [emacs-w3m:11603] Re: interactive-p obsolete
@ 2011-07-06  6:12 Andreas Röhler
  2011-07-06  7:09 ` Tim Cross
  2011-07-07 20:10 ` Fwd: " Stefan Monnier
  0 siblings, 2 replies; 30+ messages in thread
From: Andreas Röhler @ 2011-07-06  6:12 UTC (permalink / raw)
  To: Emacs developers

Hi,

making `interactive-p' obsolete, does this change pay?

I'm in favour of keeping interactive-p, resp. undoing that change.

Cheers,

Andreas


-------- Original-Nachricht --------
Betreff: [emacs-w3m:11603] Re: interactive-p obsolete
Datum: Wed, 06 Jul 2011 12:58:03 +0900
Von: Katsumi Yamaoka <yamaoka@jpl.org>
Antwort an: jidanni@jidanni.org, emacs-w3m@namazu.org
Organisation: Emacsen advocacy group
An: jidanni@jidanni.org
CC: emacs-w3m@namazu.org

In [emacs-w3m : No.11600] jidanni@jidanni.org wrote:
> On (info "(emacs-w3m) Gnus") we are told to use
>  (if (interactive-p)
> However
>   This function is obsolete since 23.2;
>   use `called-interactively-p' instead.
> Please update the paragraph and tell us what you used. Thanks.

We cannot use `called-interactively-p', otherwise emacs-w3m won't
work with old Emacsen.  Some Lisp packages, even in the Emacs trunk,
still use `interactive-p' for the same reason.





^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-06  6:12 Fwd: [emacs-w3m:11603] Re: interactive-p obsolete Andreas Röhler
@ 2011-07-06  7:09 ` Tim Cross
  2011-07-06  8:54   ` Bastien
  2011-07-06 11:22   ` Andreas Röhler
  2011-07-07 20:10 ` Fwd: " Stefan Monnier
  1 sibling, 2 replies; 30+ messages in thread
From: Tim Cross @ 2011-07-06  7:09 UTC (permalink / raw)
  To: emacs-devel

I don't believe the argument of not being able to use the new function
because of the need for backwards compatibility is valid. You can
solve this problem in a number of ways and maintain backwards
compatibility. In fact, its not uncommon to have to do this or that
different from wanting to maintain compatibility with emacs and xemcas
etc. If there is some other argument for not making the change, I'd be
interested in hearing it.

Tim


On Wed, Jul 6, 2011 at 4:12 PM, Andreas Röhler
<andreas.roehler@easy-emacs.de> wrote:
> Hi,
>
> making `interactive-p' obsolete, does this change pay?
>
> I'm in favour of keeping interactive-p, resp. undoing that change.
>
> Cheers,
>
> Andreas
>
>
> -------- Original-Nachricht --------
> Betreff: [emacs-w3m:11603] Re: interactive-p obsolete
> Datum: Wed, 06 Jul 2011 12:58:03 +0900
> Von: Katsumi Yamaoka <yamaoka@jpl.org>
> Antwort an: jidanni@jidanni.org, emacs-w3m@namazu.org
> Organisation: Emacsen advocacy group
> An: jidanni@jidanni.org
> CC: emacs-w3m@namazu.org
>
> In [emacs-w3m : No.11600] jidanni@jidanni.org wrote:
>>
>> On (info "(emacs-w3m) Gnus") we are told to use
>>  (if (interactive-p)
>> However
>>  This function is obsolete since 23.2;
>>  use `called-interactively-p' instead.
>> Please update the paragraph and tell us what you used. Thanks.
>
> We cannot use `called-interactively-p', otherwise emacs-w3m won't
> work with old Emacsen.  Some Lisp packages, even in the Emacs trunk,
> still use `interactive-p' for the same reason.
>
>
>
>



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-06  7:09 ` Tim Cross
@ 2011-07-06  8:54   ` Bastien
  2011-07-06 18:16     ` Lennart Borgman
  2011-07-06 11:22   ` Andreas Röhler
  1 sibling, 1 reply; 30+ messages in thread
From: Bastien @ 2011-07-06  8:54 UTC (permalink / raw)
  To: Tim Cross; +Cc: emacs-devel

Tim Cross <theophilusx@gmail.com> writes:

> I don't believe the argument of not being able to use the new function
> because of the need for backwards compatibility is valid. You can
> solve this problem in a number of ways and maintain backwards
> compatibility. 

FWIW, this is how Org solves it:

(defmacro org-called-interactively-p (&optional kind)
  (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))
       `(interactive-p))))

-- 
 Bastien



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-06  7:09 ` Tim Cross
  2011-07-06  8:54   ` Bastien
@ 2011-07-06 11:22   ` Andreas Röhler
  2011-07-07  0:06     ` Tim Cross
  1 sibling, 1 reply; 30+ messages in thread
From: Andreas Röhler @ 2011-07-06 11:22 UTC (permalink / raw)
  To: emacs-devel; +Cc: Tim Cross

Am 06.07.2011 09:09, schrieb Tim Cross:
> I don't believe the argument of not being able to use the new function
> because of the need for backwards compatibility is valid. You can
> solve this problem in a number of ways and maintain backwards
> compatibility. In fact, its not uncommon to have to do this or that
> different from wanting to maintain compatibility with emacs and xemcas
> etc. If there is some other argument for not making the change, I'd be
> interested in hearing it.
>
> Tim

Hi Tim,

from my perspective --which might miss the point anyway-- exist several 
reasons for reverting the change.

First: what is the gain? IMHO new function is more difficult to use, 
slows down writing, needs more reflection than the old one.

So to say: some classic over-specification.
We must not differentiate here, better a simple one-for-all-function not 
bothering for specific argument: just interactive-p

Alltogether new design evens doesn't deliver the basics needed, saying:

"This function is meant for implementing advice and other
function-modifying features.  Instead of using this, it is sometimes
cleaner to give your function an extra optional argument whose
`interactive' spec specifies non-nil unconditionally ("p" is a good
way to do this), or via (not (or executing-kbd-macro noninteractive))."

: hodge-podge

Andreas




>
>
> On Wed, Jul 6, 2011 at 4:12 PM, Andreas Röhler
> <andreas.roehler@easy-emacs.de>  wrote:
>> Hi,
>>
>> making `interactive-p' obsolete, does this change pay?
>>
>> I'm in favour of keeping interactive-p, resp. undoing that change.
>>
>> Cheers,
>>
>> Andreas
>>
>>
>> -------- Original-Nachricht --------
>> Betreff: [emacs-w3m:11603] Re: interactive-p obsolete
>> Datum: Wed, 06 Jul 2011 12:58:03 +0900
>> Von: Katsumi Yamaoka<yamaoka@jpl.org>
>> Antwort an: jidanni@jidanni.org, emacs-w3m@namazu.org
>> Organisation: Emacsen advocacy group
>> An: jidanni@jidanni.org
>> CC: emacs-w3m@namazu.org
>>
>> In [emacs-w3m : No.11600] jidanni@jidanni.org wrote:
>>>
>>> On (info "(emacs-w3m) Gnus") we are told to use
>>>   (if (interactive-p)
>>> However
>>>   This function is obsolete since 23.2;
>>>   use `called-interactively-p' instead.
>>> Please update the paragraph and tell us what you used. Thanks.
>>
>> We cannot use `called-interactively-p', otherwise emacs-w3m won't
>> work with old Emacsen.  Some Lisp packages, even in the Emacs trunk,
>> still use `interactive-p' for the same reason.
>>
>>
>>
>>
>
>




^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-06  8:54   ` Bastien
@ 2011-07-06 18:16     ` Lennart Borgman
  2011-07-06 18:33       ` Bastien
  2011-07-06 22:51       ` Juanma Barranquero
  0 siblings, 2 replies; 30+ messages in thread
From: Lennart Borgman @ 2011-07-06 18:16 UTC (permalink / raw)
  To: Bastien; +Cc: Tim Cross, emacs-devel

On Wed, Jul 6, 2011 at 10:54, Bastien <bzg@altern.org> wrote:
> Tim Cross <theophilusx@gmail.com> writes:
>
>> I don't believe the argument of not being able to use the new function
>> because of the need for backwards compatibility is valid. You can
>> solve this problem in a number of ways and maintain backwards
>> compatibility.
>
> FWIW, this is how Org solves it:
>
> (defmacro org-called-interactively-p (&optional kind)
>  (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))
>       `(interactive-p))))

Why not add such a macro to Emacs?



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-06 18:16     ` Lennart Borgman
@ 2011-07-06 18:33       ` Bastien
  2011-07-06 22:51       ` Juanma Barranquero
  1 sibling, 0 replies; 30+ messages in thread
From: Bastien @ 2011-07-06 18:33 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Tim Cross, emacs-devel

Lennart Borgman <lennart.borgman@gmail.com> writes:

>> (defmacro org-called-interactively-p (&optional kind)
>>  (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))
>>       `(interactive-p))))
>
> Why not add such a macro to Emacs?

I'm focusing on Org, but yes, people could add this to Emacs if useful.

-- 
 Bastien



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-06 18:16     ` Lennart Borgman
  2011-07-06 18:33       ` Bastien
@ 2011-07-06 22:51       ` Juanma Barranquero
  2011-07-06 23:08         ` Lennart Borgman
  1 sibling, 1 reply; 30+ messages in thread
From: Juanma Barranquero @ 2011-07-06 22:51 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Bastien, Tim Cross, emacs-devel

On Wed, Jul 6, 2011 at 20:16, Lennart Borgman <lennart.borgman@gmail.com> wrote:

>> (defmacro org-called-interactively-p (&optional kind)
>>  (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))
>>       `(interactive-p))))
>
> Why not add such a macro to Emacs?

Hmm... What for? In the Emacs trunk, it trivially resolves to
"(with-no-warnings (called-interactively-p kind))", which is a longish
way to say just "(called-interactively-p kind)". And externally
maintained packages would still need to define it because the whole
point is that they are loaded in environments which are *not* the
Emacs trunk... So the only benefit for them would be to be able to do

  (if (fboundp 'compatible-called-interactively-p)
      (compatible-callled-interactively-p kind)
    ;; compatibility code here

and that's no less trouble that directly defining the compatibility
macro in the first place.

    Juanma



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-06 22:51       ` Juanma Barranquero
@ 2011-07-06 23:08         ` Lennart Borgman
  2011-07-06 23:10           ` Juanma Barranquero
  0 siblings, 1 reply; 30+ messages in thread
From: Lennart Borgman @ 2011-07-06 23:08 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Bastien, Tim Cross, emacs-devel

On Thu, Jul 7, 2011 at 00:51, Juanma Barranquero <lekktu@gmail.com> wrote:
> On Wed, Jul 6, 2011 at 20:16, Lennart Borgman <lennart.borgman@gmail.com> wrote:
>
>>> (defmacro org-called-interactively-p (&optional kind)
>>>  (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))
>>>       `(interactive-p))))
>>
>> Why not add such a macro to Emacs?
>
> Hmm... What for? In the Emacs trunk, it trivially resolves to

For things outside Emacs trunk.



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-06 23:08         ` Lennart Borgman
@ 2011-07-06 23:10           ` Juanma Barranquero
  2011-07-06 23:16             ` Lennart Borgman
  0 siblings, 1 reply; 30+ messages in thread
From: Juanma Barranquero @ 2011-07-06 23:10 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Bastien, Tim Cross, emacs-devel

On Thu, Jul 7, 2011 at 01:08, Lennart Borgman <lennart.borgman@gmail.com> wrote:

> For things outside Emacs trunk.

Either I don't understand you, or you didn't understand me. Such a
compatibility macro would only be useful for "things outside Emacs
trunk" if they are *only* to be used *with* the Emacs trunk. Else,
they have to define their own compatibility macro for the cases when
they are used with older Emacsen, XEmacs, etc.

    Juanma



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-06 23:10           ` Juanma Barranquero
@ 2011-07-06 23:16             ` Lennart Borgman
  2011-07-06 23:32               ` Juanma Barranquero
  0 siblings, 1 reply; 30+ messages in thread
From: Lennart Borgman @ 2011-07-06 23:16 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Bastien, Tim Cross, emacs-devel

On Thu, Jul 7, 2011 at 01:10, Juanma Barranquero <lekktu@gmail.com> wrote:
> On Thu, Jul 7, 2011 at 01:08, Lennart Borgman <lennart.borgman@gmail.com> wrote:
>
>> For things outside Emacs trunk.
>
> Either I don't understand you, or you didn't understand me. Such a
> compatibility macro would only be useful for "things outside Emacs
> trunk" if they are *only* to be used *with* the Emacs trunk. Else,
> they have to define their own compatibility macro for the cases when
> they are used with older Emacsen, XEmacs, etc.

;-) -- Yes, you are right. But it could be defined in a separate
compatibility elisp file that could be copied to Xemacs and copied
"privately" for those using it with older emacsen.



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-06 23:16             ` Lennart Borgman
@ 2011-07-06 23:32               ` Juanma Barranquero
  2011-07-06 23:44                 ` Lennart Borgman
  0 siblings, 1 reply; 30+ messages in thread
From: Juanma Barranquero @ 2011-07-06 23:32 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Bastien, Tim Cross, emacs-devel

On Thu, Jul 7, 2011 at 01:16, Lennart Borgman <lennart.borgman@gmail.com> wrote:

> ;-) -- Yes, you are right. But it could be defined in a separate
> compatibility elisp file that could be copied to Xemacs and copied
> "privately" for those using it with older emacsen.

At which point, you've created a bigger problem that the one you
wanted to fix, because instead of a ten-line macro in some
compatibility file in the package, you're suddenly dealing with making
that macro available to people *outside* the package(s) where it is
intended to be used...

In other words: we can add that macro, but I bet it won't save a
single line of code (nor any trouble) to any externally maintained
multi-platform package.

    Juanma



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-06 23:32               ` Juanma Barranquero
@ 2011-07-06 23:44                 ` Lennart Borgman
  2011-07-06 23:47                   ` Juanma Barranquero
  0 siblings, 1 reply; 30+ messages in thread
From: Lennart Borgman @ 2011-07-06 23:44 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Bastien, Tim Cross, emacs-devel

On Thu, Jul 7, 2011 at 01:32, Juanma Barranquero <lekktu@gmail.com> wrote:
> On Thu, Jul 7, 2011 at 01:16, Lennart Borgman <lennart.borgman@gmail.com> wrote:
>
>> ;-) -- Yes, you are right. But it could be defined in a separate
>> compatibility elisp file that could be copied to Xemacs and copied
>> "privately" for those using it with older emacsen.
>
> At which point, you've created a bigger problem that the one you
> wanted to fix, because instead of a ten-line macro in some
> compatibility file in the package, you're suddenly dealing with making
> that macro available to people *outside* the package(s) where it is
> intended to be used...
>
> In other words: we can add that macro, but I bet it won't save a
> single line of code (nor any trouble) to any externally maintained
> multi-platform package.

I think you will lose a lot of money if people take the chance.



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-06 23:44                 ` Lennart Borgman
@ 2011-07-06 23:47                   ` Juanma Barranquero
  2011-07-06 23:57                     ` Lennart Borgman
  0 siblings, 1 reply; 30+ messages in thread
From: Juanma Barranquero @ 2011-07-06 23:47 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Bastien, Tim Cross, emacs-devel

On Thu, Jul 7, 2011 at 01:44, Lennart Borgman <lennart.borgman@gmail.com> wrote:

> I think you will lose a lot of money if people take the chance.

Please explain to me how will they do it (the packages, not the
people). With code, not words.

    Juanma



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-06 23:47                   ` Juanma Barranquero
@ 2011-07-06 23:57                     ` Lennart Borgman
  2011-07-07  0:01                       ` Juanma Barranquero
  0 siblings, 1 reply; 30+ messages in thread
From: Lennart Borgman @ 2011-07-06 23:57 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Bastien, Tim Cross, emacs-devel

On Thu, Jul 7, 2011 at 01:47, Juanma Barranquero <lekktu@gmail.com> wrote:
> On Thu, Jul 7, 2011 at 01:44, Lennart Borgman <lennart.borgman@gmail.com> wrote:
>
>> I think you will lose a lot of money if people take the chance.
>
> Please explain to me how will they do it (the packages, not the
> people). With code, not words.

I am not sure what you mean. Isn't it enough with just a simple
(require 'thatcompatlib)? Am I missing something?



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-06 23:57                     ` Lennart Borgman
@ 2011-07-07  0:01                       ` Juanma Barranquero
  2011-07-07  0:12                         ` Lennart Borgman
  0 siblings, 1 reply; 30+ messages in thread
From: Juanma Barranquero @ 2011-07-07  0:01 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Bastien, Tim Cross, emacs-devel

On Thu, Jul 7, 2011 at 01:57, Lennart Borgman <lennart.borgman@gmail.com> wrote:

> I am not sure what you mean. Isn't it enough with just a simple
> (require 'thatcompatlib)? Am I missing something?

What is thatcompatlib? Who will write it? How will you distribute it?

And, how will that be easier than having

(defmacro org-.... (&optional kind)
   ...)

in Org, for example?

    Juanma



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-06 11:22   ` Andreas Röhler
@ 2011-07-07  0:06     ` Tim Cross
  2011-07-07  6:52       ` Andreas Röhler
  0 siblings, 1 reply; 30+ messages in thread
From: Tim Cross @ 2011-07-07  0:06 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: emacs-devel

On Wed, Jul 6, 2011 at 9:22 PM, Andreas Röhler
<andreas.roehler@online.de> wrote:
> Am 06.07.2011 09:09, schrieb Tim Cross:
>>
>> I don't believe the argument of not being able to use the new function
>> because of the need for backwards compatibility is valid. You can
>> solve this problem in a number of ways and maintain backwards
>> compatibility. In fact, its not uncommon to have to do this or that
>> different from wanting to maintain compatibility with emacs and xemcas
>> etc. If there is some other argument for not making the change, I'd be
>> interested in hearing it.
>>
>> Tim
>
> Hi Tim,
>
> from my perspective --which might miss the point anyway-- exist several
> reasons for reverting the change.
>
> First: what is the gain? IMHO new function is more difficult to use, slows
> down writing, needs more reflection than the old one.
>
> So to say: some classic over-specification.
> We must not differentiate here, better a simple one-for-all-function not
> bothering for specific argument: just interactive-p
>
> Alltogether new design evens doesn't deliver the basics needed, saying:
>
> "This function is meant for implementing advice and other
> function-modifying features.  Instead of using this, it is sometimes
> cleaner to give your function an extra optional argument whose
> `interactive' spec specifies non-nil unconditionally ("p" is a good
> way to do this), or via (not (or executing-kbd-macro noninteractive))."
>
> : hodge-podge
>

Hi Andreas

My main point was that backwards compatibility, as suggested in your
original post, was not sufficient justification to revert things as it
is trivial to add code that would provide this compatibility.
Furthermore, in many cases, packages already have this compatibility
layer in order to support both GNU Emacs and XEmacs (see the org-mode
example which has since been posted). However, while I may have things
a bit mixed up, as I understand it, there are some good reasons for
the change. It isn't just a change made  for the sake of it. Some may
debate whether the reasons are sufficient, but for me they seem
reasonable.

Others with more experience and better memories are probably able to
fill in things better, but from memory, there are some problems with
the use of interactive-p because people misinterpret what it means and
because they tend to use it without thinking about what 'interactive'
means.  Its one of those subtle issues that you may think you
understand and everyone else understands in the same way until you
begin to talk to others. You then find out there are a number of
situations where it isn't as clear as it originally seemed and that
you do need to think about the context where you use such a test and
what it is you really are wanting to test for.

I also believe the water was made even more 'muddy' by the fact that a
form of called-interactive-p, without an argument, already existed.
People found it hard to know when to use called-interactive-p or
interactive-p or what the difference was or why there was both. To
clarify matters, one had to go.

There was a discussion a couple of years back regarding this. At the
time, it was recognised that fixing it would improve elisp in the
long-term, but doing so was going to cause some pain. I believe that
the result, called-interactive-p with an optional argument and the
marking of interactive-p as obsolete was considered the solution with
the least pain and best outcome and seems like a reasonable compromise
to me.

Once interactive-p is actually removed, we will realise the benefits
of having a single predicate to test for 'interactive' and because of
the additional argument, possibly a predicate that is applied after
more thought as to what the programmer is really testing for,
hopefully resulting in code where intentions are clearer and
therefore, easier to maintain.

Tim



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-07  0:01                       ` Juanma Barranquero
@ 2011-07-07  0:12                         ` Lennart Borgman
  2011-07-07  0:32                           ` Juanma Barranquero
  0 siblings, 1 reply; 30+ messages in thread
From: Lennart Borgman @ 2011-07-07  0:12 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Bastien, Tim Cross, emacs-devel

On Thu, Jul 7, 2011 at 02:01, Juanma Barranquero <lekktu@gmail.com> wrote:
> On Thu, Jul 7, 2011 at 01:57, Lennart Borgman <lennart.borgman@gmail.com> wrote:
>
>> I am not sure what you mean. Isn't it enough with just a simple
>> (require 'thatcompatlib)? Am I missing something?
>
> What is thatcompatlib? Who will write it? How will you distribute it?

I think you know the answers to these questions, or? Distribute it in Emacs.

> And, how will that be easier than having
>
> (defmacro org-.... (&optional kind)
>   ...)
>
> in Org, for example?

I think it is easier to have it this way if something changes.



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-07  0:12                         ` Lennart Borgman
@ 2011-07-07  0:32                           ` Juanma Barranquero
  2011-07-07  0:44                             ` Lennart Borgman
  0 siblings, 1 reply; 30+ messages in thread
From: Juanma Barranquero @ 2011-07-07  0:32 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Bastien, Tim Cross, emacs-devel

On Thu, Jul 7, 2011 at 02:12, Lennart Borgman <lennart.borgman@gmail.com> wrote:

> I think you know the answers to these questions, or?

No.

> Distribute it in Emacs.

So you're proposing to distribute a compatibility library in Emacs
that outside packages will have to include (because it is not enough
for Emacs to have it, outside packages will need to duplicate it, and
keep it up-to-date).

A compatibility library that should make the Emacs trunk compatible
with any other Emacs out there (at the very least, several Emacs
releases and perhaps most XEmacs releases, not to count SXEmacs).

So you're suddenly moved the burden of compatibility with anything out
there to the Emacs maintainers. And this is a simplification
because...?

But hey, please don't let my doubts dissuade you about creating such
library and including it in EmacsW32 :-)

    Juanma



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-07  0:32                           ` Juanma Barranquero
@ 2011-07-07  0:44                             ` Lennart Borgman
  2011-07-07  0:54                               ` Juanma Barranquero
  0 siblings, 1 reply; 30+ messages in thread
From: Lennart Borgman @ 2011-07-07  0:44 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Bastien, Tim Cross, emacs-devel

On Thu, Jul 7, 2011 at 02:32, Juanma Barranquero <lekktu@gmail.com> wrote:
> On Thu, Jul 7, 2011 at 02:12, Lennart Borgman <lennart.borgman@gmail.com> wrote:
>
>> I think you know the answers to these questions, or?
>
> No.
>
>> Distribute it in Emacs.
>
> So you're proposing to distribute a compatibility library in Emacs
> that outside packages will have to include (because it is not enough
> for Emacs to have it, outside packages will need to duplicate it, and
> keep it up-to-date).

I can't believe you are serious, Juanma. Of course users who want this
should fetch it from Emacs repository. Outside packages just need to
tell that.

Let us stop here.



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-07  0:44                             ` Lennart Borgman
@ 2011-07-07  0:54                               ` Juanma Barranquero
  2011-07-07 11:38                                 ` Bastien
  0 siblings, 1 reply; 30+ messages in thread
From: Juanma Barranquero @ 2011-07-07  0:54 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: Bastien, Tim Cross, emacs-devel

On Thu, Jul 7, 2011 at 02:44, Lennart Borgman <lennart.borgman@gmail.com> wrote:

> I can't believe you are serious, Juanma. Of course users who want this
> should fetch it from Emacs repository. Outside packages just need to
> tell that.

You skipped the part where suddenly compatibility with everybody,
forever, is our concern.

That's a fine project, just not one we should undertake, IMHO.

    Juanma



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-07  0:06     ` Tim Cross
@ 2011-07-07  6:52       ` Andreas Röhler
  2011-07-07 11:36         ` Bastien
  0 siblings, 1 reply; 30+ messages in thread
From: Andreas Röhler @ 2011-07-07  6:52 UTC (permalink / raw)
  To: Tim Cross; +Cc: Bastien, emacs-devel

[ ... ]
>
> Hi Andreas
>
> My main point was that backwards compatibility, as suggested in your
> original post, was not sufficient justification to revert things as it
> is trivial to add code

Hi Tim,

for now a workaround from org-mode was presented, which looks buggy for 
me, as it sends an argument collected optional to a form requiring one.

cc to Bastien for this

At least would not call it trivial.

Nontheless I agree existed two similar functions at the time, so some 
cleanup was recommended.

  that would provide this compatibility.
> Furthermore, in many cases, packages already have this compatibility
> layer in order to support both GNU Emacs and XEmacs (see the org-mode
> example which has since been posted). However, while I may have things
> a bit mixed up, as I understand it, there are some good reasons for
> the change. It isn't just a change made  for the sake of it. Some may
> debate whether the reasons are sufficient, but for me they seem
> reasonable.

IMHO things are much more difficult now than before. That's a marchin 
into the swamp :)

>
> Others with more experience and better memories are probably able to
> fill in things better, but from memory, there are some problems with
> the use of interactive-p because people misinterpret what it means and
> because they tend to use it without thinking about what 'interactive'
> means.

That possible misunderstanding has a much broader base, it results from 
perspectives of active and passiv and is still present in the remaining 
form.

BTW that's why we can't understand truly abstract reasoning, always need 
examples how to interpret.

  Its one of those subtle issues that you may think you
> understand and everyone else understands in the same way until you
> begin to talk to others. You then find out there are a number of
> situations where it isn't as clear as it originally seemed and that
> you do need to think about the context where you use such a test and
> what it is you really are wanting to test for.
>
> I also believe the water was made even more 'muddy' by the fact that a
> form of called-interactive-p, without an argument, already existed.
> People found it hard to know when to use called-interactive-p or
> interactive-p or what the difference was or why there was both. To
> clarify matters, one had to go.
>
> There was a discussion a couple of years back regarding this.

Yeah, starting here AFAIS:

http://lists.gnu.org/archive/html/emacs-devel/2009-08/msg00784.html

At the
> time, it was recognised that fixing it would improve elisp in the
> long-term, but doing so was going to cause some pain. I believe that
> the result, called-interactive-p with an optional argument and the
> marking of interactive-p as obsolete was considered the solution with
> the least pain and best outcome and seems like a reasonable compromise
> to me.
>
> Once interactive-p is actually removed, we will realise the benefits
> of having a single predicate to test for 'interactive' and because of
> the additional argument, possibly a predicate that is applied after
> more thought as to what the programmer is really testing for,
> hopefully resulting in code where intentions are clearer and
> therefore, easier to maintain.
>
> Tim
>

Hm, thinking the other way.

IMHO Drew was right and Stefan and Chong have been right in their first 
responses.

But let's stop here and see if others notice that also.
Should I'm being wrong here - the better.

Cheers,

Andreas








^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-07  6:52       ` Andreas Röhler
@ 2011-07-07 11:36         ` Bastien
  2011-07-07 12:55           ` Andreas Röhler
  0 siblings, 1 reply; 30+ messages in thread
From: Bastien @ 2011-07-07 11:36 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: Tim Cross, emacs-devel

Hi Andreas,

I'm on the emacs-devel list, no need to cc me.

Also, the @wikimedia.fr address is not valid anymore as I no longer 
work for this association.

Andreas Röhler <andreas.roehler@online.de> writes:

> for now a workaround from org-mode was presented, which looks buggy for me,
> as it sends an argument collected optional to a form requiring one.

Please show me where this compatibility function is wrong if it is.

Thanks,

-- 
 Bastien



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-07  0:54                               ` Juanma Barranquero
@ 2011-07-07 11:38                                 ` Bastien
  2011-07-07 11:50                                   ` Lennart Borgman
  0 siblings, 1 reply; 30+ messages in thread
From: Bastien @ 2011-07-07 11:38 UTC (permalink / raw)
  To: Juanma Barranquero; +Cc: Tim Cross, Lennart Borgman, emacs-devel

Guys,

FWIW, I agree with Juanma here: compatibility functions should live
where they are needed, i.e. in external packages.

Best,

-- 
 Bastien



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-07 11:38                                 ` Bastien
@ 2011-07-07 11:50                                   ` Lennart Borgman
  2011-07-07 15:37                                     ` Stephen J. Turnbull
  0 siblings, 1 reply; 30+ messages in thread
From: Lennart Borgman @ 2011-07-07 11:50 UTC (permalink / raw)
  To: Bastien; +Cc: Juanma Barranquero, Tim Cross, emacs-devel

On Thu, Jul 7, 2011 at 13:38, Bastien <bzg@altern.org> wrote:
> Guys,
>
> FWIW, I agree with Juanma here: compatibility functions should live
> where they are needed, i.e. in external packages.

For larger well maintained packages that is no big problem. However
for small packages/single elisp files it is worse. (We might have an
example here where the compatibility function is in error and needs to
be replaced.)



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-07 11:36         ` Bastien
@ 2011-07-07 12:55           ` Andreas Röhler
  2011-07-07 13:41             ` Juanma Barranquero
  2011-07-08  9:57             ` Bastien
  0 siblings, 2 replies; 30+ messages in thread
From: Andreas Röhler @ 2011-07-07 12:55 UTC (permalink / raw)
  To: emacs-devel; +Cc: Tim Cross, Lennart Borgman

Am 07.07.2011 13:36, schrieb Bastien:
> Hi Andreas,
>
> I'm on the emacs-devel list, no need to cc me.
>
> Also, the @wikimedia.fr address is not valid anymore as I no longer
> work for this association.
>
> Andreas Röhler<andreas.roehler@online.de>  writes:
>
>> for now a workaround from org-mode was presented, which looks buggy for me,
>> as it sends an argument collected optional to a form requiring one.
>
> Please show me where this compatibility function is wrong if it is.
>
> Thanks,
>

what will happen if the before-last line is execute with an element 
"kind" delivered as nil

	 `(with-no-warnings (called-interactively-p ,kind))

as "kind" is optional in your macro, that might happen AFAIU

Can't see called-interactively-p allows nil delivered as "kind".



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-07 12:55           ` Andreas Röhler
@ 2011-07-07 13:41             ` Juanma Barranquero
  2011-07-08  9:57             ` Bastien
  1 sibling, 0 replies; 30+ messages in thread
From: Juanma Barranquero @ 2011-07-07 13:41 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: Tim Cross, Lennart Borgman, emacs-devel

On Thu, Jul 7, 2011 at 14:55, Andreas Röhler <andreas.roehler@online.de> wrote:

> what will happen if the before-last line is execute with an element "kind"
> delivered as nil
>
>         `(with-no-warnings (called-interactively-p ,kind))
>
> as "kind" is optional in your macro, that might happen AFAIU
>
> Can't see called-interactively-p allows nil delivered as "kind".

`org-called-interactively-p' is a compatibility function, so meant to
be called like `called-interactively-p' is. Passing it nil is an
error, like it would be for `called-interactively-p'.

    Juanma



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-07 11:50                                   ` Lennart Borgman
@ 2011-07-07 15:37                                     ` Stephen J. Turnbull
  0 siblings, 0 replies; 30+ messages in thread
From: Stephen J. Turnbull @ 2011-07-07 15:37 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: emacs-devel

Cleaning up some CCs.

Lennart Borgman writes:
 > On Thu, Jul 7, 2011 at 13:38, Bastien <bzg@altern.org> wrote:
 > > Guys,
 > >
 > > FWIW, I agree with Juanma here: compatibility functions should live
 > > where they are needed, i.e. in external packages.
 > 
 > For larger well maintained packages that is no big problem. However
 > for small packages/single elisp files it is worse. (We might have an
 > example here where the compatibility function is in error and needs to
 > be replaced.)

The package you think you want already exists, it's called APEL (A
Portable Emacs Library).  I believe Morioka-san et al still maintain
it.  It has a number of serious design restrictions (most important,
it makes decisions about which compatibility functions to provide at
compile-time, for efficiency, so you need a copy for pretty much every
Emacs you run).



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Fwd: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-06  6:12 Fwd: [emacs-w3m:11603] Re: interactive-p obsolete Andreas Röhler
  2011-07-06  7:09 ` Tim Cross
@ 2011-07-07 20:10 ` Stefan Monnier
  2011-07-09  2:52   ` Tim Cross
  1 sibling, 1 reply; 30+ messages in thread
From: Stefan Monnier @ 2011-07-07 20:10 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: Emacs developers

> I'm in favour of keeping interactive-p, resp. undoing that change.

interactive-p is obsolete, which means you should move away from it
(mostly because it needs an extra arg to know what you mean since
it's been used with two different meanings).
But interactive-p still works just as well in Emacs-24 as in previous
Emacsen, and I'd be surprised if the same doesn't hold for Emacs-25
(and probably 26 as well).


        Stefan



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-07 12:55           ` Andreas Röhler
  2011-07-07 13:41             ` Juanma Barranquero
@ 2011-07-08  9:57             ` Bastien
  1 sibling, 0 replies; 30+ messages in thread
From: Bastien @ 2011-07-08  9:57 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: Tim Cross, Lennart Borgman, emacs-devel

Hi Andreas,

Andreas Röhler <andreas.roehler@online.de> writes:

> what will happen if the before-last line is execute with an element "kind"
> delivered as nil
>
> 	 `(with-no-warnings (called-interactively-p ,kind))
>
> as "kind" is optional in your macro, that might happen AFAIU
>
> Can't see called-interactively-p allows nil delivered as "kind".

There is no instance of `org-called-interactively-p' called with 
a nil argument in Org's code, so that will not happen.

-- 
 Bastien



^ permalink raw reply	[flat|nested] 30+ messages in thread

* Re: Fwd: [emacs-w3m:11603] Re: interactive-p obsolete
  2011-07-07 20:10 ` Fwd: " Stefan Monnier
@ 2011-07-09  2:52   ` Tim Cross
  0 siblings, 0 replies; 30+ messages in thread
From: Tim Cross @ 2011-07-09  2:52 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Andreas Röhler, Emacs developers

On Fri, Jul 8, 2011 at 6:10 AM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>> I'm in favour of keeping interactive-p, resp. undoing that change.
>
> interactive-p is obsolete, which means you should move away from it
> (mostly because it needs an extra arg to know what you mean since
> it's been used with two different meanings).
> But interactive-p still works just as well in Emacs-24 as in previous
> Emacsen, and I'd be surprised if the same doesn't hold for Emacs-25
> (and probably 26 as well).
>

This is an important point. My interpretation of the obsolete warning
is a notice that you need to start planning to update, not hat you
have to do anything right now.

Although its not something I like to do, you can also turn the warning
for obsolete functions 'off'  I have sometimes done this in released
code as users sometimes get concerned when they see lots of warnings
when a package builds. In development code, I avoid disabling any
warnings as they do serve a purpose and I like to know about them all!

Tim



^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2011-07-09  2:52 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-06  6:12 Fwd: [emacs-w3m:11603] Re: interactive-p obsolete Andreas Röhler
2011-07-06  7:09 ` Tim Cross
2011-07-06  8:54   ` Bastien
2011-07-06 18:16     ` Lennart Borgman
2011-07-06 18:33       ` Bastien
2011-07-06 22:51       ` Juanma Barranquero
2011-07-06 23:08         ` Lennart Borgman
2011-07-06 23:10           ` Juanma Barranquero
2011-07-06 23:16             ` Lennart Borgman
2011-07-06 23:32               ` Juanma Barranquero
2011-07-06 23:44                 ` Lennart Borgman
2011-07-06 23:47                   ` Juanma Barranquero
2011-07-06 23:57                     ` Lennart Borgman
2011-07-07  0:01                       ` Juanma Barranquero
2011-07-07  0:12                         ` Lennart Borgman
2011-07-07  0:32                           ` Juanma Barranquero
2011-07-07  0:44                             ` Lennart Borgman
2011-07-07  0:54                               ` Juanma Barranquero
2011-07-07 11:38                                 ` Bastien
2011-07-07 11:50                                   ` Lennart Borgman
2011-07-07 15:37                                     ` Stephen J. Turnbull
2011-07-06 11:22   ` Andreas Röhler
2011-07-07  0:06     ` Tim Cross
2011-07-07  6:52       ` Andreas Röhler
2011-07-07 11:36         ` Bastien
2011-07-07 12:55           ` Andreas Röhler
2011-07-07 13:41             ` Juanma Barranquero
2011-07-08  9:57             ` Bastien
2011-07-07 20:10 ` Fwd: " Stefan Monnier
2011-07-09  2:52   ` Tim Cross

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).