]> code.delx.au - gnu-emacs/blobdiff - lisp/net/zeroconf.el
Merge from origin/emacs-25
[gnu-emacs] / lisp / net / zeroconf.el
index d801a4c094c2901f33a2eee1d22d281ded37d766..421c1953e3313f17bc82736609d60fff727a3497 100644 (file)
@@ -1,6 +1,6 @@
 ;;; zeroconf.el --- Service browser using Avahi.
 
 ;;; zeroconf.el --- Service browser using Avahi.
 
-;; Copyright (C) 2008-2011 Free Software Foundation, Inc.
+;; Copyright (C) 2008-2016 Free Software Foundation, Inc.
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, hardware
 
 ;; Author: Michael Albinus <michael.albinus@gmx.de>
 ;; Keywords: comm, hardware
@@ -82,7 +82,7 @@
 
 ;; The function `zeroconf-publish-service' publishes a new service to
 ;; the Avahi daemon.  Although the domain, where to the service is
 
 ;; The function `zeroconf-publish-service' publishes a new service to
 ;; the Avahi daemon.  Although the domain, where to the service is
-;; published, can be specified by this function, it is usally the
+;; published, can be specified by this function, it is usually the
 ;; default domain "local" (also written as nil or "").
 
 ;;   (zeroconf-publish-service
 ;; default domain "local" (also written as nil or "").
 
 ;;   (zeroconf-publish-service
 ;;  Pacify byte-compiler.  D-Bus support in the Emacs core can be
 ;; disabled with configuration option "--without-dbus".  Declare used
 ;; subroutines and variables of `dbus' therefore.
 ;;  Pacify byte-compiler.  D-Bus support in the Emacs core can be
 ;; disabled with configuration option "--without-dbus".  Declare used
 ;; subroutines and variables of `dbus' therefore.
-(eval-when-compile
-  (require 'cl))
-
-(declare-function dbus-call-method "dbusbind.c")
-(declare-function dbus-register-signal "dbusbind.c")
 (defvar dbus-debug)
 
 (require 'dbus)
 (defvar dbus-debug)
 
 (require 'dbus)
@@ -202,7 +197,7 @@ The key of an entry is the concatenation of the service name and
 service type of a discovered service.  The value is the service
 itself.  The format of a service is
 
 service type of a discovered service.  The value is the service
 itself.  The format of a service is
 
-  \(INTERFACE PROTOCOL NAME TYPE DOMAIN FLAGS\)
+  \(INTERFACE PROTOCOL NAME TYPE DOMAIN FLAGS)
 
 The INTERFACE is a number, which represents the network interface
 the service is located at.  The corresponding network interface
 
 The INTERFACE is a number, which represents the network interface
 the service is located at.  The corresponding network interface
@@ -238,7 +233,7 @@ The key of an entry is the concatenation of the service name and
 service type of a resolved service.  The value is the service
 itself.  The format of a service is
 
 service type of a resolved service.  The value is the service
 itself.  The format of a service is
 
-  \(INTERFACE PROTOCOL NAME TYPE DOMAIN HOST APROTOCOL ADDRESS PORT TXT FLAGS\)
+  (INTERFACE PROTOCOL NAME TYPE DOMAIN HOST APROTOCOL ADDRESS PORT TXT FLAGS)
 
 INTERFACE, PROTOCOL, NAME, TYPE, DOMAIN and FLAGS have the same
 meaning as in `zeroconf-services-hash'.
 
 INTERFACE, PROTOCOL, NAME, TYPE, DOMAIN and FLAGS have the same
 meaning as in `zeroconf-services-hash'.
@@ -249,7 +244,7 @@ qualified name, i.e., it contains DOMAIN.
 APROTOCOL stands for the network protocol family ADDRESS is
 encoded (`zeroconf-avahi-protocol-inet4' means INET4,
 `zeroconf-avahi-protocol-inet6' means INET6).  It can be
 APROTOCOL stands for the network protocol family ADDRESS is
 encoded (`zeroconf-avahi-protocol-inet4' means INET4,
 `zeroconf-avahi-protocol-inet6' means INET6).  It can be
-different from PROTOCOL, when an adrress resolution has been
+different from PROTOCOL, when an address resolution has been
 requested for another protocol family but the default one.
 
 ADDRESS is the service address, encoded according to the
 requested for another protocol family but the default one.
 
 ADDRESS is the service address, encoded according to the
@@ -280,7 +275,7 @@ supported keys depend on the service type.")
   "Returns all discovered Avahi services for a given service type TYPE.
 The service type is one of the returned values of
 `zeroconf-list-service-types'.  The return value is a list
   "Returns all discovered Avahi services for a given service type TYPE.
 The service type is one of the returned values of
 `zeroconf-list-service-types'.  The return value is a list
-\(SERVICE1 SERVICE2 ...\).  See `zeroconf-services-hash' for the
+\(SERVICE1 SERVICE2 ...).  See `zeroconf-services-hash' for the
 format of SERVICE."
   (let (result)
     (maphash
 format of SERVICE."
   (let (result)
     (maphash
@@ -390,7 +385,7 @@ type used when registering FUNCTION."
 NAME must be a string.  The service must be of service type
 TYPE. The resulting list has the format
 
 NAME must be a string.  The service must be of service type
 TYPE. The resulting list has the format
 
-  \(INTERFACE PROTOCOL NAME TYPE DOMAIN FLAGS\)."
+  (INTERFACE PROTOCOL NAME TYPE DOMAIN FLAGS)."
   ;; Due to the service browser, all known services are kept in
   ;; `zeroconf-services-hash'.
   (gethash (concat name "/" type) zeroconf-services-hash nil))
   ;; Due to the service browser, all known services are kept in
   ;; `zeroconf-services-hash'.
   (gethash (concat name "/" type) zeroconf-services-hash nil))
@@ -400,7 +395,7 @@ TYPE. The resulting list has the format
 NAME must be a string.  The service must be of service type
 TYPE. The resulting list has the format
 
 NAME must be a string.  The service must be of service type
 TYPE. The resulting list has the format
 
-  \(INTERFACE PROTOCOL NAME TYPE DOMAIN HOST APROTOCOL ADDRESS PORT TXT FLAGS\)."
+  (INTERFACE PROTOCOL NAME TYPE DOMAIN HOST APROTOCOL ADDRESS PORT TXT FLAGS)."
   (let* ((name (zeroconf-service-name service))
         (type (zeroconf-service-type service))
         (key (concat name "/" type)))
   (let* ((name (zeroconf-service-name service))
         (type (zeroconf-service-type service))
         (key (concat name "/" type)))
@@ -486,7 +481,7 @@ TYPE. The resulting list has the format
   (nth 9 (zeroconf-resolve-service service)))
 
 \f
   (nth 9 (zeroconf-resolve-service service)))
 
 \f
-;;; Services signalling.
+;;; Services signaling.
 
 ;; Register for the service type browser.  Service registrations will
 ;; happen in `zeroconf-service-type-browser-handler', when there is an
 
 ;; Register for the service type browser.  Service registrations will
 ;; happen in `zeroconf-service-type-browser-handler', when there is an
@@ -548,7 +543,7 @@ DOMAIN is nil, the local domain is used."
    ((string-equal (dbus-event-member-name last-input-event) "ItemNew")
     ;; Parameters: (interface protocol type domain flags)
     ;; Register a service browser.
    ((string-equal (dbus-event-member-name last-input-event) "ItemNew")
     ;; Parameters: (interface protocol type domain flags)
     ;; Register a service browser.
-    (let ((object-path (zeroconf-register-service-browser (nth-value 2 val))))
+    (let ((object-path (zeroconf-register-service-browser (nth 2 val))))
       ;; Register the signals.
       (dolist (member '("ItemNew" "ItemRemove" "Failure"))
        (dbus-register-signal
       ;; Register the signals.
       (dolist (member '("ItemNew" "ItemRemove" "Failure"))
        (dbus-register-signal