[Top][All Lists]

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

tramp-compat-funcall -> compat-funcall?

From: Ted Zlatanov
Subject: tramp-compat-funcall -> compat-funcall?
Date: Thu, 22 Sep 2016 07:04:28 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

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)))


reply via email to

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