From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: tramp-compat-funcall -> compat-funcall? Date: Thu, 22 Sep 2016 07:04:28 -0400 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87lgykci0z.fsf@lifelogs.com> Reply-To: emacs-devel@gnu.org NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1474542335 27083 195.159.176.226 (22 Sep 2016 11:05:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 22 Sep 2016 11:05:35 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 22 13:05:30 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bn1oc-00057b-0N for ged-emacs-devel@m.gmane.org; Thu, 22 Sep 2016 13:05:18 +0200 Original-Received: from localhost ([::1]:38849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn1oa-0007HJ-7F for ged-emacs-devel@m.gmane.org; Thu, 22 Sep 2016 07:05:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn1oQ-0007CW-QQ for emacs-devel@gnu.org; Thu, 22 Sep 2016 07:05:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn1oL-0007ox-N8 for emacs-devel@gnu.org; Thu, 22 Sep 2016 07:05:05 -0400 Original-Received: from [195.159.176.226] (port=56054 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn1oL-0007nk-HT for emacs-devel@gnu.org; Thu, 22 Sep 2016 07:05:01 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bn1o8-0001gM-Dz for emacs-devel@gnu.org; Thu, 22 Sep 2016 13:04:48 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 22 Original-X-Complaints-To: usenet@blaine.gmane.org X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Copies-To: never Cancel-Lock: sha1:JAijf7f8i54EhOcXjNdSQPkb23o= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:207688 Archived-At: Looking at some recent things Michael did in Tramp, I noticed this function in tramp-compat.el: ;; For not existing functions, obsolete functions, or functions with a ;; changed argument list, there are compiler warnings. We want to ;; avoid them in cases we know what we do. (defmacro tramp-compat-funcall (function &rest arguments) "Call FUNCTION if it exists. Do not raise compiler warnings." `(when (or (subrp ,function) (functionp ,function)) (with-no-warnings (funcall ,function ,@arguments)))) I think it would be a great addition to the Emacs core, so other packages can use it. It just needs to be copied and then Tramp can switch to it. Here's an example of a reimplementation that's not as good (it seems) in gnus-fun.el: (defun gnus-funcall-no-warning (function &rest args) (when (fboundp function) (apply function args))) Thanks Ted