From 5926f0c02402acb9de6c44f0b4155456aebdc981 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 11 Mar 2021 13:10:13 -0500 Subject: [PATCH] * lisp/obsolete/iswitchb.el: Remove dead code (most-len, most-is-exact): Delete vars. (iswitchb-output-completion): Delete function. (iswitchb-completions): Delete dead code consequence of `most` being nil. --- lisp/obsolete/iswitchb.el | 33 ++++----------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/lisp/obsolete/iswitchb.el b/lisp/obsolete/iswitchb.el index a7fd6ccb5f5..a9bc6ef0711 100644 --- a/lisp/obsolete/iswitchb.el +++ b/lisp/obsolete/iswitchb.el @@ -1158,18 +1158,6 @@ Copied from `icomplete-exhibit' with two changes: (insert (iswitchb-completions contents)))))) -(defvar most-len) -(defvar most-is-exact) - -(defun iswitchb-output-completion (com) - (if (= (length com) most-len) - ;; Most is one exact match, - ;; note that and leave out - ;; for later indication: - (ignore - (setq most-is-exact t)) - (substring com most-len))) - (defun iswitchb-completions (name) "Return the string that is displayed after the user's text. Modified from `icomplete-completions'." @@ -1260,16 +1248,11 @@ Modified from `icomplete-completions'." (nreverse res)) (list "...") (nthcdr (- (length comps) - (/ iswitchb-max-to-show 2)) comps)))) + (/ iswitchb-max-to-show 2)) + comps)))) (let* ( - ;;(most (try-completion name candidates predicate)) - (most nil) - (most-len (length most)) - most-is-exact (alternatives - (mapconcat (if most #'iswitchb-output-completion - #'identity) - comps iswitchb-delim))) + (mapconcat #'identity comps iswitchb-delim))) (concat @@ -1283,17 +1266,9 @@ Modified from `icomplete-completions'." close-bracket-determined)) ;; end of partial matches... - ;; think this bit can be ignored. - (and (> most-len (length name)) - (concat open-bracket-determined - (substring most (length name)) - close-bracket-determined)) - ;; list all alternatives open-bracket-prospects - (if most-is-exact - (concat iswitchb-delim alternatives) - alternatives) + alternatives close-bracket-prospects)))))) (defun iswitchb-minibuffer-setup () -- 2.39.2