all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* tramp-compat-funcall -> compat-funcall?
@ 2016-09-22 11:04 Ted Zlatanov
  2016-09-22 12:31 ` Stefan Monnier
  0 siblings, 1 reply; 17+ messages in thread
From: Ted Zlatanov @ 2016-09-22 11:04 UTC (permalink / raw)
  To: emacs-devel

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




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

end of thread, other threads:[~2016-09-25 17:23 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.