]> git.eshelyaron.com Git - emacs.git/commitdiff
Use ensure-list in many more places
authorStefan Kangas <stefankangas@gmail.com>
Sun, 27 Aug 2023 19:45:30 +0000 (21:45 +0200)
committerStefan Kangas <stefankangas@gmail.com>
Sun, 27 Aug 2023 19:45:30 +0000 (21:45 +0200)
* lisp/align.el (align-region):
* lisp/auth-source-pass.el (auth-source-pass--build-result-many):
* lisp/auth-source.el (auth-source-ensure-strings):
* lisp/calendar/appt.el (appt-disp-window):
* lisp/cedet/mode-local.el (mode-local-map-mode-buffers):
* lisp/cus-edit.el (custom-prompt-variable)
(custom-variable-menu-create):
* lisp/dired-x.el (dired-mark-extension, dired-mark-suffix):
* lisp/emacs-lisp/checkdoc.el (checkdoc-defun-info):
* lisp/emacs-lisp/eieio.el (object-add-to-list):
* lisp/emulation/cua-base.el (cua--M/H-key):
* lisp/epg.el (epg--list-keys-1):
* lisp/faces.el (read-face-name):
* lisp/format.el (format-decode):
* lisp/gnus/gnus-score.el (gnus-home-score-file)
(gnus-all-score-files):
* lisp/gnus/gnus-uu.el (gnus-uu-grab-articles):
* lisp/gnus/message.el (message-make-forward-subject):
* lisp/gnus/nnmairix.el (nnmairix-create-search-group):
* lisp/gnus/spam.el (spam-copy-or-move-routine):
* lisp/help-fns.el (describe-face):
* lisp/ibuf-macs.el (define-ibuffer-filter):
* lisp/international/mule-cmds.el (select-safe-coding-system):
* lisp/net/imap.el (imap-send-command):
* lisp/printing.el (pr-menu-get-item):
* lisp/speedbar.el (speedbar-add-supported-extension)
(speedbar-add-ignored-directory-regexp):
* lisp/textmodes/rst.el (rst-forward-line-looking-at):
* lisp/vc/ediff-util.el (ediff-other-buffer):
* lisp/vc/diff.el (diff-no-select):
* lisp/vc/vc-dir.el (vc-dir-mark-state-files):
* lisp/wid-edit.el (widget-prompt-value):
* lisp/windmove.el (windmove-default-keybindings)
(windmove-display-default-keybindings)
(windmove-delete-default-keybindings)
(windmove-swap-states-default-keybindings):
* lisp/window.el (display-buffer-reuse-mode-window):
* lisp/woman.el (woman-expand-directory-path): Prefer ensure-list.

32 files changed:
lisp/align.el
lisp/auth-source-pass.el
lisp/auth-source.el
lisp/calendar/appt.el
lisp/cedet/mode-local.el
lisp/cus-edit.el
lisp/dired-x.el
lisp/emacs-lisp/checkdoc.el
lisp/emacs-lisp/eieio.el
lisp/emulation/cua-base.el
lisp/epg.el
lisp/faces.el
lisp/format.el
lisp/gnus/gnus-score.el
lisp/gnus/gnus-uu.el
lisp/gnus/message.el
lisp/gnus/nnmairix.el
lisp/gnus/spam.el
lisp/help-fns.el
lisp/ibuf-macs.el
lisp/international/mule-cmds.el
lisp/net/imap.el
lisp/printing.el
lisp/speedbar.el
lisp/textmodes/rst.el
lisp/vc/diff.el
lisp/vc/ediff-util.el
lisp/vc/vc-dir.el
lisp/wid-edit.el
lisp/windmove.el
lisp/window.el
lisp/woman.el

index 0608c64deabf1649d78aadea214e37572957b103..13e31e2ad60b6f85c25f20e9183e91be95ade74d 100644 (file)
@@ -1463,8 +1463,7 @@ aligner would have dealt with are."
                     ;; that we need it
                     (unless nil ;; group-c
                       (setq groups (or (cdr (assq 'group rule)) 1))
-                      (unless (listp groups)
-                        (setq groups (list groups)))
+                      (setq groups (ensure-list groups))
                       (setq first (car groups)))
 
                     (unless spacing-c
index dbcc9d05753355edec9b4805a59df8155e032a2f..0f51755a250c049f77075f058f51d1d112fc1fee 100644 (file)
@@ -1,6 +1,6 @@
 ;;; auth-source-pass.el --- Integrate auth-source with password-store -*- lexical-binding: t -*-
 
-;; Copyright (C) 2015, 2017-2023 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2023 Free Software Foundation, Inc.
 
 ;; Author: Damien Cassou <damien@cassou.me>,
 ;;         Nicolas Petton <nicolas@petton.fr>
@@ -122,9 +122,9 @@ HOSTS can be a string or a list of strings."
 
 (defun auth-source-pass--build-result-many (hosts ports users require max)
   "Return multiple `auth-source-pass--build-result' values."
-  (unless (listp hosts) (setq hosts (list hosts)))
-  (unless (listp users) (setq users (list users)))
-  (unless (listp ports) (setq ports (list ports)))
+  (setq hosts (ensure-list hosts))
+  (setq users (ensure-list users))
+  (setq ports (ensure-list ports))
   (let* ((auth-source-pass--match-regexp (auth-source-pass--match-regexp
                                           auth-source-pass-port-separator))
          (rv (auth-source-pass--find-match-many hosts users ports
index 66de763f67108927037ebb5df4cac9c62c537c94..365f6697ec8263f330dfaac389c1574db5525ff0 100644 (file)
@@ -899,8 +899,7 @@ Remove trailing \": \"."
 (defun auth-source-ensure-strings (values)
   (if (eq values t)
       values
-    (unless (listp values)
-      (setq values (list values)))
+    (setq values (ensure-list values))
     (mapcar (lambda (value)
              (if (numberp value)
                  (format "%s" value)
index 11beee94e64037aadb35601591eaa3d25283bfe9..469b3f4023c7c2ad352e569d4e8269cfd7f001b7 100644 (file)
@@ -453,8 +453,7 @@ separate appointment."
     ;; It repeatedly reminds you of the date?
     ;; It would make more sense if it was eg the time of the appointment.
     ;; Let's allow it to be a list or not independent of the other elements.
-    (or (listp new-time)
-        (setq new-time (list new-time)))
+    (setq new-time (ensure-list new-time))
     ;; FIXME Link to diary entry?
     (calendar-set-mode-line
      (format " %s. %s" (appt-mode-line min-to-app)
index e1746e1a54159d0836e08675480a01fe22016a35..c1a48bc50c80dfd917b4e8092175b9ed0ba67ea1 100644 (file)
@@ -89,7 +89,7 @@ Return nil if MODE has no parent."
   "Run FUNCTION on every file buffer with major mode in MODES.
 MODES can be a symbol or a list of symbols.
 FUNCTION does not have arguments."
-  (or (listp modes) (setq modes (list modes)))
+  (setq modes (ensure-list modes))
   (mode-local-map-file-buffers
    function (lambda ()
               (let ((mm (mode-local-equivalent-mode-p major-mode))
index 9b73a72b2384a406824aefec2736a6eb71c90e31..1021707907da56decd8170ba0931d878ee478fcf 100644 (file)
@@ -973,8 +973,7 @@ it as the third element in the list."
          (let ((prop (get var 'variable-interactive))
                (type (get var 'custom-type))
                (prompt (format prompt-val var)))
-           (unless (listp type)
-             (setq type (list type)))
+            (setq type (ensure-list type))
            (cond (prop
                   ;; Use VAR's `variable-interactive' property
                   ;; as an interactive spec for prompting.
@@ -5145,8 +5144,7 @@ This function does not save the buffer."
 (defun custom-variable-menu-create (_widget symbol)
   "Ignoring WIDGET, create a menu entry for customization variable SYMBOL."
   (let ((type (get symbol 'custom-type)))
-    (unless (listp type)
-      (setq type (list type)))
+    (setq type (ensure-list type))
     (if (and type (widget-get type :custom-menu))
        (widget-apply type :custom-menu symbol)
       (vector (custom-unlispify-menu-entry symbol)
index 5780f1353adc6f332d9c489b828355fda0e5a6d5..398f55f2a24de8ef26ae6227a3290fd032ae61c4 100644 (file)
@@ -300,8 +300,7 @@ Interactively, ask for EXTENSION.
 Prefixed with one \\[universal-argument], unmark files instead.
 Prefixed with two \\[universal-argument]'s, prompt for MARKER-CHAR and mark files with it."
   (interactive (dired--mark-suffix-interactive-spec))
-  (unless (listp extension)
-    (setq extension (list extension)))
+  (setq extension (ensure-list extension))
   (dired-mark-files-regexp
    (concat ".";; don't match names with nothing but an extension
            "\\("
@@ -325,8 +324,7 @@ Interactively, ask for SUFFIX.
 Prefixed with one \\[universal-argument], unmark files instead.
 Prefixed with two \\[universal-argument]'s, prompt for MARKER-CHAR and mark files with it."
   (interactive (dired--mark-suffix-interactive-spec))
-  (unless (listp suffix)
-    (setq suffix (list suffix)))
+  (setq suffix (ensure-list suffix))
   (dired-mark-files-regexp
    (concat ".";; don't match names with nothing but an extension
            "\\("
index aadd6480086b01c228475077467bb8be1be845cb..3c4b6baca53e18f9088b54a4e14a0462fa422d11 100644 (file)
@@ -2042,8 +2042,7 @@ from the comment."
                           (condition-case nil
                               (setq lst (read (current-buffer)))
                             (error (setq lst nil))) ; error in text
-                           (if (not (listp lst)) ; not a list of args
-                               (setq lst (list lst)))
+                           (setq lst (ensure-list lst))
                           (if (and lst (not (symbolp (car lst)))) ;weird arg
                               (setq lst nil))
                           (while lst
index 9a1f5b9db0f44ff42aa095f8df3f6b2ded318c74..ccdb52d6a1f9de650766388bcfe6c6ef425808bb 100644 (file)
@@ -652,8 +652,7 @@ If SLOT is unbound, bind it to the list containing ITEM."
        (setq ov (list item))
       (setq ov (eieio-oref object slot))
       ;; turn it into a list.
-      (unless (listp ov)
-       (setq ov (list ov)))
+      (setq ov (ensure-list ov))
       ;; Do the combination
       (if (not (member item ov))
          (setq ov
index a6d6f47ead51ea254264adc7395b72025ec19866..6d21088cb298e1551ba32ed353d01ef75daedb95 100644 (file)
@@ -1134,7 +1134,7 @@ If ARG is the atom `-', scroll upward by nearly full screen."
 
 (defun cua--M/H-key (map key fct)
   ;; bind H-KEY or M-KEY to FCT in MAP
-  (unless (listp key) (setq key (list key)))
+  (setq key (ensure-list key))
   (define-key map (vector (cons cua--rectangle-modifier-key key)) fct))
 
 (defun cua--self-insert-char-p (def)
index 9da5a36ba3d207f2db64394537610c58c17198cf..b8423d82a265f5f9f8b82f3c2e1cecc76fdf412f 100644 (file)
@@ -1264,8 +1264,7 @@ callback data (if any)."
        keys string field index)
     (if name
        (progn
-         (unless (listp name)
-           (setq name (list name)))
+          (setq name (ensure-list name))
          (while name
            (setq args (append args (list list-keys-option (car name)))
                  name (cdr name))))
index 1a446aacacd0ffa06600622cbeabd8beb13dbb84..8f93f9b2c0c6179b9d73ab0a36e88f3686c08173 100644 (file)
@@ -1118,8 +1118,7 @@ element of DEFAULT is returned.  If DEFAULT isn't a list, but
 MULTIPLE is non-nil, a one-element list containing DEFAULT is
 returned.  Otherwise, DEFAULT is returned verbatim."
   (let (defaults)
-    (unless (listp default)
-      (setq default (list default)))
+    (setq default (ensure-list default))
     (when default
       (setq default
             (if multiple
index 5c72a78f325e72d323771e373b77ea7dd3fbead8..89a83c3cee226b4e190d718a94a9c6c5650f5197 100644 (file)
@@ -295,7 +295,7 @@ For most purposes, consider using `format-decode-region' instead."
                          (setq try format-alist))
                      (setq try (cdr try))))))
            ;; Deal with given format(s)
-           (or (listp format) (setq format (list format)))
+            (setq format (ensure-list format))
            (let ((do format) f)
              (while do
                (or (setq f (assq (car do) format-alist))
index 8bdfccf7eb83193ce7205bdb3827b997aca5ffac..62167ea9e6ac9c25ec96d7d9777420d933a6c04b 100644 (file)
@@ -2994,10 +2994,7 @@ The list is determined from the variable `gnus-score-file-alist'."
        (group (or group gnus-newsgroup-name))
        score-files)
     (when group
-      ;; Make sure funcs is a list.
-      (and funcs
-          (not (listp funcs))
-          (setq funcs (list funcs)))
+      (setq funcs (ensure-list funcs))
       (when gnus-score-use-all-scores
        ;; Get the initial score files for this group.
        (when funcs
@@ -3104,12 +3101,8 @@ The list is determined from the variable `gnus-score-file-alist'."
 (defun gnus-home-score-file (group &optional adapt)
   "Return the home score file for GROUP.
 If ADAPT, return the home adaptive file instead."
-  (let ((list (if adapt gnus-home-adapt-file gnus-home-score-file))
+  (let ((list (ensure-list (if adapt gnus-home-adapt-file gnus-home-score-file)))
        elem found)
-    ;; Make sure we have a list.
-    (unless (listp list)
-      (setq list (list list)))
-    ;; Go through the list and look for matches.
     (while (and (not found)
                (setq elem (pop list)))
       (setq found
index 1846f05af2dab288977f4d31ff72e1786b175213..6ed6358e8ce2ae2d85aaab4e00848a195016e8b4 100644 (file)
@@ -1371,8 +1371,7 @@ When called interactively, prompt for REGEXP."
          ;; Allow user-defined functions to be run on this file.
          (when gnus-uu-grabbed-file-functions
            (let ((funcs gnus-uu-grabbed-file-functions))
-             (unless (listp funcs)
-               (setq funcs (list funcs)))
+              (setq funcs (ensure-list funcs))
              (while funcs
                (funcall (pop funcs) result-file))))
          (setq result-file nil)
index 45cc21701b3133df28ff7633563d252afdc0dcf4..7a31f86a2c451dff64998ff261927dea601e930d 100644 (file)
@@ -7707,10 +7707,7 @@ the message."
                ""))
        (when message-wash-forwarded-subjects
          (setq subject (message-wash-subject subject)))
-       ;; Make sure funcs is a list.
-       (and funcs
-            (not (listp funcs))
-            (setq funcs (list funcs)))
+        (setq funcs (ensure-list funcs))
        ;; Apply funcs in order, passing subject generated by previous
        ;; func to the next one.
        (dolist (func funcs)
index 72833d7bc33a90ce4d3a13c36533420ef7ad7eab..deb2b669b6be2f2417e7f06bf27c2a7f6bb12b32 100644 (file)
@@ -741,8 +741,7 @@ called interactively, user will be asked for parameters."
   (when (and (stringp query)
             (string-match "\\s-" query))
     (setq query (split-string query)))
-  (when (not (listp query))
-    (setq query (list query)))
+  (setq query (ensure-list query))
   (when (and server group query)
     (let ((groupname (gnus-group-prefixed-name group server))
           ) ;; info
index 3178d9f59e69a11afb049a88c9e255a80f8deb76..c598b10bc08f0c4e5d5336c572326450774a3bb1 100644 (file)
@@ -1375,8 +1375,7 @@ In the case of mover backends, checks the setting of
   (when (and (car-safe groups) (listp (car-safe groups)))
     (setq groups (pop groups)))
 
-  (unless (listp groups)
-    (setq groups (list groups)))
+  (setq groups (ensure-list groups))
 
     ;; remove the current process mark
   (gnus-summary-kill-process-mark)
index 22cfbbc39cdfca61ffdb04d7024ea80796d8bf55..609bed18f2f9d8476067fc40a625a6345d53f1fc 100644 (file)
@@ -1749,8 +1749,7 @@ If FRAME is omitted or nil, use the selected frame."
                     (called-interactively-p 'interactive))
     (unless face
       (setq face 'default))
-    (if (not (listp face))
-        (setq face (list face)))
+    (setq face (ensure-list face))
     (with-help-window (help-buffer)
       (with-current-buffer standard-output
         (dolist (f face (buffer-string))
index 2c9e9ea8bcda1c53124266a75197db2576a8a23c..c38dfefe0c5c194b5fb1135328ba45f15d31e92c 100644 (file)
@@ -310,7 +310,7 @@ bound to the current value of the filter.
            (,qualifier-str qualifier))
        ,(when accept-list
           `(progn
-         (unless (listp qualifier) (setq qualifier (list qualifier)))
+         (setq qualifier (ensure-list qualifier))
          ;; Reject equivalent filters: (or f1 f2) is same as (or f2 f1).
          (setq qualifier (sort (delete-dups qualifier) #'string-lessp))
          (setq ,filter (cons ',name (car qualifier)))
index e3811d81ec2d7e3b3e2863c3126554f5464f19fc..c26898f7649e1962924ec6d1200818aaffb98bbc 100644 (file)
@@ -868,8 +868,7 @@ overrides ACCEPT-DEFAULT-P.
 
 Kludgy feature: if FROM is a string, the string is the target text,
 and TO is ignored."
-  (if (not (listp default-coding-system))
-      (setq default-coding-system (list default-coding-system)))
+  (setq default-coding-system (ensure-list default-coding-system))
 
   (let ((no-other-defaults nil)
        auto-cs)
index cfb92674d8a32d59e4355b225ee3019ff789c40d..7de847e2a5976a7e3a0f2c1883e7eb35bb00d3b6 100644 (file)
@@ -1833,7 +1833,7 @@ on failure."
 
 (defun imap-send-command (command &optional buffer)
   (with-current-buffer (or buffer (current-buffer))
-    (if (not (listp command)) (setq command (list command)))
+    (setq command (ensure-list command))
     (let ((tag (setq imap-tag (1+ imap-tag)))
          cmd cmdstr)
       (setq cmdstr (concat (number-to-string imap-tag) " "))
index 4a6d14260a032545ced25ace45f55a7cb4b20c0a..8aea58e157b97986590c32efe87dbb1769be541b 100644 (file)
@@ -1148,8 +1148,7 @@ Used by `pr-menu-bind' and `pr-update-menus'.")
 
 (defun pr-menu-get-item (name-list)
   ;; NAME-LIST is a string or a list of strings.
-  (or (listp name-list)
-      (setq name-list (list name-list)))
+  (setq name-list (ensure-list name-list))
   (and name-list
        (let* ((reversed (reverse name-list))
              (name (easy-menu-intern (car reversed)))
index f56c39155213f493589bff729fcabeef1164df07..67d4e8c4df1625237736009345c773158b337eed 100644 (file)
@@ -662,7 +662,7 @@ the dot should NOT be quoted in with \\.  Other regular expression
 matchers are allowed however.  EXTENSION may be a single string or a
 list of strings."
   (interactive "sExtension: ")
-  (if (not (listp extension)) (setq extension (list extension)))
+  (setq extension (ensure-list extension))
   (while extension
     (if (member (car extension) speedbar-supported-extension-expressions)
        nil
@@ -677,8 +677,7 @@ list of strings."
 This function will modify `speedbar-ignored-directory-regexp' and add
 DIRECTORY-EXPRESSION to `speedbar-ignored-directory-expressions'."
   (interactive "sDirectory regex: ")
-  (if (not (listp directory-expression))
-      (setq directory-expression (list directory-expression)))
+  (setq directory-expression (ensure-list directory-expression))
   (while directory-expression
     (if (member (car directory-expression) speedbar-ignored-directory-expressions)
        nil
index 6108e80363ce9150f8657d2f069d2bc494a2c001..d2661a44734b6af20be083e01639201c5fe431e1 100644 (file)
@@ -170,8 +170,7 @@ When FUN is called match data is just set by `looking-at' and
 point is at the beginning of the line.  Return nil if moving
 forward failed or otherwise the return value of FUN.  Preserve
 global match data, point, mark and current buffer."
-  (unless (listp rst-re-args)
-    (setq rst-re-args (list rst-re-args)))
+  (setq rst-re-args (ensure-list rst-re-args))
   (unless fun
     (setq fun #'identity))
   (save-match-data
index 90c43d111f5f993f73eb06695182f80b72cdac5f..a411d98da3147955e4ac2a61e23364bc11943c5f 100644 (file)
@@ -165,7 +165,7 @@ returns the buffer used."
   (unless (bufferp new) (setq new (expand-file-name new)))
   (unless (bufferp old) (setq old (expand-file-name old)))
   (or switches (setq switches diff-switches)) ; If not specified, use default.
-  (unless (listp switches) (setq switches (list switches)))
+  (setq switches (ensure-list switches))
   (or buf (setq buf (get-buffer-create "*Diff*")))
   (diff-check-labels)
   (let* ((old-alt (diff-file-local-copy old))
index 8011d7ce2e0459fff2ce5ab22a5b3480b4463814..c4ebe20d7e47ad4f2915e02144424cc5071a23ce 100644 (file)
@@ -3741,7 +3741,7 @@ Ediff Control Panel to restore highlighting."
 ;; these buffers).
 ;; EXCL-BUFF-LIST is an exclusion list.
 (defun ediff-other-buffer (excl-buff-lst)
-  (or (listp excl-buff-lst) (setq excl-buff-lst (list excl-buff-lst)))
+  (setq excl-buff-lst (ensure-list excl-buff-lst))
   (let* ((all-buffers (nconc (ediff-get-selected-buffers) (buffer-list)))
         ;; we compute this the second time because we need to do memq on it
         ;; later, and nconc above will break it. Either this or use slow
index 53d58870b320be98485407717015c5748e6e9362..d5226910211dd0a54372bf26e6deb1e07beb8da2 100644 (file)
@@ -785,8 +785,7 @@ MARK-FILES should be a list of absolute filenames."
 
 (defun vc-dir-mark-state-files (states)
   "Mark files that are in the state specified by the list in STATES."
-  (unless (listp states)
-    (setq states (list states)))
+  (setq states (ensure-list states))
   (ewoc-map
    (lambda (filearg)
      (when (memq (vc-dir-fileinfo->state filearg) states)
index a70598bb6c98b1d7b96a39894f2112449fa5b8b9..ae060c92d0e9cbf6561ea95d4d908841e52d0c83 100644 (file)
@@ -644,8 +644,7 @@ Return a list whose car contains all members of VALS that matched WIDGET."
 (defun widget-prompt-value (widget prompt &optional value unbound)
   "Prompt for a value matching WIDGET, using PROMPT.
 The current value is assumed to be VALUE, unless UNBOUND is non-nil."
-  (unless (listp widget)
-    (setq widget (list widget)))
+  (setq widget (ensure-list widget))
   (setq prompt (format "[%s] %s" (widget-type widget) prompt))
   (setq widget (widget-convert widget))
   (let ((answer (widget-apply widget :prompt-value prompt value unbound)))
index 746a440bacb7fc6b3140d8a99f586c65236bdbcb..96b8597ae093abd6ff59555ff51dd6652229b7cc 100644 (file)
@@ -485,7 +485,7 @@ Default value of MODIFIERS is `shift'."
   (interactive)
   (unless modifiers (setq modifiers 'shift))
   (when (eq modifiers 'none) (setq modifiers nil))
-  (unless (listp modifiers) (setq modifiers (list modifiers)))
+  (setq modifiers (ensure-list modifiers))
   (windmove-install-defaults nil modifiers
                              '((windmove-left left)
                                (windmove-right right)
@@ -626,7 +626,7 @@ Default value of MODIFIERS is `shift-meta'."
   (interactive)
   (unless modifiers (setq modifiers '(shift meta)))
   (when (eq modifiers 'none) (setq modifiers nil))
-  (unless (listp modifiers) (setq modifiers (list modifiers)))
+  (setq modifiers (ensure-list modifiers))
   (windmove-install-defaults nil modifiers
                              '((windmove-display-left left)
                                (windmove-display-right right)
@@ -703,10 +703,10 @@ Default value of PREFIX is \\`C-x' and MODIFIERS is `shift'."
   (interactive)
   (unless prefix (setq prefix '(?\C-x)))
   (when (eq prefix 'none) (setq prefix nil))
-  (unless (listp prefix) (setq prefix (list prefix)))
+  (setq prefix (ensure-list prefix))
   (unless modifiers (setq modifiers '(shift)))
   (when (eq modifiers 'none) (setq modifiers nil))
-  (unless (listp modifiers) (setq modifiers (list modifiers)))
+  (setq modifiers (ensure-list modifiers))
   (windmove-install-defaults prefix modifiers
                              '((windmove-delete-left left)
                                (windmove-delete-right right)
@@ -766,7 +766,7 @@ Default value of MODIFIERS is `shift-super'."
   (interactive)
   (unless modifiers (setq modifiers '(shift super)))
   (when (eq modifiers 'none) (setq modifiers nil))
-  (unless (listp modifiers) (setq modifiers (list modifiers)))
+  (setq modifiers (ensure-list modifiers))
   (windmove-install-defaults nil modifiers
                              '((windmove-swap-states-left left)
                                (windmove-swap-states-right right)
index b0970cfb0647bcfe33d474c842b63d8da1499609..b9b032c33e9c6133f73592188a72c1d973dec07e 100644 (file)
@@ -7990,8 +7990,7 @@ indirectly called by the latter."
                           buffer-mode))
          (curwin (selected-window))
          (curframe (selected-frame)))
-    (unless (listp allowed-modes)
-      (setq allowed-modes (list allowed-modes)))
+    (setq allowed-modes (ensure-list allowed-modes))
     (let (same-mode-same-frame
           same-mode-other-frame
           derived-mode-same-frame
index e0af72b2b66469c220464a065ac803515d472e96..e20a2399c0073285094138a158b983f5211b22c9 100644 (file)
@@ -1338,8 +1338,8 @@ PATH-DIRS should be a list of general manual directories (like
 manual directory regexps (like `woman-path').
 Ignore any paths that are unreadable or not directories."
   ;; Allow each path to be a single string or a list of strings:
-  (if (not (listp path-dirs)) (setq path-dirs (list path-dirs)))
-  (if (not (listp path-regexps)) (setq path-regexps (list path-regexps)))
+  (setq path-dirs (ensure-list path-dirs))
+  (setq path-regexps (ensure-list path-regexps))
   (let (head dirs path)
     (dolist (dir path-dirs)
       (when (consp dir)