diff options
| author | Michael Albinus | 2010-07-03 12:52:17 +0200 |
|---|---|---|
| committer | Michael Albinus | 2010-07-03 12:52:17 +0200 |
| commit | 112dbc0eee5f7960fd754fb75e44d998cf9b4a5b (patch) | |
| tree | b5597113a55e896371091b5104a933587b277a26 | |
| parent | ad3e6f4474d2737be89456332319e8efbdb382c4 (diff) | |
| download | emacs-112dbc0eee5f7960fd754fb75e44d998cf9b4a5b.tar.gz emacs-112dbc0eee5f7960fd754fb75e44d998cf9b4a5b.zip | |
* net/zeroconf.el (zeroconf-service-remove-hook): New defun.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/net/zeroconf.el | 17 |
2 files changed, 21 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index e791d21f507..50de27e6b2d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2010-07-03 Jan Moringen <jan.moringen@uni-bielefeld.de> | ||
| 2 | |||
| 3 | * net/zeroconf.el (zeroconf-service-remove-hook): New defun. | ||
| 4 | |||
| 1 | 2010-06-30 Dan Nicolaescu <dann@ics.uci.edu> | 5 | 2010-06-30 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 6 | ||
| 3 | Avoid displaying files with a nil state in vc-dir. | 7 | Avoid displaying files with a nil state in vc-dir. |
diff --git a/lisp/net/zeroconf.el b/lisp/net/zeroconf.el index b0b98fc57f3..43719aa9763 100644 --- a/lisp/net/zeroconf.el +++ b/lisp/net/zeroconf.el | |||
| @@ -336,6 +336,23 @@ The attributes of SERVICE can be retrieved via the functions | |||
| 336 | (puthash type l-hook zeroconf-service-removed-hooks-hash))) | 336 | (puthash type l-hook zeroconf-service-removed-hooks-hash))) |
| 337 | (t (error "EVENT must be either `:new' or `:removed'")))) | 337 | (t (error "EVENT must be either `:new' or `:removed'")))) |
| 338 | 338 | ||
| 339 | (defun zeroconf-service-remove-hook (type event function) | ||
| 340 | "Remove FUNCTION from the hook of service type TYPE. | ||
| 341 | |||
| 342 | EVENT must be either :new or :removed and has to match the event | ||
| 343 | type used when registering FUNCTION." | ||
| 344 | (let* ((table (cond | ||
| 345 | ((equal event :new) | ||
| 346 | zeroconf-service-added-hooks-hash) | ||
| 347 | ((equal event :removed) | ||
| 348 | zeroconf-service-removed-hooks-hash) | ||
| 349 | (t (error "EVENT must be either `:new' or `:removed'")))) | ||
| 350 | (l-hook (gethash type table nil))) | ||
| 351 | (remove-hook 'l-hook function) | ||
| 352 | (if l-hook | ||
| 353 | (puthash type l-hook table) | ||
| 354 | (remhash type table)))) | ||
| 355 | |||
| 339 | (defun zeroconf-get-host () | 356 | (defun zeroconf-get-host () |
| 340 | "Returns the local host name as string." | 357 | "Returns the local host name as string." |
| 341 | (dbus-call-method | 358 | (dbus-call-method |