aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2008-02-06 21:31:16 +0000
committerMichael Albinus2008-02-06 21:31:16 +0000
commit06c0751a07882220836c83256c12b87e723f5877 (patch)
tree0e2e197dfc13b714451558befd8a744079f334b7
parent4ba11bcb85896ea1201edb4f03b7b0a30c93334b (diff)
downloademacs-06c0751a07882220836c83256c12b87e723f5877.tar.gz
emacs-06c0751a07882220836c83256c12b87e723f5877.zip
* dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
(Inspection): New function dbus-ping.
-rw-r--r--doc/misc/ChangeLog5
-rw-r--r--doc/misc/dbus.texi59
-rw-r--r--lisp/ChangeLog7
3 files changed, 50 insertions, 21 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index eb6958e0485..977def73eed 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,8 @@
12008-02-06 Michael Albinus <michael.albinus@gmx.de>
2
3 * dbus.texi (all): Wrap Lisp code examples with @lisp ... @end lisp.
4 (Inspection): New function dbus-ping.
5
12008-02-05 Michael Albinus <michael.albinus@gmx.de> 62008-02-05 Michael Albinus <michael.albinus@gmx.de>
2 7
3 * tramp.texi (Remote processes): Add `shell-command'. 8 * tramp.texi (Remote processes): Add `shell-command'.
diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi
index 27550337b39..392f9a85dab 100644
--- a/doc/misc/dbus.texi
+++ b/doc/misc/dbus.texi
@@ -158,14 +158,33 @@ string.
158 158
159@defun dbus-get-name-owner bus service 159@defun dbus-get-name-owner bus service
160For a given service, registered at D-Bus @var{bus} under the name 160For a given service, registered at D-Bus @var{bus} under the name
161@var{service}, the unique name of the name owner is returned. The result is a 161@var{service}, the unique name of the name owner is returned. The
162string, or @code{nil} when there exist no name owner of @var{service}. 162result is a string, or @code{nil} when there exist no name owner of
163@var{service}.
163 164
164@var{bus} must be either the symbol @code{:system} or the symbol 165@var{bus} must be either the symbol @code{:system} or the symbol
165@code{:session}. @var{service} must be a known service name as 166@code{:session}. @var{service} must be a known service name as
166string. 167string.
167@end defun 168@end defun
168 169
170@defun dbus-ping bus service
171Check whether the service name @var{service} is registered at D-Bus
172@var{bus}. @var{service} might not have been started yet. The result
173is either @code{t} or @code{nil}.
174
175@var{bus} must be either the symbol @code{:system} or the symbol
176@code{:session}. @var{service} must be a string. Example:
177
178@lisp
179(message
180 "%s screensaver on board."
181 (cond
182 ((dbus-ping :session "org.gnome.ScreenSaver") "Gnome")
183 ((dbus-ping :session "org.freedesktop.ScreenSaver") "KDE")
184 (t "No")))
185@end lisp
186@end defun
187
169@defun dbus-get-unique-name bus 188@defun dbus-get-unique-name bus
170The unique name, under which Emacs is registered at D-Bus @var{bus}, 189The unique name, under which Emacs is registered at D-Bus @var{bus},
171is returned as string. 190is returned as string.
@@ -185,7 +204,7 @@ returns all interfaces of @var{service}, registered at object path
185strings. The result, the introspection data, is a string in XML 204strings. The result, the introspection data, is a string in XML
186format. Example: 205format. Example:
187 206
188@example 207@lisp
189(dbus-introspect 208(dbus-introspect
190 :system "org.freedesktop.Hal" 209 :system "org.freedesktop.Hal"
191 "/org/freedesktop/Hal/devices/computer") 210 "/org/freedesktop/Hal/devices/computer")
@@ -206,7 +225,7 @@ format. Example:
206 </interface> 225 </interface>
207 @dots{} 226 @dots{}
208 </node>" 227 </node>"
209@end example 228@end lisp
210 229
211This example informs us, that the service @code{org.freedesktop.Hal} 230This example informs us, that the service @code{org.freedesktop.Hal}
212at object path @code{/org/freedesktop/Hal/devices/computer} offers the 231at object path @code{/org/freedesktop/Hal/devices/computer} offers the
@@ -422,20 +441,20 @@ The function returns the resulting values of @var{method} as a list of
422Lisp objects, according to the type conversion rules described in 441Lisp objects, according to the type conversion rules described in
423@ref{Type Conversion}. Example: 442@ref{Type Conversion}. Example:
424 443
425@example 444@lisp
426(dbus-call-method 445(dbus-call-method
427 :session "org.gnome.seahorse" "/org/gnome/seahorse/keys/openpgp" 446 :session "org.gnome.seahorse" "/org/gnome/seahorse/keys/openpgp"
428 "org.gnome.seahorse.Keys" "GetKeyField" 447 "org.gnome.seahorse.Keys" "GetKeyField"
429 "openpgp:657984B8C7A966DD" "simple-name") 448 "openpgp:657984B8C7A966DD" "simple-name")
430 449
431@result{} (t ("Philip R. Zimmermann")) 450@result{} (t ("Philip R. Zimmermann"))
432@end example 451@end lisp
433 452
434If the result of the method call is just one value, the converted Lisp 453If the result of the method call is just one value, the converted Lisp
435object is returned instead of a list containing this single Lisp 454object is returned instead of a list containing this single Lisp
436object. Example: 455object. Example:
437 456
438@example 457@lisp
439(dbus-call-method 458(dbus-call-method
440 :system "org.freedesktop.Hal" 459 :system "org.freedesktop.Hal"
441 "/org/freedesktop/Hal/devices/computer" 460 "/org/freedesktop/Hal/devices/computer"
@@ -443,7 +462,7 @@ object. Example:
443 "system.kernel.machine") 462 "system.kernel.machine")
444 463
445@result{} "i686" 464@result{} "i686"
446@end example 465@end lisp
447 466
448With the @code{dbus-introspect} function it is possible to explore the 467With the @code{dbus-introspect} function it is possible to explore the
449interfaces of @samp{org.freedesktop.Hal} service. It offers the 468interfaces of @samp{org.freedesktop.Hal} service. It offers the
@@ -454,7 +473,7 @@ path @samp{/org/freedesktop/Hal/devices}. With the methods
454@samp{GetAllDevices} and @samp{GetAllProperties}, it is simple to 473@samp{GetAllDevices} and @samp{GetAllProperties}, it is simple to
455emulate the @code{lshal} command on GNU/Linux systems: 474emulate the @code{lshal} command on GNU/Linux systems:
456 475
457@example 476@lisp
458(dolist (device 477(dolist (device
459 (dbus-call-method 478 (dbus-call-method
460 :system "org.freedesktop.Hal" 479 :system "org.freedesktop.Hal"
@@ -484,7 +503,7 @@ emulate the @code{lshal} command on GNU/Linux systems:
484 system.chassis.type = \"Notebook\" 503 system.chassis.type = \"Notebook\"
485 system.firmware.release_date = \"03/19/2005\" 504 system.firmware.release_date = \"03/19/2005\"
486 @dots{}" 505 @dots{}"
487@end example 506@end lisp
488@end defun 507@end defun
489 508
490 509
@@ -530,7 +549,7 @@ can be composed like the input parameters in @ref{Type Conversion}.
530as argument in @code{dbus-unregister-object} for removing the 549as argument in @code{dbus-unregister-object} for removing the
531registration for @var{method}. Example: 550registration for @var{method}. Example:
532 551
533@example 552@lisp
534(defun my-dbus-method-handler (filename) 553(defun my-dbus-method-handler (filename)
535 (let (result) 554 (let (result)
536 (if (find-file filename) 555 (if (find-file filename)
@@ -548,7 +567,7 @@ registration for @var{method}. Example:
548@result{} ((:system "org.freedesktop.TextEditor" "OpenFile") 567@result{} ((:system "org.freedesktop.TextEditor" "OpenFile")
549 ("org.freedesktop.TextEditor" "/org/freedesktop/TextEditor" 568 ("org.freedesktop.TextEditor" "/org/freedesktop/TextEditor"
550 my-method-handler)) 569 my-method-handler))
551@end example 570@end lisp
552 571
553If you invoke the method @code{org.freedesktop.TextEditor.OpenFile} 572If you invoke the method @code{org.freedesktop.TextEditor.OpenFile}
554from another D-Bus application with a filename as parameter, the file 573from another D-Bus application with a filename as parameter, the file
@@ -592,11 +611,11 @@ All other arguments args are passed to @var{signal} as arguments.
592They are converted into D-Bus types as described in @ref{Type 611They are converted into D-Bus types as described in @ref{Type
593Conversion}. Example: 612Conversion}. Example:
594 613
595@example 614@lisp
596(dbus-send-signal 615(dbus-send-signal
597 :session "org.gnu.Emacs" "/org/gnu/Emacs" 616 :session "org.gnu.Emacs" "/org/gnu/Emacs"
598 "org.gnu.Emacs.FileManager" "FileModified" "/home/albinus/.emacs") 617 "org.gnu.Emacs.FileManager" "FileModified" "/home/albinus/.emacs")
599@end example 618@end lisp
600@end defun 619@end defun
601 620
602@defun dbus-register-signal bus service path interface signal handler 621@defun dbus-register-signal bus service path interface signal handler
@@ -626,7 +645,7 @@ provide @var{signal}.
626received. It must accept as arguments the output parameters 645received. It must accept as arguments the output parameters
627@var{signal} is sending. Example: 646@var{signal} is sending. Example:
628 647
629@example 648@lisp
630(defun my-dbus-signal-handler (device) 649(defun my-dbus-signal-handler (device)
631 (message "Device %s added" device)) 650 (message "Device %s added" device))
632 651
@@ -640,7 +659,7 @@ received. It must accept as arguments the output parameters
640@result{} ((:system "org.freedesktop.Hal.Manager" "DeviceAdded") 659@result{} ((:system "org.freedesktop.Hal.Manager" "DeviceAdded")
641 ("org.freedesktop.Hal" "/org/freedesktop/Hal/Manager" 660 ("org.freedesktop.Hal" "/org/freedesktop/Hal/Manager"
642 my-signal-handler)) 661 my-signal-handler))
643@end example 662@end lisp
644 663
645As we know from the inspection data of interface 664As we know from the inspection data of interface
646@code{org.freedesktop.Hal.Manager}, the signal @code{DeviceAdded} 665@code{org.freedesktop.Hal.Manager}, the signal @code{DeviceAdded}
@@ -687,9 +706,9 @@ errors can be made visible when variable @code{dbus-debug} is set to
687Incoming D-Bus messages are handled as Emacs events (see @pxref{Misc 706Incoming D-Bus messages are handled as Emacs events (see @pxref{Misc
688Events, , , elisp}). The generated event has this form: 707Events, , , elisp}). The generated event has this form:
689 708
690@example 709@lisp
691(dbus-event @var{bus} @var{serial} @var{service} @var{path} @var{interface} @var{member} @var{handler} &rest @var{args}) 710(dbus-event @var{bus} @var{serial} @var{service} @var{path} @var{interface} @var{member} @var{handler} &rest @var{args})
692@end example 711@end lisp
693 712
694@var{bus} identifies the D-Bus the signal is coming from. It is 713@var{bus} identifies the D-Bus the signal is coming from. It is
695either the symbol @code{:system} or the symbol @code{:session}. 714either the symbol @code{:system} or the symbol @code{:session}.
@@ -708,10 +727,10 @@ arrives, @var{handler} is called with @var{args} as arguments.
708In order to inspect the @code{dbus-event} data, you could extend the 727In order to inspect the @code{dbus-event} data, you could extend the
709definition of the callback function in @ref{Signals}: 728definition of the callback function in @ref{Signals}:
710 729
711@example 730@lisp
712(defun my-dbus-signal-handler (&rest args) 731(defun my-dbus-signal-handler (&rest args)
713 (message "my-dbus-signal-handler: %S" last-input-event)) 732 (message "my-dbus-signal-handler: %S" last-input-event))
714@end example 733@end lisp
715 734
716There exist convenience functions which could be called inside a 735There exist convenience functions which could be called inside a
717callback function in order to retrieve the information from the event. 736callback function in order to retrieve the information from the event.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0304dd5ea27..6b0c5de8824 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12008-02-06 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/dbus.el (dbus-interface-peer): New defconst.
4 (dbus-ping): New defun.
5
12008-02-06 Sam Steingold <sds@gnu.org> 62008-02-06 Sam Steingold <sds@gnu.org>
2 7
3 * vc-hooks.el (vc-prefix-key): New user-customizable variable. 8 * vc-hooks.el (vc-prefix-key): New user-customizable variable.
@@ -4800,7 +4805,7 @@
48002008-01-06 Dan Nicolaescu <dann@ics.uci.edu> 48052008-01-06 Dan Nicolaescu <dann@ics.uci.edu>
4801 4806
4802 * vc.el (vc-status-fileinfo): New defstruct. 4807 * vc.el (vc-status-fileinfo): New defstruct.
4803 (vc-status): New defvar 4808 (vc-status): New defvar.
4804 (vc-status-insert-headers, vc-status-printer, vc-status) 4809 (vc-status-insert-headers, vc-status-printer, vc-status)
4805 (vc-status-mode-map, vc-status-mode, vc-status-mark-file) 4810 (vc-status-mode-map, vc-status-mode, vc-status-mark-file)
4806 (vc-status-unmark-file, vc-status-marked-files): New functions. 4811 (vc-status-unmark-file, vc-status-marked-files): New functions.