Now on revision 108026. ------------------------------------------------------------ revno: 108026 committer: Michael Albinus branch nick: trunk timestamp: Tue 2012-04-24 23:52:37 +0200 message: Add `notifications-get-capabilities' of notifications.el. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-04-24 07:09:27 +0000 +++ etc/NEWS 2012-04-24 21:52:37 +0000 @@ -137,6 +137,11 @@ +++ *** There is a new function `dbus-setenv'. ++++ +** notifications.el supports now version 1.2 of the Notifications API. +The function `notifications-get-capabilities' returns the supported +server properties. + ** Obsolete packages: *** mailpost.el ------------------------------------------------------------ revno: 108025 committer: Michael Albinus branch nick: trunk timestamp: Tue 2012-04-24 23:47:24 +0200 message: * notifications.el (top): Remove unneeded declarations. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-24 17:56:30 +0000 +++ lisp/ChangeLog 2012-04-24 21:47:24 +0000 @@ -22,8 +22,8 @@ 2012-04-24 Michael Albinus - * notifications.el (notifications-specification-version): Change - to "1.2". + * notifications.el (top): Remove unneeded declarations. + (notifications-specification-version): Change to "1.2". (notifications-interface, notifications-notify-method) (notifications-close-notification-method): Fix docstring. (notifications-get-capabilities-method): New defconst. === modified file 'lisp/notifications.el' --- lisp/notifications.el 2012-04-24 21:44:12 +0000 +++ lisp/notifications.el 2012-04-24 21:47:24 +0000 @@ -37,12 +37,6 @@ (eval-when-compile (require 'cl)) -;; 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. -(declare-function dbus-call-method "dbusbind.c") -(declare-function dbus-register-signal "dbusbind.c") - (require 'dbus) (defconst notifications-specification-version "1.2" ------------------------------------------------------------ revno: 108024 committer: Michael Albinus branch nick: trunk timestamp: Tue 2012-04-24 23:44:12 +0200 message: * notifications.el (notifications-get-capabilities): Fix docstring. diff: === modified file 'lisp/notifications.el' --- lisp/notifications.el 2012-04-24 17:56:30 +0000 +++ lisp/notifications.el 2012-04-24 21:44:12 +0000 @@ -354,21 +354,21 @@ "Return the capabilities of the notification server, a list of strings. The following capabilities can be expected: - `:actions' The server will provide the specified actions - to the user. - `:action-icons' Supports using icons instead of text for - displaying actions. - `:body' Supports body text. - `:body-hyperlinks' The server supports hyperlinks in the notifications. - `:body-images' The server supports images in the notifications. - `:body-markup' Supports markup in the body text. - `:icon-multi' The server will render an animation of all the - frames in a given image array. - `:icon-static' Supports display of exactly 1 frame of any - given image array. This value is mutually exclusive - with `:icon-multi'. - `:persistence' The server supports persistence of notifications. - `:sound' The server supports sounds on notifications. + :actions The server will provide the specified actions + to the user. + :action-icons Supports using icons instead of text for + displaying actions. + :body Supports body text. + :body-hyperlinks The server supports hyperlinks in the notifications. + :body-images The server supports images in the notifications. + :body-markup Supports markup in the body text. + :icon-multi The server will render an animation of all the + frames in a given image array. + :icon-static Supports display of exactly 1 frame of any + given image array. This value is mutually exclusive + with `:icon-multi'. + :persistence The server supports persistence of notifications. + :sound The server supports sounds on notifications. Further vendor-specific caps start with `:x-vendor', like `:x-gnome-foo-cap'." (dbus-ignore-errors ------------------------------------------------------------ revno: 108023 committer: Andreas Schwab branch nick: emacs timestamp: Tue 2012-04-24 21:05:25 +0200 message: * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS. (xgetint): Add missing shift for LSB tags. diff: === modified file 'src/.gdbinit' --- src/.gdbinit 2012-02-21 00:07:53 +0000 +++ src/.gdbinit 2012-04-24 19:05:25 +0000 @@ -54,7 +54,7 @@ define xgetint set $bugfix = $arg0 - set $int = gdb_use_union ? $bugfix.s.val : (gdb_use_lsb ? $bugfix : $bugfix << gdb_gctypebits) >> gdb_gctypebits + set $int = gdb_use_union ? $bugfix.s.val : (gdb_use_lsb ? $bugfix >> (gdb_gctypebits - 1) : $bugfix << gdb_gctypebits) >> gdb_gctypebits end define xgettype @@ -1003,8 +1003,15 @@ define xpr xtype - if $type == Lisp_Int - xint + if gdb_use_union + if $type == Lisp_Int + xint + end + end + if !gdb_use_union + if $type == Lisp_Int0 || $type == Lisp_Int1 + xint + end end if $type == Lisp_Symbol xsymbol === modified file 'src/ChangeLog' --- src/ChangeLog 2012-04-24 08:56:31 +0000 +++ src/ChangeLog 2012-04-24 19:05:25 +0000 @@ -1,3 +1,8 @@ +2012-04-24 Andreas Schwab + + * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS. + (xgetint): Add missing shift for LSB tags. + 2012-04-24 Martin Rudalics * keyboard.c (read_char): Don't wipe echo area for select window ------------------------------------------------------------ revno: 108022 committer: Michael Albinus branch nick: trunk timestamp: Tue 2012-04-24 19:56:30 +0200 message: * notifications.el (notifications-specification-version): Change to "1.2". (notifications-notify): Add :action-items, :resident and :transient hints. Change "image_data" to "image-data" and "image_path" to "image-path". (notifications-get-capabilities): Return a list of keywords. * os.texi (Notifications): Extend possible notification hints. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-04-24 15:19:07 +0000 +++ doc/lispref/ChangeLog 2012-04-24 17:56:30 +0000 @@ -1,6 +1,7 @@ 2012-04-24 Michael Albinus - * os.texi: (Notifications): Add notifications-get-capabilities. + * os.texi (Notifications): Extend possible notification hints. + Add notifications-get-capabilities. 2012-04-20 Chong Yidong === modified file 'doc/lispref/os.texi' --- doc/lispref/os.texi 2012-04-24 15:19:07 +0000 +++ doc/lispref/os.texi 2012-04-24 17:56:30 +0000 @@ -2271,7 +2271,7 @@ @item :body @var{text} The notification body text. Depending on the implementation of the notification server, the text could contain HTML markups, like -@samp{"bold text"}, or hyperlinks. +@samp{"bold text"}, hyperlinks, or images. @item :app-name @var{name} The name of the application sending the notification. The default is @@ -2301,6 +2301,10 @@ @item :urgency @var{urgency} The urgency level. It can be @code{low}, @code{normal}, or @code{critical}. +@item :action-items +When this keyword is given, the @var{title} string of the actions is +interpreted as icon name. + @item :category @var{category} The type of notification this is, a string. @@ -2331,6 +2335,17 @@ Causes the server to suppress playing any sounds, if it has that ability. +@item :resident +When set the server will not automatically remove the notification +when an action has been invoked. The notification will remain resident +in the server until it is explicitly removed by the user or by the +sender. This hint is likely only useful when the server has the +@code{:persistence} capability. + +@item :transient +When set the server will treat the notification as transient and +by-pass the server's persistence capability, if it should exist. + @item :x @var{position} @itemx :y @var{position} Specifies the X, Y location on the screen that the @@ -2402,35 +2417,39 @@ Returns the capabilities of the notification server, a list of strings. The following capabilities can be expected: -@table @asis -@item "actions" +@table @code +@item :actions The server will provide the specified actions to the user. -@item "body" +@item :body Supports body text. -@item "body-hyperlinks" +@item :body-hyperlinks The server supports hyperlinks in the notifications. -@item "body-images" +@item :body-images The server supports images in the notifications. -@item "body-markup" +@item :body-markup Supports markup in the body text. -@item "icon-multi" +@item :icon-multi The server will render an animation of all the frames in a given image array. -@item "icon-static" +@item :icon-static Supports display of exactly 1 frame of any given image array. This -value is mutually exclusive with "icon-multi". - -@item "sound" +value is mutually exclusive with @code{:icon-multi}. + +@item :persistence +The server supports persistence of notifications. + +@item :sound The server supports sounds on notifications. @end table -Further vendor-specific caps start with "x-vendor", like "x-gnome-foo-cap". +Further vendor-specific caps start with @code{:x-vendor}, like +@code{:x-gnome-foo-cap}. @end defun === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-24 17:08:55 +0000 +++ lisp/ChangeLog 2012-04-24 17:56:30 +0000 @@ -22,10 +22,14 @@ 2012-04-24 Michael Albinus - * notifications.el (notifications-interface) - (notifications-notify-method, notifications-notify) + * notifications.el (notifications-specification-version): Change + to "1.2". + (notifications-interface, notifications-notify-method) (notifications-close-notification-method): Fix docstring. (notifications-get-capabilities-method): New defconst. + (notifications-notify): Add :action-items, :resident and + :transient hints. Change "image_data" to "image-data" and + "image_path" to "image-path". (notifications-get-capabilities): New defun. 2012-04-24 Leo Liu === modified file 'lisp/notifications.el' --- lisp/notifications.el 2012-04-24 15:19:07 +0000 +++ lisp/notifications.el 2012-04-24 17:56:30 +0000 @@ -23,7 +23,7 @@ ;;; Commentary: ;; This package provides an implementation of the Desktop Notifications -;; . +;; . ;; In order to activate this package, you must add the following code ;; into your .emacs: @@ -45,7 +45,7 @@ (require 'dbus) -(defconst notifications-specification-version "1.1" +(defconst notifications-specification-version "1.2" "The version of the Desktop Notifications Specification implemented.") (defconst notifications-application-name "Emacs" @@ -157,6 +157,8 @@ Default value is -1. :urgency The urgency level. Either `low', `normal' or `critical'. + :action-items Whether the TITLE of the actions is interpreted as + a named icon. :category The type of notification this is. :desktop-entry This specifies the name of the desktop filename representing the calling program. @@ -173,6 +175,11 @@ be \"message-new-instant\". :suppress-sound Causes the server to suppress playing any sounds, if it has that ability. + :resident When set the server will not automatically remove the + notification when an action has been invoked. + :transient When set the server will treat the notification as transient + and by-pass the server's persistence capability, if it + should exist. :x Specifies the X location on the screen that the notification should point to. The \"y\" hint must also be specified. :y Specifies the Y location on the screen that the notification @@ -212,9 +219,12 @@ (desktop-entry (plist-get params :desktop-entry)) (image-data (plist-get params :image-data)) (image-path (plist-get params :image-path)) + (action-items (plist-get params :action-items)) (sound-file (plist-get params :sound-file)) (sound-name (plist-get params :sound-name)) (suppress-sound (plist-get params :suppress-sound)) + (resident (plist-get params :resident)) + (transient (plist-get params :transient)) (x (plist-get params :x)) (y (plist-get params :y)) id) @@ -236,12 +246,16 @@ (:variant :string ,desktop-entry)) t)) (when image-data (add-to-list 'hints `(:dict-entry - "image_data" + "image-data" (:variant :struct ,image-data)) t)) (when image-path (add-to-list 'hints `(:dict-entry - "image_path" + "image-path" (:variant :string ,image-path)) t)) + (when action-items + (add-to-list 'hints `(:dict-entry + "action-items" + (:variant :boolean ,action-items)) t)) (when sound-file (add-to-list 'hints `(:dict-entry "sound-file" @@ -254,6 +268,14 @@ (add-to-list 'hints `(:dict-entry "suppress-sound" (:variant :boolean ,suppress-sound)) t)) + (when resident + (add-to-list 'hints `(:dict-entry + "resident" + (:variant :boolean ,resident)) t)) + (when transient + (add-to-list 'hints `(:dict-entry + "transient" + (:variant :boolean ,transient)) t)) (when x (add-to-list 'hints `(:dict-entry "x" (:variant :int32 ,x)) t)) (when y @@ -332,24 +354,30 @@ "Return the capabilities of the notification server, a list of strings. The following capabilities can be expected: - \"actions\" The server will provide the specified actions - to the user. - \"body\" Supports body text. - \"body-hyperlinks\" The server supports hyperlinks in the notifications. - \"body-images\" The server supports images in the notifications. - \"body-markup\" Supports markup in the body text. - \"icon-multi\" The server will render an animation of all the - frames in a given image array. - \"icon-static\" Supports display of exactly 1 frame of any - given image array. This value is mutually exclusive - with \"icon-multi\". - \"sound\" The server supports sounds on notifications. + `:actions' The server will provide the specified actions + to the user. + `:action-icons' Supports using icons instead of text for + displaying actions. + `:body' Supports body text. + `:body-hyperlinks' The server supports hyperlinks in the notifications. + `:body-images' The server supports images in the notifications. + `:body-markup' Supports markup in the body text. + `:icon-multi' The server will render an animation of all the + frames in a given image array. + `:icon-static' Supports display of exactly 1 frame of any + given image array. This value is mutually exclusive + with `:icon-multi'. + `:persistence' The server supports persistence of notifications. + `:sound' The server supports sounds on notifications. -Further vendor-specific caps start with \"x-vendor\", like \"x-gnome-foo-cap\"." - (dbus-call-method :session - notifications-service - notifications-path - notifications-interface - notifications-get-capabilities-method)) +Further vendor-specific caps start with `:x-vendor', like `:x-gnome-foo-cap'." + (dbus-ignore-errors + (mapcar + (lambda (x) (intern (concat ":" x))) + (dbus-call-method :session + notifications-service + notifications-path + notifications-interface + notifications-get-capabilities-method)))) (provide 'notifications) ------------------------------------------------------------ revno: 108021 [merge] fixes bug(s): http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6286 committer: Stefan Monnier branch nick: trunk timestamp: Tue 2012-04-24 13:08:55 -0400 message: * ruby-mode.el: Handle general delimited literals. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-24 15:19:07 +0000 +++ lisp/ChangeLog 2012-04-24 17:08:55 +0000 @@ -1,3 +1,25 @@ +2012-04-24 Stefan Monnier + + * progmodes/ruby-mode.el: Simplify last change, and cleanup code. + (ruby-syntax-propertize-regexp): Remove. + (ruby-syntax-propertize-function): Split regexp into chunks. + Match following code directly. + +2012-04-24 Dmitry Gutov + + * progmodes/ruby-mode.el: Handle Cucumber defs (bug#6286). + (ruby-syntax-propertize-regexp): New function. + (ruby-syntax-propertize-function): Use it to handle regexp not preceded + by a special keyword. + + * progmodes/ruby-mode.el: Handle general delimited literals (bug#6286). + (ruby-syntax-general-delimiters-goto-beg) + (ruby-syntax-propertize-general-delimiters): New functions. + (ruby-syntax-propertize-function): Use them to handle GDL. + (ruby-font-lock-keywords): Move old handling of GDL... + (ruby-font-lock-syntactic-keywords): .. to here. + (ruby-calculate-indent): Adjust indentation for GDL. + 2012-04-24 Michael Albinus * notifications.el (notifications-interface) === modified file 'lisp/progmodes/ruby-mode.el' --- lisp/progmodes/ruby-mode.el 2012-03-21 18:33:07 +0000 +++ lisp/progmodes/ruby-mode.el 2012-04-24 17:02:46 +0000 @@ -784,7 +784,7 @@ (not (looking-at "[a-z_]")))) (and (looking-at ruby-operator-re) (not (ruby-special-char-p)) - ;; operator at the end of line + ;; Operator at the end of line. (let ((c (char-after (point)))) (and ;; (or (null begin) @@ -794,8 +794,9 @@ ;; (not (or (eolp) (looking-at "#") ;; (and (eq (car (nth 1 state)) ?{) ;; (looking-at "|")))))) - (or (not (eq ?/ c)) - (null (nth 0 (ruby-parse-region (or begin parse-start) (point))))) + ;; Not a regexp or general delimited literal. + (null (nth 0 (ruby-parse-region (or begin parse-start) + (point)))) (or (not (eq ?| (char-after (point)))) (save-excursion (or (eolp) (forward-char -1)) @@ -1110,6 +1111,8 @@ mlist))))) (declare-function ruby-syntax-propertize-heredoc "ruby-mode" (limit)) +(declare-function ruby-syntax-general-delimiters-goto-beg "ruby-mode" ()) +(declare-function ruby-syntax-propertize-general-delimiters "ruby-mode" (limit)) (if (eval-when-compile (fboundp #'syntax-propertize-rules)) ;; New code that works independently from font-lock. @@ -1118,26 +1121,48 @@ "Syntactic keywords for Ruby mode. See `syntax-propertize-function'." (goto-char start) (ruby-syntax-propertize-heredoc end) + (ruby-syntax-general-delimiters-goto-beg) (funcall (syntax-propertize-rules - ;; #{ }, #$hoge, #@foo are not comments + ;; #{ }, #$hoge, #@foo are not comments. ("\\(#\\)[{$@]" (1 ".")) - ;; $' $" $` .... are variables - ;; ?' ?" ?` are ascii codes + ;; $' $" $` .... are variables. + ;; ?' ?" ?` are ascii codes. ("\\([?$]\\)[#\"'`]" (1 (unless (save-excursion ;; Not within a string. (nth 3 (syntax-ppss (match-beginning 0)))) (string-to-syntax "\\")))) - ;; regexps - ("\\(^\\|[[=(,~?:;<>]\\|\\(^\\|\\s \\)\\(if\\|elsif\\|unless\\|while\\|until\\|when\\|and\\|or\\|&&\\|||\\)\\|g?sub!?\\|scan\\|split!?\\)\\s *\\(/\\)[^/\n\\\\]*\\(\\\\.[^/\n\\\\]*\\)*\\(/\\)" - (4 "\"/") - (6 "\"/")) + ;; Regexps: regexps are distinguished from division either because + ;; of the keyword/symbol before them, or because of the code + ;; following them. + ((concat + ;; Special tokens that can't be followed by a division operator. + "\\(?:\\(^\\|[[=(,~?:;<>]\\|\\(?:^\\|\\s \\)" + (regexp-opt '("if" "elsif" "unless" "while" "until" "when" "and" + "or" "&&" "||" + "gsub" "gsub!" "sub" "sub!" "scan" "split" "split!")) + "\\)\\s *\\)?" + ;; The regular expression itself. + "\\(/\\)[^/\n\\\\]*\\(?:\\\\.[^/\n\\\\]*\\)*\\(/\\)" + ;; Special code that cannot follow a division operator. + ;; FIXME: Just because the second slash of "/foo/ do bar" can't + ;; be a division, doesn't mean it can't *start* a regexp, as in + ;; "x = toto/foo; if /do bar/". + "\\([imxo]*\\s *\\(?:,\\|\\_\\)\\)?") + (2 (when (or (match-beginning 1) (match-beginning 4)) + (string-to-syntax "\"/"))) + (3 (if (or (match-beginning 1) (match-beginning 4)) + (string-to-syntax "\"/") + (goto-char (match-end 2))))) ("^=en\\(d\\)\\_>" (1 "!")) ("^\\(=\\)begin\\_>" (1 "!")) ;; Handle here documents. ((concat ruby-here-doc-beg-re ".*\\(\n\\)") - (7 (prog1 "\"" (ruby-syntax-propertize-heredoc end))))) + (7 (prog1 "\"" (ruby-syntax-propertize-heredoc end)))) + ;; Handle percent literals: %w(), %q{}, etc. + ("\\(?:^\\|[[ \t\n<+(,=]\\)\\(%\\)[qQrswWx]?\\([[:punct:]]\\)" + (1 (prog1 "|" (ruby-syntax-propertize-general-delimiters end))))) (point) end)) (defun ruby-syntax-propertize-heredoc (limit) @@ -1163,6 +1188,41 @@ ;; Make extra sure we don't move back, lest we could fall into an ;; inf-loop. (if (< (point) start) (goto-char start)))))) + + (defun ruby-syntax-general-delimiters-goto-beg () + (let ((state (syntax-ppss))) + ;; Move to the start of the literal, in case it's multiline. + ;; TODO: determine the literal type more reliably here? + (when (eq t (nth 3 state)) + (goto-char (nth 8 state)) + (beginning-of-line)))) + + (defun ruby-syntax-propertize-general-delimiters (limit) + (goto-char (match-beginning 2)) + (let* ((op (char-after)) + (ops (char-to-string op)) + (cl (or (cdr (aref (syntax-table) op)) + (cdr (assoc op '((?< . ?>)))))) + parse-sexp-lookup-properties) + (ignore-errors + (if cl + (progn ; Paired delimiters. + ;; Delimiter pairs of the same kind can be nested + ;; inside the literal, as long as they are balanced. + ;; Create syntax table that ignores other characters. + (with-syntax-table (make-char-table 'syntax-table nil) + (modify-syntax-entry op (concat "(" (char-to-string cl))) + (modify-syntax-entry cl (concat ")" ops)) + (modify-syntax-entry ?\\ "\\") + (save-restriction + (narrow-to-region (point) limit) + (forward-list)))) ; skip to the paired character + ;; Single character delimiter. + (re-search-forward (concat "[^\\]\\(?:\\\\\\\\\\)*" + (regexp-quote ops)) limit nil)) + ;; If we reached here, the closing delimiter was found. + (put-text-property (1- (point)) (point) + 'syntax-table (string-to-syntax "|"))))) ) ;; For Emacsen where syntax-propertize-rules is not (yet) available, @@ -1207,6 +1267,10 @@ (4 (7 . ?/)) (6 (7 . ?/))) ("^=en\\(d\\)\\_>" 1 "!") + ;; General delimited string. + ("\\(^\\|[[ \t\n<+(,=]\\)\\(%[xrqQwW]?\\([^<[{(a-zA-Z0-9 \n]\\)[^\n\\\\]*\\(\\\\.[^\n\\\\]*\\)*\\(\\3\\)\\)" + (3 "\"") + (5 "\"")) ("^\\(=\\)begin\\_>" 1 (ruby-comment-beg-syntax)) ;; Currently, the following case is highlighted incorrectly: ;; @@ -1415,9 +1479,6 @@ 1 font-lock-variable-name-face) '("\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+" 0 font-lock-variable-name-face) - ;; general delimited string - '("\\(^\\|[[ \t\n<+(,=]\\)\\(%[xrqQwW]?\\([^<[{(a-zA-Z0-9 \n]\\)[^\n\\\\]*\\(\\\\.[^\n\\\\]*\\)*\\(\\3\\)\\)" - (2 font-lock-string-face)) ;; constants '("\\(^\\|[^_]\\)\\b\\([A-Z]+\\(\\w\\|_\\)*\\)" 2 font-lock-type-face) === modified file 'test/ChangeLog' --- test/ChangeLog 2012-04-11 03:24:26 +0000 +++ test/ChangeLog 2012-04-24 17:06:12 +0000 @@ -1,3 +1,7 @@ +2012-04-24 Stefan Monnier + + * indent/ruby.rb: New file, to test new syntax-propertize code. + 2012-04-11 Glenn Morris * automated/vc-bzr.el (vc-bzr-test-faulty-bzr-autoloads): New test. === added file 'test/indent/ruby.rb' --- test/indent/ruby.rb 1970-01-01 00:00:00 +0000 +++ test/indent/ruby.rb 2012-04-24 17:02:46 +0000 @@ -0,0 +1,19 @@ +# Don't mis-match "sub" at the end of words. +a = asub / aslb + bsub / bslb; + +b = %Q{This is a "string"} +c = %w(foo + bar + baz) +d = %!hello! + +# A "do" after a slash means that slash is not a division, but it doesn't imply +# it's a regexp-ender, since it can be a regexp-starter instead! +x = toto / foo; if /do bar/ then + toto = 1 + end + +# Some Cucumber code: +Given /toto/ do + print "hello" +end ------------------------------------------------------------ revno: 108020 committer: Michael Albinus branch nick: trunk timestamp: Tue 2012-04-24 17:19:07 +0200 message: * notifications.el (notifications-interface) (notifications-notify-method, notifications-notify) (notifications-close-notification-method): Fix docstring. (notifications-get-capabilities-method): New defconst. (notifications-get-capabilities): New defun. * os.texi: (Notifications): Add notifications-get-capabilities. diff: === modified file 'doc/lispref/ChangeLog' --- doc/lispref/ChangeLog 2012-04-20 16:27:52 +0000 +++ doc/lispref/ChangeLog 2012-04-24 15:19:07 +0000 @@ -1,3 +1,7 @@ +2012-04-24 Michael Albinus + + * os.texi: (Notifications): Add notifications-get-capabilities. + 2012-04-20 Chong Yidong * processes.texi (Asynchronous Processes): Mention nil argument to === modified file 'doc/lispref/os.texi' --- doc/lispref/os.texi 2012-04-14 01:59:01 +0000 +++ doc/lispref/os.texi 2012-04-24 15:19:07 +0000 @@ -2355,6 +2355,9 @@ @end itemize @end table +Which parameters are accepted by the notification server can be +checked via @code{notifications-get-capabilities}. + This function returns a notification id, an integer, which can be used to manipulate the notification item with @code{notifications-close-notification} or the @code{:replaces-id} @@ -2395,6 +2398,42 @@ This function closes a notification with identifier @var{id}. @end defun +@defun notifications-get-capabilities +Returns the capabilities of the notification server, a list of strings. +The following capabilities can be expected: + +@table @asis +@item "actions" +The server will provide the specified actions to the user. + +@item "body" +Supports body text. + +@item "body-hyperlinks" +The server supports hyperlinks in the notifications. + +@item "body-images" +The server supports images in the notifications. + +@item "body-markup" +Supports markup in the body text. + +@item "icon-multi" +The server will render an animation of all the frames in a given image +array. + +@item "icon-static" +Supports display of exactly 1 frame of any given image array. This +value is mutually exclusive with "icon-multi". + +@item "sound" +The server supports sounds on notifications. +@end table + +Further vendor-specific caps start with "x-vendor", like "x-gnome-foo-cap". +@end defun + + @node Dynamic Libraries @section Dynamically Loaded Libraries @cindex dynamic libraries === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-24 14:58:29 +0000 +++ lisp/ChangeLog 2012-04-24 15:19:07 +0000 @@ -1,3 +1,11 @@ +2012-04-24 Michael Albinus + + * notifications.el (notifications-interface) + (notifications-notify-method, notifications-notify) + (notifications-close-notification-method): Fix docstring. + (notifications-get-capabilities-method): New defconst. + (notifications-get-capabilities): New defun. + 2012-04-24 Leo Liu * progmodes/python.el: Move hideshow setup to the end. === modified file 'lisp/notifications.el' --- lisp/notifications.el 2012-04-03 07:20:32 +0000 +++ lisp/notifications.el 2012-04-24 15:19:07 +0000 @@ -64,13 +64,16 @@ "D-Bus notifications service path.") (defconst notifications-interface "org.freedesktop.Notifications" - "D-Bus notifications service path.") + "D-Bus notifications service interface.") (defconst notifications-notify-method "Notify" - "D-Bus notifications service path.") + "D-Bus notifications notify method.") (defconst notifications-close-notification-method "CloseNotification" - "D-Bus notifications service path.") + "D-Bus notifications close notification method.") + +(defconst notifications-get-capabilities-method "GetCapabilities" + "D-Bus notifications get capabilities method.") (defconst notifications-action-signal "ActionInvoked" "D-Bus notifications action signal.") @@ -188,6 +191,9 @@ - `undefined' if the notification server hasn't provided a reason +Which parameters are accepted by the notification server can be +checked via `notifications-get-capabilities'. + This function returns a notification id, an integer, which can be used to manipulate the notification item with `notifications-close-notification' or the `:replaces-id' argument @@ -322,4 +328,28 @@ notifications-close-notification-method :int32 id)) +(defun notifications-get-capabilities () + "Return the capabilities of the notification server, a list of strings. +The following capabilities can be expected: + + \"actions\" The server will provide the specified actions + to the user. + \"body\" Supports body text. + \"body-hyperlinks\" The server supports hyperlinks in the notifications. + \"body-images\" The server supports images in the notifications. + \"body-markup\" Supports markup in the body text. + \"icon-multi\" The server will render an animation of all the + frames in a given image array. + \"icon-static\" Supports display of exactly 1 frame of any + given image array. This value is mutually exclusive + with \"icon-multi\". + \"sound\" The server supports sounds on notifications. + +Further vendor-specific caps start with \"x-vendor\", like \"x-gnome-foo-cap\"." + (dbus-call-method :session + notifications-service + notifications-path + notifications-interface + notifications-get-capabilities-method)) + (provide 'notifications) ------------------------------------------------------------ revno: 108019 committer: Leo Liu branch nick: trunk timestamp: Tue 2012-04-24 22:58:29 +0800 message: * lisp/progmodes/python.el: Move hideshow setup to the end. diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-24 08:56:31 +0000 +++ lisp/ChangeLog 2012-04-24 14:58:29 +0000 @@ -1,3 +1,7 @@ +2012-04-24 Leo Liu + + * progmodes/python.el: Move hideshow setup to the end. + 2012-04-24 Martin Rudalics * window.el (handle-select-window): Clear echo area since this is === modified file 'lisp/progmodes/python.el' --- lisp/progmodes/python.el 2012-04-19 16:50:07 +0000 +++ lisp/progmodes/python.el 2012-04-24 14:58:29 +0000 @@ -2468,15 +2468,6 @@ nil t) (add-hook 'completion-at-point-functions 'python-completion-at-point nil 'local) - ;; Fixme: should be in hideshow. This seems to be of limited use - ;; since it isn't (can't be) indentation-based. Also hide-level - ;; doesn't seem to work properly. - (add-to-list 'hs-special-modes-alist - `(python-mode "^\\s-*\\(?:def\\|class\\)\\>" nil "#" - ,(lambda (_arg) - (python-end-of-defun) - (skip-chars-backward " \t\n")) - nil)) (set (make-local-variable 'skeleton-further-elements) '((< '(backward-delete-char-untabify (min python-indent (current-column)))) @@ -2717,6 +2708,17 @@ ;; continue standard unloading nil) +;;;; Finish up +;; Fixme: should be in hideshow. This seems to be of limited use +;; since it isn't (can't be) indentation-based. Also hide-level +;; doesn't seem to work properly. +(add-to-list 'hs-special-modes-alist + `(python-mode "^\\s-*\\(?:def\\|class\\)\\>" nil "#" + ,(lambda (_arg) + (python-end-of-defun) + (skip-chars-backward " \t\n")) + nil)) + (provide 'python) (provide 'python-21) ------------------------------------------------------------ revno: 108018 committer: martin rudalics branch nick: trunk timestamp: Tue 2012-04-24 10:56:31 +0200 message: Don't clear echo area prematurely when handling select window events (Bug#11304). * keyboard.c (read_char): Don't wipe echo area for select window events: These might get delayed via `mouse-autoselect-window' (Bug#11304). * window.el (handle-select-window): Clear echo area since this is no more done by read_char (Bug#11304). diff: === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-24 03:40:57 +0000 +++ lisp/ChangeLog 2012-04-24 08:56:31 +0000 @@ -1,3 +1,8 @@ +2012-04-24 Martin Rudalics + + * window.el (handle-select-window): Clear echo area since this is + no more done by read_char (Bug#11304). + 2012-04-24 Stefan Monnier * ibuffer.el (ibuffer-mode-map): Bind `/ m' to filter-used-mode === modified file 'lisp/window.el' --- lisp/window.el 2012-04-20 08:48:50 +0000 +++ lisp/window.el 2012-04-24 08:56:31 +0000 @@ -5727,6 +5727,8 @@ (setq mouse-autoselect-window-state nil) ;; Run `mouse-leave-buffer-hook' when autoselecting window. (run-hooks 'mouse-leave-buffer-hook)) + ;; Clear echo area. + (message nil) (select-window window)))) (defun truncated-partial-width-window-p (&optional window) === modified file 'src/ChangeLog' --- src/ChangeLog 2012-04-24 08:35:02 +0000 +++ src/ChangeLog 2012-04-24 08:56:31 +0000 @@ -1,3 +1,9 @@ +2012-04-24 Martin Rudalics + + * keyboard.c (read_char): Don't wipe echo area for select window + events: These might get delayed via `mouse-autoselect-window' + (Bug#11304). + 2012-04-24 Juanma Barranquero * gnutls.c (init_gnutls_functions): Protect against (unlikely) === modified file 'src/keyboard.c' --- src/keyboard.c 2012-04-23 05:44:49 +0000 +++ src/keyboard.c 2012-04-24 08:56:31 +0000 @@ -2984,7 +2984,10 @@ own stuff with the echo area. */ if (!CONSP (c) || (!(EQ (Qhelp_echo, XCAR (c))) - && !(EQ (Qswitch_frame, XCAR (c))))) + && !(EQ (Qswitch_frame, XCAR (c))) + /* Don't wipe echo area for select window events: These might + get delayed via `mouse-autoselect-window' (Bug#11304). */ + && !(EQ (Qselect_window, XCAR (c))))) { if (!NILP (echo_area_buffer[0])) safe_run_hooks (Qecho_area_clear_hook); ------------------------------------------------------------ revno: 108017 committer: Juanma Barranquero branch nick: trunk timestamp: Tue 2012-04-24 10:35:02 +0200 message: src/gnutls.c: Fix previous change. (init_gnutls_functions): Protect against (unlikely) manipulation of :loaded-from data. diff: === modified file 'src/ChangeLog' --- src/ChangeLog 2012-04-23 23:15:08 +0000 +++ src/ChangeLog 2012-04-24 08:35:02 +0000 @@ -1,3 +1,8 @@ +2012-04-24 Juanma Barranquero + + * gnutls.c (init_gnutls_functions): Protect against (unlikely) + manipulation of :loaded-from data. + 2012-04-23 Juanma Barranquero * gnutls.c (init_gnutls_functions): The value of :loaded-from is === modified file 'src/gnutls.c' --- src/gnutls.c 2012-04-23 23:15:08 +0000 +++ src/gnutls.c 2012-04-24 08:35:02 +0000 @@ -200,8 +200,12 @@ max_log_level = global_gnutls_log_level; - GNUTLS_LOG2 (1, max_log_level, "GnuTLS library loaded:", - SDATA (XCAR (Fget (Qgnutls_dll, QCloaded_from)))); + { + Lisp_Object name = CAR_SAFE (Fget (Qgnutls_dll, QCloaded_from)); + GNUTLS_LOG2 (1, max_log_level, "GnuTLS library loaded:", + STRINGP (name) ? (const char *) SDATA (name) : "unknown"); + } + return 1; } ------------------------------------------------------------ revno: 108016 committer: Michael Albinus branch nick: trunk timestamp: Tue 2012-04-24 09:09:27 +0200 message: Obsoleted argument list of `dbus-register-signal'. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-04-24 03:40:57 +0000 +++ etc/NEWS 2012-04-24 07:09:27 +0000 @@ -157,6 +157,11 @@ ** `face-spec-set' no longer sets frame-specific attributes when the third argument is a frame (that usage was obsolete since Emacs 22.2). ++++ +** The arguments of `dbus-register-signal' are no longer just strings, +but keywords or keyword-string pairs. The old argument list will +still be supported for Emacs 24.x. + * Lisp changes in Emacs 24.2 ------------------------------------------------------------ revno: 108015 committer: Stefan Monnier branch nick: trunk timestamp: Mon 2012-04-23 23:40:57 -0400 message: * lisp/ibuffer.el (ibuffer-mode-map): Bind `/ m' to filter-used-mode and `/ M' to filter-derived-mode. * lisp/ibuf-ext.el (ibuffer-list-buffer-modes): Simplify; avoid add-to-list. (ibuffer-filter-by-mode, ibuffer-filter-by-used-mode) (ibuffer-mark-by-mode): Use default rather than initial-input. (ibuffer-filter-by-derived-mode): Autoload and require-match. diff: === modified file 'etc/NEWS' --- etc/NEWS 2012-04-24 02:07:40 +0000 +++ etc/NEWS 2012-04-24 03:40:57 +0000 @@ -74,7 +74,8 @@ * Changes in Specialized Modes and Packages in Emacs 24.2 -** New `derived-mode' filter for Ibuffer, bound to `/ w'. +** New `derived-mode' filter for Ibuffer, bound to `/ M'. +`/ m' is now bound to filter by used-mode, which used to be bound to `/ M'. ** Apropos === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2012-04-24 02:07:40 +0000 +++ lisp/ChangeLog 2012-04-24 03:40:57 +0000 @@ -1,3 +1,12 @@ +2012-04-24 Stefan Monnier + + * ibuffer.el (ibuffer-mode-map): Bind `/ m' to filter-used-mode + and `/ M' to filter-derived-mode. + * ibuf-ext.el (ibuffer-list-buffer-modes): Simplify; avoid add-to-list. + (ibuffer-filter-by-mode, ibuffer-filter-by-used-mode) + (ibuffer-mark-by-mode): Use default rather than initial-input. + (ibuffer-filter-by-derived-mode): Autoload and require-match. + 2012-04-24 Ivan Andrus (tiny change) * ibuf-ext.el (ibuffer-list-buffer-modes): Add `include-parents' arg. === modified file 'lisp/ibuf-ext.el' --- lisp/ibuf-ext.el 2012-04-24 02:07:40 +0000 +++ lisp/ibuf-ext.el 2012-04-24 03:40:57 +0000 @@ -974,23 +974,16 @@ (defun ibuffer-list-buffer-modes (&optional include-parents) - "Create an alist of buffer modes currently in use. -If INCLUDE-PARENTS is non-nil then include parent modes. -The list returned will be of the form (\"MODE-NAME\" . MODE-SYMBOL)." - (let ((bufs (buffer-list)) - (modes) - (this-mode)) - (while bufs - (setq this-mode (buffer-local-value 'major-mode (car bufs)) - bufs (cdr bufs)) - (while this-mode - (add-to-list - 'modes - `(,(symbol-name this-mode) . - ,this-mode)) - (setq this-mode (and include-parents - (get this-mode 'derived-mode-parent))))) - modes)) + "Create a completion table of buffer modes currently in use. +If INCLUDE-PARENTS is non-nil then include parent modes." + (let ((modes)) + (dolist (buf (buffer-list)) + (let ((this-mode (buffer-local-value 'major-mode buf))) + (while (and this-mode (not (memq this-mode modes))) + (push this-mode modes) + (setq this-mode (and include-parents + (get this-mode 'derived-mode-parent)))))) + (mapcar #'symbol-name modes))) ;;; Extra operation definitions @@ -1000,16 +993,19 @@ "Toggle current view to buffers with major mode QUALIFIER." (:description "major mode" :reader - (intern - (completing-read "Filter by major mode: " obarray - #'(lambda (e) - (string-match "-mode$" - (symbol-name e))) - t - (let ((buf (ibuffer-current-buffer))) - (if (and buf (buffer-live-p buf)) - (symbol-name (buffer-local-value 'major-mode buf)) - ""))))) + (let* ((buf (ibuffer-current-buffer)) + (default (if (and buf (buffer-live-p buf)) + (symbol-name (buffer-local-value + 'major-mode buf))))) + (intern + (completing-read + (if default + (format "Filter by major mode (default %s): " default) + "Filter by major mode: ") + obarray + #'(lambda (e) + (string-match "-mode\\'" (symbol-name e))) + t nil nil default)))) (eq qualifier (buffer-local-value 'major-mode buf))) ;;;###autoload (autoload 'ibuffer-filter-by-used-mode "ibuf-ext") @@ -1018,19 +1014,20 @@ Called interactively, this function allows selection of modes currently used by buffers." (:description "major mode in use" - :reader - (intern - (completing-read "Filter by major mode: " - (ibuffer-list-buffer-modes) - nil - t - (let ((buf (ibuffer-current-buffer))) - (if (and buf (buffer-live-p buf)) - (symbol-name (buffer-local-value - 'major-mode buf)) - ""))))) + :reader + (let* ((buf (ibuffer-current-buffer)) + (default (if (and buf (buffer-live-p buf)) + (symbol-name (buffer-local-value + 'major-mode buf))))) + (intern + (completing-read + (if default + (format "Filter by major mode (default %s): " default) + "Filter by major mode: ") + (ibuffer-list-buffer-modes) nil t nil nil default)))) (eq qualifier (buffer-local-value 'major-mode buf))) +;;;###autoload (autoload 'ibuffer-filter-by-derived-mode "ibuf-ext") (define-ibuffer-filter derived-mode "Toggle current view to buffers whose major mode inherits from QUALIFIER." (:description "derived mode" @@ -1038,7 +1035,7 @@ (intern (completing-read "Filter by derived mode: " (ibuffer-list-buffer-modes t) - nil nil ""))) + nil t))) (with-current-buffer buf (derived-mode-p qualifier))) ;;;###autoload (autoload 'ibuffer-filter-by-name "ibuf-ext") @@ -1480,19 +1477,16 @@ (defun ibuffer-mark-by-mode (mode) "Mark all buffers whose major mode equals MODE." (interactive - (list (intern (completing-read "Mark by major mode: " obarray - #'(lambda (e) - ;; kind of a hack... - (and (fboundp e) - (string-match "-mode$" - (symbol-name e)))) - t - (let ((buf (ibuffer-current-buffer))) - (if (and buf (buffer-live-p buf)) - (with-current-buffer buf - (cons (symbol-name major-mode) - 0)) - "")))))) + (let* ((buf (ibuffer-current-buffer)) + (default (if (and buf (buffer-live-p buf)) + (symbol-name (buffer-local-value + 'major-mode buf))))) + (list (intern + (completing-read + (if default + (format "Mark by major mode (default %s): " default) + "Mark by major mode: ") + (ibuffer-list-buffer-modes) nil t nil nil default))))) (ibuffer-mark-on-buffer #'(lambda (buf) (eq (buffer-local-value 'major-mode buf) mode)))) === modified file 'lisp/ibuffer.el' --- lisp/ibuffer.el 2012-04-24 02:07:40 +0000 +++ lisp/ibuffer.el 2012-04-24 03:40:57 +0000 @@ -501,9 +501,8 @@ (define-key map (kbd "s f") 'ibuffer-do-sort-by-filename/process) (define-key map (kbd "s m") 'ibuffer-do-sort-by-major-mode) - (define-key map (kbd "/ m") 'ibuffer-filter-by-mode) - (define-key map (kbd "/ M") 'ibuffer-filter-by-used-mode) - (define-key map (kbd "/ w") 'ibuffer-filter-by-derived-mode) + (define-key map (kbd "/ m") 'ibuffer-filter-by-used-mode) + (define-key map (kbd "/ M") 'ibuffer-filter-by-derived-mode) (define-key map (kbd "/ n") 'ibuffer-filter-by-name) (define-key map (kbd "/ c") 'ibuffer-filter-by-content) (define-key map (kbd "/ e") 'ibuffer-filter-by-predicate) @@ -2646,7 +2645,7 @@ ;;;;;; ibuffer-backward-filter-group ibuffer-forward-filter-group ;;;;;; ibuffer-toggle-filter-group ibuffer-mouse-toggle-filter-group ;;;;;; ibuffer-interactive-filter-by-mode ibuffer-mouse-filter-by-mode -;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "b2b8f11ad22546ad05d6db0b7d388ac1") +;;;;;; ibuffer-auto-mode) "ibuf-ext" "ibuf-ext.el" "98491557b04909791f687f2eecc88320") ;;; Generated autoloads from ibuf-ext.el (autoload 'ibuffer-auto-mode "ibuf-ext" "\ @@ -2836,6 +2835,7 @@ \(fn NAME)" t nil) (autoload 'ibuffer-filter-by-mode "ibuf-ext") (autoload 'ibuffer-filter-by-used-mode "ibuf-ext") + (autoload 'ibuffer-filter-by-derived-mode "ibuf-ext") (autoload 'ibuffer-filter-by-name "ibuf-ext") (autoload 'ibuffer-filter-by-filename "ibuf-ext") (autoload 'ibuffer-filter-by-size-gt "ibuf-ext") ------------------------------------------------------------ Use --include-merges or -n0 to see merged revisions.