unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: tramp-compat-funcall -> compat-funcall?
Date: Sat, 24 Sep 2016 08:54:31 +0200	[thread overview]
Message-ID: <87oa3dkct4.fsf@gmx.de> (raw)
In-Reply-To: <jwvfuoqehyu.fsf-monnier+gmane.emacs.devel@gnu.org> (Stefan Monnier's message of "Fri, 23 Sep 2016 11:49:50 -0400")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> The use case, I think, is "to provide compatibility with older Emacsen,
>> I need a convenient way to call a function softly without compiler
>> warnings if it doesn't exist." I think, based on the two examples I gave
>> (`gnus-funcall-no-warning' was the other instance), that it's not an
>> uncommon need, and it's better to provide it in a core facility than ask
>> package maintainers to implement it.
>
> There's  (if (fboundp '<foo>) (<foo> <bar>))  already (which is much
> better than tramp-compat-funcall since it says explicitly what to do if
> the function doesn't exist).
>
> So the question is what to do for the use cases of
> tramp-compat-funcall not covered by this if/fboundp idiom.

Your code snippet misses the `with-no-warnings' umbrella.

The <bar> part is not part of the `tramp-compat-funcall' spec by
intention. It will be always compatibility code, which I don't want to
see in the mainstream code. All such compatibility code is collected in
tramp-compat.el, in the Tramp case. Furthermore, there's not only the
case that <foo> does not exist, but there might be abother argument list
now. Also handled in tramp-compat.el.

`tramp-compat-funcall' has its history, and it was more complex when it
had to support also XEmacs. It's simpler now, but I like to identify all
backward compatibility code in Tramp by searching "C-s tramp-compat".
That covers all objects declared in tramp-compat.el. This makes
maintenance much easier, for example back in January when I removed
XEmacs and Emacs 22 support.

It doesn't hurt, so I prefer to keep it in Tramp.

>         Stefan

Best regards, Michael.



  reply	other threads:[~2016-09-24  6:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-22 11:04 tramp-compat-funcall -> compat-funcall? Ted Zlatanov
2016-09-22 12:31 ` Stefan Monnier
2016-09-22 13:22   ` Michael Albinus
2016-09-22 17:46     ` Stefan Monnier
2016-09-22 17:54       ` Michael Albinus
2016-09-22 18:23         ` Stefan Monnier
2016-09-22 20:18   ` Ted Zlatanov
2016-09-23 15:49     ` Stefan Monnier
2016-09-24  6:54       ` Michael Albinus [this message]
2016-09-24 13:57         ` Stefan Monnier
2016-09-24 15:39           ` Michael Albinus
2016-09-24 18:40             ` Stefan Monnier
2016-09-25 11:44               ` Michael Albinus
2016-09-25 14:00                 ` Stefan Monnier
2016-09-25 17:23                   ` Ted Zlatanov
2016-09-24 22:42           ` Ted Zlatanov
2016-09-25 14:17             ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oa3dkct4.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).