Commit 136e1d23 authored by Paul Eggert's avatar Paul Eggert

uniqify -> uniquify

The latter spelling is more common both within Emacs and in
English-language sources in general (Bug#10048).
* lisp/eshell/esh-util.el (eshell-uniquify-list):
Rename from eshell-uniqify-list.  All callers changed.
* lisp/pcomplete.el (pcomplete-uniquify-list):
Rename from pcomplete-uniqify-list.  All callers changed.
parent 0e10b6fc
...@@ -259,6 +259,13 @@ To restore the old behavior, use ...@@ -259,6 +259,13 @@ To restore the old behavior, use
(add-hook 'eshell-expand-input-functions (add-hook 'eshell-expand-input-functions
#'eshell-expand-history-references) #'eshell-expand-history-references)
*** The function 'shell-uniquify-list' has been renamed from
'eshell-uniqify-list'.
** Pcomplete
*** The function 'pcomplete-uniquify-list' has been renamed from
'pcomplete-uniqify-list'.
** Tramp ** Tramp
+++ +++
......
...@@ -434,7 +434,7 @@ to writing a completion function." ...@@ -434,7 +434,7 @@ to writing a completion function."
(setq comps-in-path (cdr comps-in-path))) (setq comps-in-path (cdr comps-in-path)))
(setq paths (cdr paths))) (setq paths (cdr paths)))
;; Add aliases which are currently visible, and Lisp functions. ;; Add aliases which are currently visible, and Lisp functions.
(pcomplete-uniqify-list (pcomplete-uniquify-list
(if glob-name (if glob-name
completions completions
(setq completions (setq completions
......
...@@ -282,7 +282,7 @@ Thus, this does not include the current directory.") ...@@ -282,7 +282,7 @@ Thus, this does not include the current directory.")
(defvar pcomplete-stub) (defvar pcomplete-stub)
(defvar pcomplete-last-completion-raw) (defvar pcomplete-last-completion-raw)
(declare-function pcomplete-actual-arg "pcomplete") (declare-function pcomplete-actual-arg "pcomplete")
(declare-function pcomplete-uniqify-list "pcomplete") (declare-function pcomplete-uniquify-list "pcomplete")
(defun eshell-complete-user-reference () (defun eshell-complete-user-reference ()
"If there is a user reference, complete it." "If there is a user reference, complete it."
...@@ -293,7 +293,7 @@ Thus, this does not include the current directory.") ...@@ -293,7 +293,7 @@ Thus, this does not include the current directory.")
(throw 'pcomplete-completions (throw 'pcomplete-completions
(progn (progn
(eshell-read-user-names) (eshell-read-user-names)
(pcomplete-uniqify-list (pcomplete-uniquify-list
(mapcar (mapcar
(function (function
(lambda (user) (lambda (user)
......
...@@ -131,7 +131,7 @@ The format of each entry is ...@@ -131,7 +131,7 @@ The format of each entry is
(?e . #'(lambda (lst) (mapcar 'file-name-extension lst))) (?e . #'(lambda (lst) (mapcar 'file-name-extension lst)))
(?t . #'(lambda (lst) (mapcar 'file-name-nondirectory lst))) (?t . #'(lambda (lst) (mapcar 'file-name-nondirectory lst)))
(?q . #'(lambda (lst) (mapcar 'eshell-escape-arg lst))) (?q . #'(lambda (lst) (mapcar 'eshell-escape-arg lst)))
(?u . #'(lambda (lst) (eshell-uniqify-list lst))) (?u . #'(lambda (lst) (eshell-uniquify-list lst)))
(?o . #'(lambda (lst) (sort lst 'string-lessp))) (?o . #'(lambda (lst) (sort lst 'string-lessp)))
(?O . #'(lambda (lst) (nreverse (sort lst 'string-lessp)))) (?O . #'(lambda (lst) (nreverse (sort lst 'string-lessp))))
(?j . (eshell-join-members)) (?j . (eshell-join-members))
......
...@@ -295,7 +295,7 @@ Prepend remote identification of `default-directory', if any." ...@@ -295,7 +295,7 @@ Prepend remote identification of `default-directory', if any."
(nconc new-list (list a)))) (nconc new-list (list a))))
(cdr new-list))) (cdr new-list)))
(defun eshell-uniqify-list (l) (defun eshell-uniquify-list (l)
"Remove occurring multiples in L. You probably want to sort first." "Remove occurring multiples in L. You probably want to sort first."
(let ((m l)) (let ((m l))
(while m (while m
...@@ -305,6 +305,9 @@ Prepend remote identification of `default-directory', if any." ...@@ -305,6 +305,9 @@ Prepend remote identification of `default-directory', if any."
(setcdr m (cddr m))) (setcdr m (cddr m)))
(setq m (cdr m)))) (setq m (cdr m))))
l) l)
(define-obsolete-function-alias
'eshell-uniqify-list
'eshell-uniquify-list "27.1")
(defun eshell-stringify (object) (defun eshell-stringify (object)
"Convert OBJECT into a string value." "Convert OBJECT into a string value."
......
...@@ -194,7 +194,7 @@ When completing for #+STARTUP, for example, this function returns ...@@ -194,7 +194,7 @@ When completing for #+STARTUP, for example, this function returns
"Complete arguments for the #+LANGUAGE file option." "Complete arguments for the #+LANGUAGE file option."
(require 'ox) (require 'ox)
(pcomplete-here (pcomplete-here
(pcomplete-uniqify-list (pcomplete-uniquify-list
(list org-export-default-language "en")))) (list org-export-default-language "en"))))
(defvar org-default-priority) (defvar org-default-priority)
...@@ -219,7 +219,7 @@ When completing for #+STARTUP, for example, this function returns ...@@ -219,7 +219,7 @@ When completing for #+STARTUP, for example, this function returns
(defun pcomplete/org-mode/file-option/startup () (defun pcomplete/org-mode/file-option/startup ()
"Complete arguments for the #+STARTUP file option." "Complete arguments for the #+STARTUP file option."
(while (pcomplete-here (while (pcomplete-here
(let ((opts (pcomplete-uniqify-list (let ((opts (pcomplete-uniquify-list
(mapcar 'car org-startup-options)))) (mapcar 'car org-startup-options))))
;; Some options are mutually exclusive, and shouldn't be completed ;; Some options are mutually exclusive, and shouldn't be completed
;; against if certain other options have already been seen. ;; against if certain other options have already been seen.
...@@ -248,7 +248,7 @@ When completing for #+STARTUP, for example, this function returns ...@@ -248,7 +248,7 @@ When completing for #+STARTUP, for example, this function returns
(defun pcomplete/org-mode/file-option/options () (defun pcomplete/org-mode/file-option/options ()
"Complete arguments for the #+OPTIONS file option." "Complete arguments for the #+OPTIONS file option."
(while (pcomplete-here (while (pcomplete-here
(pcomplete-uniqify-list (pcomplete-uniquify-list
(append (append
;; Hard-coded OPTION items always available. ;; Hard-coded OPTION items always available.
'("H:" "\\n:" "num:" "timestamp:" "arch:" "author:" "c:" '("H:" "\\n:" "num:" "timestamp:" "arch:" "author:" "c:"
...@@ -267,7 +267,7 @@ When completing for #+STARTUP, for example, this function returns ...@@ -267,7 +267,7 @@ When completing for #+STARTUP, for example, this function returns
(defun pcomplete/org-mode/file-option/infojs_opt () (defun pcomplete/org-mode/file-option/infojs_opt ()
"Complete arguments for the #+INFOJS_OPT file option." "Complete arguments for the #+INFOJS_OPT file option."
(while (pcomplete-here (while (pcomplete-here
(pcomplete-uniqify-list (pcomplete-uniquify-list
(mapcar (lambda (item) (format "%s:" (car item))) (mapcar (lambda (item) (format "%s:" (car item)))
(bound-and-true-p org-html-infojs-opts-table)))))) (bound-and-true-p org-html-infojs-opts-table))))))
...@@ -283,7 +283,7 @@ When completing for #+STARTUP, for example, this function returns ...@@ -283,7 +283,7 @@ When completing for #+STARTUP, for example, this function returns
(defun pcomplete/org-mode/link () (defun pcomplete/org-mode/link ()
"Complete against defined #+LINK patterns." "Complete against defined #+LINK patterns."
(pcomplete-here (pcomplete-here
(pcomplete-uniqify-list (pcomplete-uniquify-list
(copy-sequence (copy-sequence
(append (mapcar 'car org-link-abbrev-alist-local) (append (mapcar 'car org-link-abbrev-alist-local)
(mapcar 'car org-link-abbrev-alist)))))) (mapcar 'car org-link-abbrev-alist))))))
...@@ -293,13 +293,13 @@ When completing for #+STARTUP, for example, this function returns ...@@ -293,13 +293,13 @@ When completing for #+STARTUP, for example, this function returns
"Complete against TeX-style HTML entity names." "Complete against TeX-style HTML entity names."
(require 'org-entities) (require 'org-entities)
(while (pcomplete-here (while (pcomplete-here
(pcomplete-uniqify-list (remove nil (mapcar 'car-safe org-entities))) (pcomplete-uniquify-list (remove nil (mapcar 'car-safe org-entities)))
(substring pcomplete-stub 1)))) (substring pcomplete-stub 1))))
(defvar org-todo-keywords-1) (defvar org-todo-keywords-1)
(defun pcomplete/org-mode/todo () (defun pcomplete/org-mode/todo ()
"Complete against known TODO keywords." "Complete against known TODO keywords."
(pcomplete-here (pcomplete-uniqify-list (copy-sequence org-todo-keywords-1)))) (pcomplete-here (pcomplete-uniquify-list (copy-sequence org-todo-keywords-1))))
(defvar org-todo-line-regexp) (defvar org-todo-line-regexp)
(defun pcomplete/org-mode/searchhead () (defun pcomplete/org-mode/searchhead ()
...@@ -315,14 +315,14 @@ This needs more work, to handle headings with lots of spaces in them." ...@@ -315,14 +315,14 @@ This needs more work, to handle headings with lots of spaces in them."
(push (org-make-org-heading-search-string (push (org-make-org-heading-search-string
(match-string-no-properties 3)) (match-string-no-properties 3))
tbl))) tbl)))
(pcomplete-uniqify-list tbl))) (pcomplete-uniquify-list tbl)))
(substring pcomplete-stub 1)))) (substring pcomplete-stub 1))))
(defun pcomplete/org-mode/tag () (defun pcomplete/org-mode/tag ()
"Complete a tag name. Omit tags already set." "Complete a tag name. Omit tags already set."
(while (pcomplete-here (while (pcomplete-here
(mapcar (lambda (x) (concat x ":")) (mapcar (lambda (x) (concat x ":"))
(let ((lst (pcomplete-uniqify-list (let ((lst (pcomplete-uniquify-list
(or (remq (or (remq
nil nil
(mapcar (lambda (x) (org-string-nw-p (car x))) (mapcar (lambda (x) (org-string-nw-p (car x)))
...@@ -339,7 +339,7 @@ This needs more work, to handle headings with lots of spaces in them." ...@@ -339,7 +339,7 @@ This needs more work, to handle headings with lots of spaces in them."
(pcomplete-here (pcomplete-here
(mapcar (lambda (x) (mapcar (lambda (x)
(concat x ": ")) (concat x ": "))
(let ((lst (pcomplete-uniqify-list (let ((lst (pcomplete-uniquify-list
(copy-sequence (copy-sequence
(org-buffer-property-keys nil t t t))))) (org-buffer-property-keys nil t t t)))))
(dolist (prop (org-entry-properties)) (dolist (prop (org-entry-properties))
......
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
(let (cmds) (let (cmds)
(while (re-search-forward "^\\s-+\\([a-z]+\\)" nil t) (while (re-search-forward "^\\s-+\\([a-z]+\\)" nil t)
(setq cmds (cons (match-string 1) cmds))) (setq cmds (cons (match-string 1) cmds)))
(pcomplete-uniqify-list cmds)))) (pcomplete-uniquify-list cmds))))
(defun pcmpl-cvs-modules () (defun pcmpl-cvs-modules ()
"Return a list of available modules under CVS." "Return a list of available modules under CVS."
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
(let (entries) (let (entries)
(while (re-search-forward "\\(\\S-+\\)$" nil t) (while (re-search-forward "\\(\\S-+\\)$" nil t)
(setq entries (cons (match-string 1) entries))) (setq entries (cons (match-string 1) entries)))
(pcomplete-uniqify-list entries)))) (pcomplete-uniquify-list entries))))
(defun pcmpl-cvs-tags (&optional opers) (defun pcmpl-cvs-tags (&optional opers)
"Return all the tags which could apply to the files related to OPERS." "Return all the tags which could apply to the files related to OPERS."
...@@ -149,7 +149,7 @@ ...@@ -149,7 +149,7 @@
(error "Error in output from `cvs status -v'")) (error "Error in output from `cvs status -v'"))
(setq tags (cons (match-string 1) tags)) (setq tags (cons (match-string 1) tags))
(forward-line)))) (forward-line))))
(pcomplete-uniqify-list tags))) (pcomplete-uniquify-list tags)))
(defun pcmpl-cvs-entries (&optional opers) (defun pcmpl-cvs-entries (&optional opers)
"Return the Entries for the current directory. "Return the Entries for the current directory.
...@@ -187,6 +187,6 @@ operation character applies, as displayed by `cvs -n update'." ...@@ -187,6 +187,6 @@ operation character applies, as displayed by `cvs -n update'."
(setq entries (cons text entries)))) (setq entries (cons text entries))))
(forward-line))))) (forward-line)))))
(setq pcomplete-stub nondir) (setq pcomplete-stub nondir)
(pcomplete-uniqify-list entries))) (pcomplete-uniquify-list entries)))
;;; pcmpl-cvs.el ends here ;;; pcmpl-cvs.el ends here
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
(while (re-search-forward (while (re-search-forward
(concat "^\\s-*\\([^\n#%.$][^:=\n]*\\)\\s-*:[^=]") nil t) (concat "^\\s-*\\([^\n#%.$][^:=\n]*\\)\\s-*:[^=]") nil t)
(setq rules (append (split-string (match-string 1)) rules)))) (setq rules (append (split-string (match-string 1)) rules))))
(pcomplete-uniqify-list rules)))) (pcomplete-uniquify-list rules))))
(defcustom pcmpl-gnu-tarfile-regexp (defcustom pcmpl-gnu-tarfile-regexp
"\\.t\\(ar\\(\\.\\(gz\\|bz2\\|Z\\|xz\\)\\)?\\|gz\\|a[zZ]\\|z2\\)\\'" "\\.t\\(ar\\(\\.\\(gz\\|bz2\\|Z\\|xz\\)\\)?\\|gz\\|a[zZ]\\|z2\\)\\'"
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
"Completion for GNU/Linux `kill', using /proc filesystem." "Completion for GNU/Linux `kill', using /proc filesystem."
(if (pcomplete-match "^-\\(.*\\)" 0) (if (pcomplete-match "^-\\(.*\\)" 0)
(pcomplete-here (pcomplete-here
(pcomplete-uniqify-list (pcomplete-uniquify-list
(split-string (split-string
(pcomplete-process-result "kill" "-l"))) (pcomplete-process-result "kill" "-l")))
(pcomplete-match-string 1 0))) (pcomplete-match-string 1 0)))
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
(args (split-string line " "))) (args (split-string line " ")))
(setq points (cons (nth 1 args) points))) (setq points (cons (nth 1 args) points)))
(forward-line))) (forward-line)))
(pcomplete-uniqify-list points)))) (pcomplete-uniquify-list points))))
(defun pcomplete-pare-list (l r) (defun pcomplete-pare-list (l r)
"Destructively remove from list L all elements matching any in list R. "Destructively remove from list L all elements matching any in list R.
...@@ -109,7 +109,7 @@ Test is done using `equal'." ...@@ -109,7 +109,7 @@ Test is done using `equal'."
(setq points (cons (nth 1 args) points))) (setq points (cons (nth 1 args) points)))
(forward-line))) (forward-line)))
(pcomplete-pare-list (pcomplete-pare-list
(pcomplete-uniqify-list points) (pcomplete-uniquify-list points)
(cons "swap" (pcmpl-linux-mounted-directories)))))) (cons "swap" (pcmpl-linux-mounted-directories))))))
;;; pcmpl-linux.el ends here ;;; pcmpl-linux.el ends here
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
(pcomplete-process-result (pcomplete-process-result
"rpm" "-q" (car pkgs) flag))) "rpm" "-q" (car pkgs) flag)))
(setq pkgs (cdr pkgs))) (setq pkgs (cdr pkgs)))
(pcomplete-uniqify-list (cdr provs)))) (pcomplete-uniquifyxo-list (cdr provs))))
(defsubst pcmpl-rpm-files () (defsubst pcmpl-rpm-files ()
(pcomplete-dirs-or-entries "\\.rpm\\'")) (pcomplete-dirs-or-entries "\\.rpm\\'"))
......
...@@ -111,7 +111,7 @@ documentation), this function returns nil." ...@@ -111,7 +111,7 @@ documentation), this function returns nil."
(point))) ":"))) (point))) ":")))
(setq names (cons (nth 0 fields) names))) (setq names (cons (nth 0 fields) names)))
(forward-line)))) (forward-line))))
(pcomplete-uniqify-list names))) (pcomplete-uniquify-list names)))
(defsubst pcmpl-unix-group-names () (defsubst pcmpl-unix-group-names ()
"Read the contents of /etc/group for group names." "Read the contents of /etc/group for group names."
......
...@@ -950,7 +950,7 @@ Arguments NO-GANGING and ARGS-FOLLOW are currently ignored." ...@@ -950,7 +950,7 @@ Arguments NO-GANGING and ARGS-FOLLOW are currently ignored."
(function (function
(lambda (opt) (lambda (opt)
(concat "-" opt))) (concat "-" opt)))
(pcomplete-uniqify-list choices)))) (pcomplete-uniquify-list choices))))
(let ((arg (pcomplete-arg))) (let ((arg (pcomplete-arg)))
(when (and (> (length arg) 1) (when (and (> (length arg) 1)
(stringp arg) (stringp arg)
...@@ -1269,7 +1269,7 @@ If specific documentation can't be given, be generic." ...@@ -1269,7 +1269,7 @@ If specific documentation can't be given, be generic."
;; general utilities ;; general utilities
(defun pcomplete-uniqify-list (l) (defun pcomplete-uniquify-list (l)
"Sort and remove multiples in L." "Sort and remove multiples in L."
(setq l (sort l 'string-lessp)) (setq l (sort l 'string-lessp))
(let ((m l)) (let ((m l))
...@@ -1280,6 +1280,9 @@ If specific documentation can't be given, be generic." ...@@ -1280,6 +1280,9 @@ If specific documentation can't be given, be generic."
(setcdr m (cddr m))) (setcdr m (cddr m)))
(setq m (cdr m)))) (setq m (cdr m))))
l) l)
(define-obsolete-function-alias
'pcomplete-uniqify-list
'pcomplete-uniquify-list "27.1")
(defun pcomplete-process-result (cmd &rest args) (defun pcomplete-process-result (cmd &rest args)
"Call CMD using `call-process' and return the simplest result." "Call CMD using `call-process' and return the simplest result."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment