1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Use ensure-list in many more places

* 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.
This commit is contained in:
Stefan Kangas 2023-08-27 21:45:30 +02:00
parent 48068a7344
commit 967fa846fc
32 changed files with 44 additions and 76 deletions

View file

@ -1463,8 +1463,7 @@ aligner would have dealt with are."
;; that we need it ;; that we need it
(unless nil ;; group-c (unless nil ;; group-c
(setq groups (or (cdr (assq 'group rule)) 1)) (setq groups (or (cdr (assq 'group rule)) 1))
(unless (listp groups) (setq groups (ensure-list groups))
(setq groups (list groups)))
(setq first (car groups))) (setq first (car groups)))
(unless spacing-c (unless spacing-c

View file

@ -1,6 +1,6 @@
;;; auth-source-pass.el --- Integrate auth-source with password-store -*- lexical-binding: t -*- ;;; 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>, ;; Author: Damien Cassou <damien@cassou.me>,
;; Nicolas Petton <nicolas@petton.fr> ;; 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) (defun auth-source-pass--build-result-many (hosts ports users require max)
"Return multiple `auth-source-pass--build-result' values." "Return multiple `auth-source-pass--build-result' values."
(unless (listp hosts) (setq hosts (list hosts))) (setq hosts (ensure-list hosts))
(unless (listp users) (setq users (list users))) (setq users (ensure-list users))
(unless (listp ports) (setq ports (list ports))) (setq ports (ensure-list ports))
(let* ((auth-source-pass--match-regexp (auth-source-pass--match-regexp (let* ((auth-source-pass--match-regexp (auth-source-pass--match-regexp
auth-source-pass-port-separator)) auth-source-pass-port-separator))
(rv (auth-source-pass--find-match-many hosts users ports (rv (auth-source-pass--find-match-many hosts users ports

View file

@ -899,8 +899,7 @@ Remove trailing \": \"."
(defun auth-source-ensure-strings (values) (defun auth-source-ensure-strings (values)
(if (eq values t) (if (eq values t)
values values
(unless (listp values) (setq values (ensure-list values))
(setq values (list values)))
(mapcar (lambda (value) (mapcar (lambda (value)
(if (numberp value) (if (numberp value)
(format "%s" value) (format "%s" value)

View file

@ -453,8 +453,7 @@ separate appointment."
;; It repeatedly reminds you of the date? ;; It repeatedly reminds you of the date?
;; It would make more sense if it was eg the time of the appointment. ;; 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. ;; Let's allow it to be a list or not independent of the other elements.
(or (listp new-time) (setq new-time (ensure-list new-time))
(setq new-time (list new-time)))
;; FIXME Link to diary entry? ;; FIXME Link to diary entry?
(calendar-set-mode-line (calendar-set-mode-line
(format " %s. %s" (appt-mode-line min-to-app) (format " %s. %s" (appt-mode-line min-to-app)

View file

@ -89,7 +89,7 @@ Return nil if MODE has no parent."
"Run FUNCTION on every file buffer with major mode in MODES. "Run FUNCTION on every file buffer with major mode in MODES.
MODES can be a symbol or a list of symbols. MODES can be a symbol or a list of symbols.
FUNCTION does not have arguments." FUNCTION does not have arguments."
(or (listp modes) (setq modes (list modes))) (setq modes (ensure-list modes))
(mode-local-map-file-buffers (mode-local-map-file-buffers
function (lambda () function (lambda ()
(let ((mm (mode-local-equivalent-mode-p major-mode)) (let ((mm (mode-local-equivalent-mode-p major-mode))

View file

@ -973,8 +973,7 @@ it as the third element in the list."
(let ((prop (get var 'variable-interactive)) (let ((prop (get var 'variable-interactive))
(type (get var 'custom-type)) (type (get var 'custom-type))
(prompt (format prompt-val var))) (prompt (format prompt-val var)))
(unless (listp type) (setq type (ensure-list type))
(setq type (list type)))
(cond (prop (cond (prop
;; Use VAR's `variable-interactive' property ;; Use VAR's `variable-interactive' property
;; as an interactive spec for prompting. ;; as an interactive spec for prompting.
@ -5145,8 +5144,7 @@ This function does not save the buffer."
(defun custom-variable-menu-create (_widget symbol) (defun custom-variable-menu-create (_widget symbol)
"Ignoring WIDGET, create a menu entry for customization variable SYMBOL." "Ignoring WIDGET, create a menu entry for customization variable SYMBOL."
(let ((type (get symbol 'custom-type))) (let ((type (get symbol 'custom-type)))
(unless (listp type) (setq type (ensure-list type))
(setq type (list type)))
(if (and type (widget-get type :custom-menu)) (if (and type (widget-get type :custom-menu))
(widget-apply type :custom-menu symbol) (widget-apply type :custom-menu symbol)
(vector (custom-unlispify-menu-entry symbol) (vector (custom-unlispify-menu-entry symbol)

View file

@ -300,8 +300,7 @@ Interactively, ask for EXTENSION.
Prefixed with one \\[universal-argument], unmark files instead. Prefixed with one \\[universal-argument], unmark files instead.
Prefixed with two \\[universal-argument]'s, prompt for MARKER-CHAR and mark files with it." Prefixed with two \\[universal-argument]'s, prompt for MARKER-CHAR and mark files with it."
(interactive (dired--mark-suffix-interactive-spec)) (interactive (dired--mark-suffix-interactive-spec))
(unless (listp extension) (setq extension (ensure-list extension))
(setq extension (list extension)))
(dired-mark-files-regexp (dired-mark-files-regexp
(concat ".";; don't match names with nothing but an extension (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 one \\[universal-argument], unmark files instead.
Prefixed with two \\[universal-argument]'s, prompt for MARKER-CHAR and mark files with it." Prefixed with two \\[universal-argument]'s, prompt for MARKER-CHAR and mark files with it."
(interactive (dired--mark-suffix-interactive-spec)) (interactive (dired--mark-suffix-interactive-spec))
(unless (listp suffix) (setq suffix (ensure-list suffix))
(setq suffix (list suffix)))
(dired-mark-files-regexp (dired-mark-files-regexp
(concat ".";; don't match names with nothing but an extension (concat ".";; don't match names with nothing but an extension
"\\(" "\\("

View file

@ -2042,8 +2042,7 @@ from the comment."
(condition-case nil (condition-case nil
(setq lst (read (current-buffer))) (setq lst (read (current-buffer)))
(error (setq lst nil))) ; error in text (error (setq lst nil))) ; error in text
(if (not (listp lst)) ; not a list of args (setq lst (ensure-list lst))
(setq lst (list lst)))
(if (and lst (not (symbolp (car lst)))) ;weird arg (if (and lst (not (symbolp (car lst)))) ;weird arg
(setq lst nil)) (setq lst nil))
(while lst (while lst

View file

@ -652,8 +652,7 @@ If SLOT is unbound, bind it to the list containing ITEM."
(setq ov (list item)) (setq ov (list item))
(setq ov (eieio-oref object slot)) (setq ov (eieio-oref object slot))
;; turn it into a list. ;; turn it into a list.
(unless (listp ov) (setq ov (ensure-list ov))
(setq ov (list ov)))
;; Do the combination ;; Do the combination
(if (not (member item ov)) (if (not (member item ov))
(setq ov (setq ov

View file

@ -1134,7 +1134,7 @@ If ARG is the atom `-', scroll upward by nearly full screen."
(defun cua--M/H-key (map key fct) (defun cua--M/H-key (map key fct)
;; bind H-KEY or M-KEY to FCT in MAP ;; 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)) (define-key map (vector (cons cua--rectangle-modifier-key key)) fct))
(defun cua--self-insert-char-p (def) (defun cua--self-insert-char-p (def)

View file

@ -1264,8 +1264,7 @@ callback data (if any)."
keys string field index) keys string field index)
(if name (if name
(progn (progn
(unless (listp name) (setq name (ensure-list name))
(setq name (list name)))
(while name (while name
(setq args (append args (list list-keys-option (car name))) (setq args (append args (list list-keys-option (car name)))
name (cdr name)))) name (cdr name))))

View 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 MULTIPLE is non-nil, a one-element list containing DEFAULT is
returned. Otherwise, DEFAULT is returned verbatim." returned. Otherwise, DEFAULT is returned verbatim."
(let (defaults) (let (defaults)
(unless (listp default) (setq default (ensure-list default))
(setq default (list default)))
(when default (when default
(setq default (setq default
(if multiple (if multiple

View file

@ -295,7 +295,7 @@ For most purposes, consider using `format-decode-region' instead."
(setq try format-alist)) (setq try format-alist))
(setq try (cdr try)))))) (setq try (cdr try))))))
;; Deal with given format(s) ;; Deal with given format(s)
(or (listp format) (setq format (list format))) (setq format (ensure-list format))
(let ((do format) f) (let ((do format) f)
(while do (while do
(or (setq f (assq (car do) format-alist)) (or (setq f (assq (car do) format-alist))

View file

@ -2994,10 +2994,7 @@ The list is determined from the variable `gnus-score-file-alist'."
(group (or group gnus-newsgroup-name)) (group (or group gnus-newsgroup-name))
score-files) score-files)
(when group (when group
;; Make sure funcs is a list. (setq funcs (ensure-list funcs))
(and funcs
(not (listp funcs))
(setq funcs (list funcs)))
(when gnus-score-use-all-scores (when gnus-score-use-all-scores
;; Get the initial score files for this group. ;; Get the initial score files for this group.
(when funcs (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) (defun gnus-home-score-file (group &optional adapt)
"Return the home score file for GROUP. "Return the home score file for GROUP.
If ADAPT, return the home adaptive file instead." 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) 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) (while (and (not found)
(setq elem (pop list))) (setq elem (pop list)))
(setq found (setq found

View file

@ -1371,8 +1371,7 @@ When called interactively, prompt for REGEXP."
;; Allow user-defined functions to be run on this file. ;; Allow user-defined functions to be run on this file.
(when gnus-uu-grabbed-file-functions (when gnus-uu-grabbed-file-functions
(let ((funcs gnus-uu-grabbed-file-functions)) (let ((funcs gnus-uu-grabbed-file-functions))
(unless (listp funcs) (setq funcs (ensure-list funcs))
(setq funcs (list funcs)))
(while funcs (while funcs
(funcall (pop funcs) result-file)))) (funcall (pop funcs) result-file))))
(setq result-file nil) (setq result-file nil)

View file

@ -7707,10 +7707,7 @@ the message."
"")) ""))
(when message-wash-forwarded-subjects (when message-wash-forwarded-subjects
(setq subject (message-wash-subject subject))) (setq subject (message-wash-subject subject)))
;; Make sure funcs is a list. (setq funcs (ensure-list funcs))
(and funcs
(not (listp funcs))
(setq funcs (list funcs)))
;; Apply funcs in order, passing subject generated by previous ;; Apply funcs in order, passing subject generated by previous
;; func to the next one. ;; func to the next one.
(dolist (func funcs) (dolist (func funcs)

View file

@ -741,8 +741,7 @@ called interactively, user will be asked for parameters."
(when (and (stringp query) (when (and (stringp query)
(string-match "\\s-" query)) (string-match "\\s-" query))
(setq query (split-string query))) (setq query (split-string query)))
(when (not (listp query)) (setq query (ensure-list query))
(setq query (list query)))
(when (and server group query) (when (and server group query)
(let ((groupname (gnus-group-prefixed-name group server)) (let ((groupname (gnus-group-prefixed-name group server))
) ;; info ) ;; info

View file

@ -1375,8 +1375,7 @@ In the case of mover backends, checks the setting of
(when (and (car-safe groups) (listp (car-safe groups))) (when (and (car-safe groups) (listp (car-safe groups)))
(setq groups (pop groups))) (setq groups (pop groups)))
(unless (listp groups) (setq groups (ensure-list groups))
(setq groups (list groups)))
;; remove the current process mark ;; remove the current process mark
(gnus-summary-kill-process-mark) (gnus-summary-kill-process-mark)

View file

@ -1749,8 +1749,7 @@ If FRAME is omitted or nil, use the selected frame."
(called-interactively-p 'interactive)) (called-interactively-p 'interactive))
(unless face (unless face
(setq face 'default)) (setq face 'default))
(if (not (listp face)) (setq face (ensure-list face))
(setq face (list face)))
(with-help-window (help-buffer) (with-help-window (help-buffer)
(with-current-buffer standard-output (with-current-buffer standard-output
(dolist (f face (buffer-string)) (dolist (f face (buffer-string))

View file

@ -310,7 +310,7 @@ bound to the current value of the filter.
(,qualifier-str qualifier)) (,qualifier-str qualifier))
,(when accept-list ,(when accept-list
`(progn `(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). ;; Reject equivalent filters: (or f1 f2) is same as (or f2 f1).
(setq qualifier (sort (delete-dups qualifier) #'string-lessp)) (setq qualifier (sort (delete-dups qualifier) #'string-lessp))
(setq ,filter (cons ',name (car qualifier))) (setq ,filter (cons ',name (car qualifier)))

View file

@ -868,8 +868,7 @@ overrides ACCEPT-DEFAULT-P.
Kludgy feature: if FROM is a string, the string is the target text, Kludgy feature: if FROM is a string, the string is the target text,
and TO is ignored." and TO is ignored."
(if (not (listp default-coding-system)) (setq default-coding-system (ensure-list default-coding-system))
(setq default-coding-system (list default-coding-system)))
(let ((no-other-defaults nil) (let ((no-other-defaults nil)
auto-cs) auto-cs)

View file

@ -1833,7 +1833,7 @@ on failure."
(defun imap-send-command (command &optional buffer) (defun imap-send-command (command &optional buffer)
(with-current-buffer (or buffer (current-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))) (let ((tag (setq imap-tag (1+ imap-tag)))
cmd cmdstr) cmd cmdstr)
(setq cmdstr (concat (number-to-string imap-tag) " ")) (setq cmdstr (concat (number-to-string imap-tag) " "))

View file

@ -1148,8 +1148,7 @@ Used by `pr-menu-bind' and `pr-update-menus'.")
(defun pr-menu-get-item (name-list) (defun pr-menu-get-item (name-list)
;; NAME-LIST is a string or a list of strings. ;; NAME-LIST is a string or a list of strings.
(or (listp name-list) (setq name-list (ensure-list name-list))
(setq name-list (list name-list)))
(and name-list (and name-list
(let* ((reversed (reverse name-list)) (let* ((reversed (reverse name-list))
(name (easy-menu-intern (car reversed))) (name (easy-menu-intern (car reversed)))

View 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 matchers are allowed however. EXTENSION may be a single string or a
list of strings." list of strings."
(interactive "sExtension: ") (interactive "sExtension: ")
(if (not (listp extension)) (setq extension (list extension))) (setq extension (ensure-list extension))
(while extension (while extension
(if (member (car extension) speedbar-supported-extension-expressions) (if (member (car extension) speedbar-supported-extension-expressions)
nil nil
@ -677,8 +677,7 @@ list of strings."
This function will modify `speedbar-ignored-directory-regexp' and add This function will modify `speedbar-ignored-directory-regexp' and add
DIRECTORY-EXPRESSION to `speedbar-ignored-directory-expressions'." DIRECTORY-EXPRESSION to `speedbar-ignored-directory-expressions'."
(interactive "sDirectory regex: ") (interactive "sDirectory regex: ")
(if (not (listp directory-expression)) (setq directory-expression (ensure-list directory-expression))
(setq directory-expression (list directory-expression)))
(while directory-expression (while directory-expression
(if (member (car directory-expression) speedbar-ignored-directory-expressions) (if (member (car directory-expression) speedbar-ignored-directory-expressions)
nil nil

View 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 point is at the beginning of the line. Return nil if moving
forward failed or otherwise the return value of FUN. Preserve forward failed or otherwise the return value of FUN. Preserve
global match data, point, mark and current buffer." global match data, point, mark and current buffer."
(unless (listp rst-re-args) (setq rst-re-args (ensure-list rst-re-args))
(setq rst-re-args (list rst-re-args)))
(unless fun (unless fun
(setq fun #'identity)) (setq fun #'identity))
(save-match-data (save-match-data

View file

@ -165,7 +165,7 @@ returns the buffer used."
(unless (bufferp new) (setq new (expand-file-name new))) (unless (bufferp new) (setq new (expand-file-name new)))
(unless (bufferp old) (setq old (expand-file-name old))) (unless (bufferp old) (setq old (expand-file-name old)))
(or switches (setq switches diff-switches)) ; If not specified, use default. (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*"))) (or buf (setq buf (get-buffer-create "*Diff*")))
(diff-check-labels) (diff-check-labels)
(let* ((old-alt (diff-file-local-copy old)) (let* ((old-alt (diff-file-local-copy old))

View file

@ -3741,7 +3741,7 @@ Ediff Control Panel to restore highlighting."
;; these buffers). ;; these buffers).
;; EXCL-BUFF-LIST is an exclusion list. ;; EXCL-BUFF-LIST is an exclusion list.
(defun ediff-other-buffer (excl-buff-lst) (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))) (let* ((all-buffers (nconc (ediff-get-selected-buffers) (buffer-list)))
;; we compute this the second time because we need to do memq on it ;; 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 ;; later, and nconc above will break it. Either this or use slow

View file

@ -785,8 +785,7 @@ MARK-FILES should be a list of absolute filenames."
(defun vc-dir-mark-state-files (states) (defun vc-dir-mark-state-files (states)
"Mark files that are in the state specified by the list in STATES." "Mark files that are in the state specified by the list in STATES."
(unless (listp states) (setq states (ensure-list states))
(setq states (list states)))
(ewoc-map (ewoc-map
(lambda (filearg) (lambda (filearg)
(when (memq (vc-dir-fileinfo->state filearg) states) (when (memq (vc-dir-fileinfo->state filearg) states)

View 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) (defun widget-prompt-value (widget prompt &optional value unbound)
"Prompt for a value matching WIDGET, using PROMPT. "Prompt for a value matching WIDGET, using PROMPT.
The current value is assumed to be VALUE, unless UNBOUND is non-nil." The current value is assumed to be VALUE, unless UNBOUND is non-nil."
(unless (listp widget) (setq widget (ensure-list widget))
(setq widget (list widget)))
(setq prompt (format "[%s] %s" (widget-type widget) prompt)) (setq prompt (format "[%s] %s" (widget-type widget) prompt))
(setq widget (widget-convert widget)) (setq widget (widget-convert widget))
(let ((answer (widget-apply widget :prompt-value prompt value unbound))) (let ((answer (widget-apply widget :prompt-value prompt value unbound)))

View file

@ -485,7 +485,7 @@ Default value of MODIFIERS is `shift'."
(interactive) (interactive)
(unless modifiers (setq modifiers 'shift)) (unless modifiers (setq modifiers 'shift))
(when (eq modifiers 'none) (setq modifiers nil)) (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-install-defaults nil modifiers
'((windmove-left left) '((windmove-left left)
(windmove-right right) (windmove-right right)
@ -626,7 +626,7 @@ Default value of MODIFIERS is `shift-meta'."
(interactive) (interactive)
(unless modifiers (setq modifiers '(shift meta))) (unless modifiers (setq modifiers '(shift meta)))
(when (eq modifiers 'none) (setq modifiers nil)) (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-install-defaults nil modifiers
'((windmove-display-left left) '((windmove-display-left left)
(windmove-display-right right) (windmove-display-right right)
@ -703,10 +703,10 @@ Default value of PREFIX is \\`C-x' and MODIFIERS is `shift'."
(interactive) (interactive)
(unless prefix (setq prefix '(?\C-x))) (unless prefix (setq prefix '(?\C-x)))
(when (eq prefix 'none) (setq prefix nil)) (when (eq prefix 'none) (setq prefix nil))
(unless (listp prefix) (setq prefix (list prefix))) (setq prefix (ensure-list prefix))
(unless modifiers (setq modifiers '(shift))) (unless modifiers (setq modifiers '(shift)))
(when (eq modifiers 'none) (setq modifiers nil)) (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-install-defaults prefix modifiers
'((windmove-delete-left left) '((windmove-delete-left left)
(windmove-delete-right right) (windmove-delete-right right)
@ -766,7 +766,7 @@ Default value of MODIFIERS is `shift-super'."
(interactive) (interactive)
(unless modifiers (setq modifiers '(shift super))) (unless modifiers (setq modifiers '(shift super)))
(when (eq modifiers 'none) (setq modifiers nil)) (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-install-defaults nil modifiers
'((windmove-swap-states-left left) '((windmove-swap-states-left left)
(windmove-swap-states-right right) (windmove-swap-states-right right)

View file

@ -7990,8 +7990,7 @@ indirectly called by the latter."
buffer-mode)) buffer-mode))
(curwin (selected-window)) (curwin (selected-window))
(curframe (selected-frame))) (curframe (selected-frame)))
(unless (listp allowed-modes) (setq allowed-modes (ensure-list allowed-modes))
(setq allowed-modes (list allowed-modes)))
(let (same-mode-same-frame (let (same-mode-same-frame
same-mode-other-frame same-mode-other-frame
derived-mode-same-frame derived-mode-same-frame

View file

@ -1338,8 +1338,8 @@ PATH-DIRS should be a list of general manual directories (like
manual directory regexps (like `woman-path'). manual directory regexps (like `woman-path').
Ignore any paths that are unreadable or not directories." Ignore any paths that are unreadable or not directories."
;; Allow each path to be a single string or a list of strings: ;; Allow each path to be a single string or a list of strings:
(if (not (listp path-dirs)) (setq path-dirs (list path-dirs))) (setq path-dirs (ensure-list path-dirs))
(if (not (listp path-regexps)) (setq path-regexps (list path-regexps))) (setq path-regexps (ensure-list path-regexps))
(let (head dirs path) (let (head dirs path)
(dolist (dir path-dirs) (dolist (dir path-dirs)
(when (consp dir) (when (consp dir)