diff options
| author | Paul Eggert | 2011-09-25 14:06:35 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-09-25 14:06:35 -0700 |
| commit | 60b5d3ca2bf381f450da02e3936f7b43b7ca2dab (patch) | |
| tree | c6c6a4a25dcb51c932217f0081690539ee43a175 /lisp | |
| parent | 1a2f43d0db92546dab765bc947f70bc7d2e4fee0 (diff) | |
| parent | b2bf61aa89138859313b14cde43face3e5dfc44a (diff) | |
| download | emacs-60b5d3ca2bf381f450da02e3936f7b43b7ca2dab.tar.gz emacs-60b5d3ca2bf381f450da02e3936f7b43b7ca2dab.zip | |
Merge from trunk.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 11 | ||||
| -rw-r--r-- | lisp/net/dbus.el | 22 | ||||
| -rw-r--r-- | lisp/progmodes/cfengine.el | 33 |
3 files changed, 48 insertions, 18 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 662dd7a7f99..92324036dc5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | 2011-09-25 Michael Albinus <michael.albinus@gmx.de> | ||
| 2 | |||
| 3 | * net/dbus.el (dbus-unregister-object): Don't release services for | ||
| 4 | registered signals. (Bug#9581) | ||
| 5 | |||
| 6 | 2011-09-25 Teodor Zlatanov <tzz@lifelogs.com> | ||
| 7 | |||
| 8 | * progmodes/cfengine.el (cfengine-auto-mode): Add convenience | ||
| 9 | function that picks between cfengine 2 and 3 support | ||
| 10 | automatically. Update docs accordingly. | ||
| 11 | |||
| 1 | 2011-09-22 Ken Manheimer <ken.manheimer@gmail.com> | 12 | 2011-09-22 Ken Manheimer <ken.manheimer@gmail.com> |
| 2 | 13 | ||
| 3 | * allout.el (allout-this-command-hid-stuff): Buffer-local variable | 14 | * allout.el (allout-this-command-hid-stuff): Buffer-local variable |
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el index cbf9fe6ed86..ba7d7115ffc 100644 --- a/lisp/net/dbus.el +++ b/lisp/net/dbus.el | |||
| @@ -140,11 +140,14 @@ association to the service from D-Bus." | |||
| 140 | 140 | ||
| 141 | ;; Find the corresponding entry in the hash table. | 141 | ;; Find the corresponding entry in the hash table. |
| 142 | (let* ((key (car object)) | 142 | (let* ((key (car object)) |
| 143 | (value (cdr object)) | 143 | (value (cadr object)) |
| 144 | (bus (car key)) | ||
| 145 | (service (car value)) | ||
| 144 | (entry (gethash key dbus-registered-objects-table)) | 146 | (entry (gethash key dbus-registered-objects-table)) |
| 145 | ret) | 147 | ret) |
| 148 | ;; key has the structure (BUS INTERRFACE MEMBER). | ||
| 149 | ;; value has the structure (SERVICE PATH [HANDLER]). | ||
| 146 | ;; entry has the structure ((UNAME SERVICE PATH MEMBER [RULE]) ...). | 150 | ;; entry has the structure ((UNAME SERVICE PATH MEMBER [RULE]) ...). |
| 147 | ;; value has the structure ((SERVICE PATH [HANDLER]) ...). | ||
| 148 | ;; MEMBER is either a string (the handler), or a cons cell (a | 151 | ;; MEMBER is either a string (the handler), or a cons cell (a |
| 149 | ;; property value). UNAME and property values are not taken into | 152 | ;; property value). UNAME and property values are not taken into |
| 150 | ;; account for comparision. | 153 | ;; account for comparision. |
| @@ -152,8 +155,8 @@ association to the service from D-Bus." | |||
| 152 | ;; Loop over the registered functions. | 155 | ;; Loop over the registered functions. |
| 153 | (dolist (elt entry) | 156 | (dolist (elt entry) |
| 154 | (when (equal | 157 | (when (equal |
| 155 | (car value) | 158 | value |
| 156 | (butlast (cdr elt) (- (length (cdr elt)) (length (car value))))) | 159 | (butlast (cdr elt) (- (length (cdr elt)) (length value)))) |
| 157 | (setq ret t) | 160 | (setq ret t) |
| 158 | ;; Compute new hash value. If it is empty, remove it from the | 161 | ;; Compute new hash value. If it is empty, remove it from the |
| 159 | ;; hash table. | 162 | ;; hash table. |
| @@ -162,17 +165,16 @@ association to the service from D-Bus." | |||
| 162 | ;; Remove match rule of signals. | 165 | ;; Remove match rule of signals. |
| 163 | (let ((rule (nth 4 elt))) | 166 | (let ((rule (nth 4 elt))) |
| 164 | (when (stringp rule) | 167 | (when (stringp rule) |
| 168 | (setq service nil) ; We do not need to unregister the service. | ||
| 165 | (dbus-call-method | 169 | (dbus-call-method |
| 166 | (car key) dbus-service-dbus dbus-path-dbus dbus-interface-dbus | 170 | bus dbus-service-dbus dbus-path-dbus dbus-interface-dbus |
| 167 | "RemoveMatch" rule))))) | 171 | "RemoveMatch" rule))))) |
| 168 | ;; Check, whether there is still a registered function or property | 172 | ;; Check, whether there is still a registered function or property |
| 169 | ;; for the given service. If not, unregister the service from the | 173 | ;; for the given service. If not, unregister the service from the |
| 170 | ;; bus. | 174 | ;; bus. |
| 171 | (dolist (elt entry) | 175 | (when service |
| 172 | (let ((service (cadr elt)) | 176 | (dolist (elt entry) |
| 173 | (bus (car key)) | 177 | (let (found) |
| 174 | found) | ||
| 175 | (when service | ||
| 176 | (maphash | 178 | (maphash |
| 177 | (lambda (k v) | 179 | (lambda (k v) |
| 178 | (dolist (e v) | 180 | (dolist (e v) |
diff --git a/lisp/progmodes/cfengine.el b/lisp/progmodes/cfengine.el index 7989c60f80c..eea822328f1 100644 --- a/lisp/progmodes/cfengine.el +++ b/lisp/progmodes/cfengine.el | |||
| @@ -26,16 +26,21 @@ | |||
| 26 | ;; Provides support for editing GNU Cfengine files, including | 26 | ;; Provides support for editing GNU Cfengine files, including |
| 27 | ;; font-locking, Imenu and indention, but with no special keybindings. | 27 | ;; font-locking, Imenu and indention, but with no special keybindings. |
| 28 | 28 | ||
| 29 | ;; Possible customization for auto-mode selection: | 29 | ;; The CFEngine 3.x support doesn't have Imenu support but patches are |
| 30 | ;; (push '(("^cfagent.conf\\'" . cfengine-mode)) auto-mode-alist) | 30 | ;; welcome. |
| 31 | ;; (push '(("^cf\\." . cfengine-mode)) auto-mode-alist) | ||
| 32 | ;; (push '(("\\.cf\\'" . cfengine-mode)) auto-mode-alist) | ||
| 33 | 31 | ||
| 34 | ;; Or, if you want to use the CFEngine 3.x support: | 32 | ;; You can set it up so either cfengine-mode (2.x and earlier) or |
| 33 | ;; cfengine3-mode (3.x) will be picked, depending on the buffer | ||
| 34 | ;; contents: | ||
| 35 | 35 | ||
| 36 | ;; (push '(("^cfagent.conf\\'" . cfengine3-mode)) auto-mode-alist) | 36 | ;; (add-to-list 'auto-mode-alist '("\\.cf\\'" . cfengine-auto-mode)) |
| 37 | ;; (push '(("^cf\\." . cfengine3-mode)) auto-mode-alist) | 37 | |
| 38 | ;; (push '(("\\.cf\\'" . cfengine3-mode)) auto-mode-alist) | 38 | ;; OR you can choose to always use a specific version, if you prefer |
| 39 | ;; it | ||
| 40 | |||
| 41 | ;; (add-to-list 'auto-mode-alist '("\\.cf\\'" . cfengine3-mode)) | ||
| 42 | ;; (add-to-list 'auto-mode-alist '("^cf\\." . cfengine-mode)) | ||
| 43 | ;; (add-to-list 'auto-mode-alist '("^cfagent.conf\\'" . cfengine-mode)) | ||
| 39 | 44 | ||
| 40 | ;; This is not the same as the mode written by Rolf Ebert | 45 | ;; This is not the same as the mode written by Rolf Ebert |
| 41 | ;; <ebert@waporo.muc.de>, distributed with cfengine-2.0.5. It does | 46 | ;; <ebert@waporo.muc.de>, distributed with cfengine-2.0.5. It does |
| @@ -466,6 +471,18 @@ to the action header." | |||
| 466 | #'cfengine-beginning-of-defun) | 471 | #'cfengine-beginning-of-defun) |
| 467 | (set (make-local-variable 'end-of-defun-function) #'cfengine-end-of-defun)) | 472 | (set (make-local-variable 'end-of-defun-function) #'cfengine-end-of-defun)) |
| 468 | 473 | ||
| 474 | ;;;###autoload | ||
| 475 | (defun cfengine-auto-mode () | ||
| 476 | "Choose between `cfengine-mode' and `cfengine3-mode' depending | ||
| 477 | on the buffer contents" | ||
| 478 | (let ((v3 nil)) | ||
| 479 | (save-restriction | ||
| 480 | (goto-char (point-min)) | ||
| 481 | (while (not (or (eobp) v3)) | ||
| 482 | (setq v3 (looking-at (concat cfengine3-defuns-regex "\\>"))) | ||
| 483 | (forward-line))) | ||
| 484 | (if v3 (cfengine3-mode) (cfengine-mode)))) | ||
| 485 | |||
| 469 | (provide 'cfengine3) | 486 | (provide 'cfengine3) |
| 470 | (provide 'cfengine) | 487 | (provide 'cfengine) |
| 471 | 488 | ||