aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2012-04-03 10:10:17 +0200
committerMichael Albinus2012-04-03 10:10:17 +0200
commit9ff687e18187deb02a970db63945f47c396ee41c (patch)
treed0bb286c3bd5f392012224c136acfbee2341c699
parent66b907dcb20e425ea4a9fd1662a3c869aabbcb50 (diff)
downloademacs-9ff687e18187deb02a970db63945f47c396ee41c.tar.gz
emacs-9ff687e18187deb02a970db63945f47c396ee41c.zip
* os.texi (Terminal-Specific): Fix typo.
(Notifications): New section. * elisp.texi (Top): * vol1.texi (Top): * vol2.texi (Top): Add "Notifications" and "Dynamic Libraries" menu entries.
-rw-r--r--doc/lispref/ChangeLog10
-rw-r--r--doc/lispref/elisp.texi2
-rw-r--r--doc/lispref/os.texi150
-rw-r--r--doc/lispref/vol1.texi2
-rw-r--r--doc/lispref/vol2.texi2
5 files changed, 164 insertions, 2 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 5fb4220d86a..c392cb6cf96 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,13 @@
12012-04-03 Michael Albinus <michael.albinus@gmx.de>
2
3 * os.texi (Terminal-Specific): Fix typo.
4 (Notifications): New section.
5
6 * elisp.texi (Top):
7 * vol1.texi (Top):
8 * vol2.texi (Top): Add "Notifications" and "Dynamic Libraries"
9 menu entries.
10
12012-04-01 Chong Yidong <cyd@gnu.org> 112012-04-01 Chong Yidong <cyd@gnu.org>
2 12
3 * files.texi (Kinds of Files): file-subdir-of-p renamed to 13 * files.texi (Kinds of Files): file-subdir-of-p renamed to
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index e3a92d42460..22fc5fac0f0 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -1390,6 +1390,8 @@ Operating System Interface
1390* Batch Mode:: Running Emacs without terminal interaction. 1390* Batch Mode:: Running Emacs without terminal interaction.
1391* Session Management:: Saving and restoring state with 1391* Session Management:: Saving and restoring state with
1392 X Session Management. 1392 X Session Management.
1393* Notifications:: Desktop notifications.
1394* Dynamic Libraries:: On-demand loading of support libraries.
1393 1395
1394Preparing Lisp code for distribution 1396Preparing Lisp code for distribution
1395 1397
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi
index ebf2a35925a..96221f328d6 100644
--- a/doc/lispref/os.texi
+++ b/doc/lispref/os.texi
@@ -35,6 +35,7 @@ terminal and the screen.
35* X11 Keysyms:: Operating on key symbols for X Windows. 35* X11 Keysyms:: Operating on key symbols for X Windows.
36* Batch Mode:: Running Emacs without terminal interaction. 36* Batch Mode:: Running Emacs without terminal interaction.
37* Session Management:: Saving and restoring state with X Session Management. 37* Session Management:: Saving and restoring state with X Session Management.
38* Notifications:: Desktop notifications.
38* Dynamic Libraries:: On-demand loading of support libraries. 39* Dynamic Libraries:: On-demand loading of support libraries.
39@end menu 40@end menu
40 41
@@ -273,7 +274,7 @@ startup screen.
273@ignore 274@ignore
274@c I do not think this should be mentioned. AFAICS it is just a dodge 275@c I do not think this should be mentioned. AFAICS it is just a dodge
275@c around inhibit-startup-screen not being settable on a site-wide basis. 276@c around inhibit-startup-screen not being settable on a site-wide basis.
276If its value is @code{t}, Emacs displays the @samp{*scratch*} buffer. 277If its value is @code{t}, Emacs displays the @samp{*scratch*} buffer.
277@end ignore 278@end ignore
278@end defopt 279@end defopt
279 280
@@ -461,7 +462,7 @@ experimenting with your own peculiar customizations.
461 You can also arrange to override some of the actions of the 462 You can also arrange to override some of the actions of the
462terminal-specific library by setting the variable 463terminal-specific library by setting the variable
463@code{term-setup-hook}. This is a normal hook that Emacs runs 464@code{term-setup-hook}. This is a normal hook that Emacs runs
464at the end its initialization, after loading both 465at the end of its initialization, after loading both
465your init file and any terminal-specific libraries. You could 466your init file and any terminal-specific libraries. You could
466use this hook to define initializations for terminals that do not 467use this hook to define initializations for terminals that do not
467have their own libraries. @xref{Hooks}. 468have their own libraries. @xref{Hooks}.
@@ -2249,6 +2250,151 @@ Emacs is restarted by the session manager.
2249@end group 2250@end group
2250@end example 2251@end example
2251 2252
2253@node Notifications
2254@section Desktop Notifications
2255@cindex desktop notifications
2256
2257Emacs is able to send notifications on systems which support the
2258desktop notification specification of freedesktop.org. In order to
2259use this functionality, the package @code{notifications} must be loaded.
2260
2261@defun notifications-notify &rest params
2262This function sends a notification to the desktop via D-Bus.
2263Various @var{params} can be set, none of them is mandatory:
2264
2265@table @code
2266@item :title @var{title}
2267The notification title.
2268
2269@item :body @var{text}
2270The notification body text. Depending on the implementation of the
2271notification server, the text could contain HTML markups, like
2272@samp{"<b>bold text</b>"}, or hyperlinks.
2273
2274@item :app-name @var{name}
2275The name of the application sending the notification. Default is
2276@code{notifications-application-name}.
2277
2278@item :replaces-id @var{id}
2279The notification @var{id} that this notification replaces. @var{id}
2280must be the result of a previous @code{notifications-notify} call.
2281
2282@item :app-icon @var{icon-file}
2283The file name of the notification icon. If set to @code{nil}, no icon
2284is displayed. Default is @code{notifications-application-icon}.
2285
2286@item :actions (@var{key} @var{title} @var{key} @var{title} ...)
2287A list of actions to be applied. @var{key} and @var{title} are both
2288strings. The default action (usually invoked by clicking the
2289notification) should have a key named @samp{"default"}. The title can
2290be anything, though implementations are free not to display it.
2291
2292@item :timeout @var{timeout}
2293The timeout time in milliseconds since the display of the notification
2294at which the notification should automatically close. If -1, the
2295notification's expiration time is dependent on the notification
2296server's settings, and may vary for the type of notification. If 0,
2297the notification never expires. Default value is -1.
2298
2299@item :urgency @var{urgency}
2300The urgency level. It can be @code{low}, @code{normal} or @code{critical}.
2301
2302@item :category @var{category}
2303The type of notification this is, a string.
2304
2305@item :desktop-entry @var{filename}
2306This specifies the name of the desktop filename representing the
2307calling program, like @samp{"emacs"}.
2308
2309@item :image-data (@var{width} @var{height} @var{rowstride} @var{has-alpha} @var{bits} @var{channels} @var{data})
2310This is a raw data image format which describes the width, height,
2311rowstride, has alpha, bits per sample, channels and image data
2312respectively.
2313
2314@item :image-path @var{path}
2315This is represented either as a URI (@samp{file://} is the only URI
2316schema supported right now) or a name in a freedesktop.org-compliant
2317icon theme from @samp{$XDG_DATA_DIRS/icons}, like @samp{"mail-message-new"}.
2318
2319@item :sound-file @var{filename}
2320The path to a sound file to play when the notification pops up.
2321
2322@item :sound-name @var{name}
2323A themable named sound from the freedesktop.org sound naming
2324specification from @samp{$XDG_DATA_DIRS/sounds}, to play when the
2325notification pops up. Similar to the icon name, only for sounds. An
2326example would be @samp{"message-new-instant"}.
2327
2328@item :suppress-sound
2329Causes the server to suppress playing any sounds, if it has that
2330ability.
2331
2332@item :x @var{position}
2333@itemx :y @var{position}
2334Specifies the X respectively Y location on the screen that the
2335notification should point to. Both arguments must be used together.
2336
2337@item :on-action @var{function}
2338Function to call when an action is invoked. The notification @var{id}
2339and the @var{key} of the action are passed as arguments to the
2340function.
2341
2342@item :on-close @var{function}
2343Function to call when the notification has been closed by timeout or
2344by the user. The function receive the notification @var{id} and the closing
2345@var{reason} as arguments:
2346
2347@itemize
2348@item @code{expired} if the notification has expired
2349@item @code{dismissed} if the notification was dismissed by the user
2350@item @code{close-notification} if the notification was closed by a call to
2351@code{notifications-close-notification}
2352@item @code{undefined} if the notification server hasn't provided a reason
2353@end itemize
2354@end table
2355
2356This function returns a notification id, an integer, which can be used
2357to manipulate the notification item with
2358@code{notifications-close-notification} or the @code{:replaces-id}
2359argument of another @code{notifications-notify} call.
2360
2361Example:
2362
2363@example
2364@group
2365(defun my-on-action-function (id key)
2366 (message "Message %d, key \"%s\" pressed" id key))
2367 @result{} my-on-action-function
2368@end group
2369
2370@group
2371(defun my-on-close-function (id reason)
2372 (message "Message %d, closed due to \"%s\"" id reason))
2373 @result{} my-on-close-function
2374@end group
2375
2376@group
2377(notifications-notify
2378 :title "Title"
2379 :body "This is <b>important</b>."
2380 :actions '("Confirm" "I agree" "Refuse" "I disagree")
2381 :on-action 'my-on-action-function
2382 :on-close 'my-on-close-function)
2383 @result{} 22
2384@end group
2385
2386@group
2387A message window opens on the desktop. Press "I agree"
2388 @result{} Message 22, key "Confirm" pressed
2389 Message 22, closed due to "dismissed"
2390@end group
2391@end example
2392@end defun
2393
2394@defun notifications-close-notification id
2395This function closes a notification with identifier ID.
2396@end defun
2397
2252@node Dynamic Libraries 2398@node Dynamic Libraries
2253@section Dynamically Loaded Libraries 2399@section Dynamically Loaded Libraries
2254@cindex dynamic libraries 2400@cindex dynamic libraries
diff --git a/doc/lispref/vol1.texi b/doc/lispref/vol1.texi
index f2cbb18af1c..a4af27cf279 100644
--- a/doc/lispref/vol1.texi
+++ b/doc/lispref/vol1.texi
@@ -1412,6 +1412,8 @@ Operating System Interface
1412* Batch Mode:: Running Emacs without terminal interaction. 1412* Batch Mode:: Running Emacs without terminal interaction.
1413* Session Management:: Saving and restoring state with 1413* Session Management:: Saving and restoring state with
1414 X Session Management. 1414 X Session Management.
1415* Notifications:: Desktop notifications.
1416* Dynamic Libraries:: On-demand loading of support libraries.
1415 1417
1416Preparing Lisp code for distribution 1418Preparing Lisp code for distribution
1417 1419
diff --git a/doc/lispref/vol2.texi b/doc/lispref/vol2.texi
index 837fcbe7f59..af4e455788d 100644
--- a/doc/lispref/vol2.texi
+++ b/doc/lispref/vol2.texi
@@ -1411,6 +1411,8 @@ Operating System Interface
1411* Batch Mode:: Running Emacs without terminal interaction. 1411* Batch Mode:: Running Emacs without terminal interaction.
1412* Session Management:: Saving and restoring state with 1412* Session Management:: Saving and restoring state with
1413 X Session Management. 1413 X Session Management.
1414* Notifications:: Desktop notifications.
1415* Dynamic Libraries:: On-demand loading of support libraries.
1414 1416
1415Preparing Lisp code for distribution 1417Preparing Lisp code for distribution
1416 1418