From 61e06b6cb23a719ad77ab3924beb3a0c21e9c2e9 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Thu, 5 Mar 2015 13:43:27 +0000 Subject: [PATCH] desktop.el (desktop-buffer-info): Use `pushnew'. --- lisp/ChangeLog | 2 ++ lisp/desktop.el | 17 +++++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d810ee8ce59..ef010d46093 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,6 +1,8 @@ 2015-03-05 Artur Malabarba * desktop.el (desktop-buffer-info): Write docstring. + (desktop-buffer-info): Use `pushnew' instead of `add-to-list' and + unquote lamda. * emacs-lisp/package.el (package-refresh-contents): Update doc. diff --git a/lisp/desktop.el b/lisp/desktop.el index 8d151a74698..3eca5a6a774 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -784,16 +784,13 @@ buffer, which is (in order): major-mode ;; minor modes (let (ret) - (mapc - #'(lambda (minor-mode) - (and (boundp minor-mode) - (symbol-value minor-mode) - (let* ((special (assq minor-mode desktop-minor-mode-table)) - (value (cond (special (cadr special)) - ((functionp minor-mode) minor-mode)))) - (when value (add-to-list 'ret value))))) - (mapcar #'car minor-mode-alist)) - ret) + (dolist (minor-mode (mapcar #'car minor-mode-alist) ret) + (and (boundp minor-mode) + (symbol-value minor-mode) + (let* ((special (assq minor-mode desktop-minor-mode-table)) + (value (cond (special (cadr special)) + ((functionp minor-mode) minor-mode)))) + (when value (cl-pushnew value ret)))))) ;; point and mark, and read-only status (point) (list (mark t) mark-active) -- 2.39.2