diff options
| author | Mark Oteiza | 2016-07-08 21:49:52 -0400 |
|---|---|---|
| committer | Mark Oteiza | 2016-07-08 21:49:52 -0400 |
| commit | 316bbd956e8ce9f5cbbc750fda61eb570276ceea (patch) | |
| tree | c80002b1bfca80bdce99e2c115b62ad3b3ce71ce | |
| parent | 7095596ac3ece75b7fb98be7a47e4715a54842c2 (diff) | |
| download | emacs-316bbd956e8ce9f5cbbc750fda61eb570276ceea.tar.gz emacs-316bbd956e8ce9f5cbbc750fda61eb570276ceea.zip | |
Turn on lexical binding
* lisp/net/secrets.el (secrets-collection-handler): Use cl-pushnew.
(secrets-search-items, secrets-create-item): Use append.
(secrets-show-secrets): Remove unused binding.
(secrets-expand-item, secrets-tree-widget-after-toggle-function):
Ignore unused arguments.
| -rw-r--r-- | lisp/net/secrets.el | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/lisp/net/secrets.el b/lisp/net/secrets.el index 82c886d6b31..ea26a521afd 100644 --- a/lisp/net/secrets.el +++ b/lisp/net/secrets.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; secrets.el --- Client interface to gnome-keyring and kwallet. | 1 | ;;; secrets.el --- Client interface to gnome-keyring and kwallet. -*- lexical-binding: t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 2010-2016 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2010-2016 Free Software Foundation, Inc. |
| 4 | 4 | ||
| @@ -433,7 +433,7 @@ returned, and it will be stored in `secrets-session-path'." | |||
| 433 | "Handler for signals emitted by `secrets-interface-service'." | 433 | "Handler for signals emitted by `secrets-interface-service'." |
| 434 | (cond | 434 | (cond |
| 435 | ((string-equal (dbus-event-member-name last-input-event) "CollectionCreated") | 435 | ((string-equal (dbus-event-member-name last-input-event) "CollectionCreated") |
| 436 | (add-to-list 'secrets-collection-paths (car args))) | 436 | (cl-pushnew (car args) secrets-collection-paths)) |
| 437 | ((string-equal (dbus-event-member-name last-input-event) "CollectionDeleted") | 437 | ((string-equal (dbus-event-member-name last-input-event) "CollectionDeleted") |
| 438 | (setq secrets-collection-paths | 438 | (setq secrets-collection-paths |
| 439 | (delete (car args) secrets-collection-paths))))) | 439 | (delete (car args) secrets-collection-paths))))) |
| @@ -610,12 +610,11 @@ The object labels of the found items are returned as list." | |||
| 610 | (error 'wrong-type-argument (car attributes))) | 610 | (error 'wrong-type-argument (car attributes))) |
| 611 | (unless (stringp (cadr attributes)) | 611 | (unless (stringp (cadr attributes)) |
| 612 | (error 'wrong-type-argument (cadr attributes))) | 612 | (error 'wrong-type-argument (cadr attributes))) |
| 613 | (setq props (add-to-list | 613 | (setq props (append |
| 614 | 'props | 614 | props |
| 615 | (list :dict-entry | 615 | (list :dict-entry |
| 616 | (substring (symbol-name (car attributes)) 1) | 616 | (substring (symbol-name (car attributes)) 1) |
| 617 | (cadr attributes)) | 617 | (cadr attributes))) |
| 618 | 'append) | ||
| 619 | attributes (cddr attributes))) | 618 | attributes (cddr attributes))) |
| 620 | ;; Search. The result is a list of object paths. | 619 | ;; Search. The result is a list of object paths. |
| 621 | (setq result | 620 | (setq result |
| @@ -649,12 +648,11 @@ The object path of the created item is returned." | |||
| 649 | (error 'wrong-type-argument (car attributes))) | 648 | (error 'wrong-type-argument (car attributes))) |
| 650 | (unless (stringp (cadr attributes)) | 649 | (unless (stringp (cadr attributes)) |
| 651 | (error 'wrong-type-argument (cadr attributes))) | 650 | (error 'wrong-type-argument (cadr attributes))) |
| 652 | (setq props (add-to-list | 651 | (setq props (append |
| 653 | 'props | 652 | props |
| 654 | (list :dict-entry | 653 | (list :dict-entry |
| 655 | (substring (symbol-name (car attributes)) 1) | 654 | (substring (symbol-name (car attributes)) 1) |
| 656 | (cadr attributes)) | 655 | (cadr attributes))) |
| 657 | 'append) | ||
| 658 | attributes (cddr attributes))) | 656 | attributes (cddr attributes))) |
| 659 | ;; Create the item. | 657 | ;; Create the item. |
| 660 | (setq result | 658 | (setq result |
| @@ -782,8 +780,7 @@ to their attributes." | |||
| 782 | 780 | ||
| 783 | (defun secrets-show-collections (&optional _ignore _noconfirm) | 781 | (defun secrets-show-collections (&optional _ignore _noconfirm) |
| 784 | "Show all available collections." | 782 | "Show all available collections." |
| 785 | (let ((inhibit-read-only t) | 783 | (let ((inhibit-read-only t)) |
| 786 | (alias (secrets-get-alias "default"))) | ||
| 787 | (erase-buffer) | 784 | (erase-buffer) |
| 788 | (tree-widget-set-theme "folder") | 785 | (tree-widget-set-theme "folder") |
| 789 | (dolist (coll (secrets-list-collections)) | 786 | (dolist (coll (secrets-list-collections)) |
| @@ -852,7 +849,7 @@ to their attributes." | |||
| 852 | "%v\n")))) | 849 | "%v\n")))) |
| 853 | attributes)))) | 850 | attributes)))) |
| 854 | 851 | ||
| 855 | (defun secrets-tree-widget-after-toggle-function (widget &rest ignore) | 852 | (defun secrets-tree-widget-after-toggle-function (widget &rest _ignore) |
| 856 | "Add a temporary widget to show the password." | 853 | "Add a temporary widget to show the password." |
| 857 | (dolist (child (widget-get widget :children)) | 854 | (dolist (child (widget-get widget :children)) |
| 858 | (when (widget-member child :secret) | 855 | (when (widget-member child :secret) |
| @@ -864,7 +861,7 @@ to their attributes." | |||
| 864 | "Show password"))) | 861 | "Show password"))) |
| 865 | (widget-setup)) | 862 | (widget-setup)) |
| 866 | 863 | ||
| 867 | (defun secrets-tree-widget-show-password (widget &rest ignore) | 864 | (defun secrets-tree-widget-show-password (widget &rest _ignore) |
| 868 | "Show password, and remove temporary widget." | 865 | "Show password, and remove temporary widget." |
| 869 | (let ((parent (widget-get widget :parent))) | 866 | (let ((parent (widget-get widget :parent))) |
| 870 | (widget-put parent :secret nil) | 867 | (widget-put parent :secret nil) |