emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 615c15f: Use lexical-binding in pcmpl-unix.el


From: Stefan Kangas
Subject: master 615c15f: Use lexical-binding in pcmpl-unix.el
Date: Wed, 2 Sep 2020 10:38:27 -0400 (EDT)

branch: master
commit 615c15fd859b94e9d28d2424674b7e43aa3149a5
Author: Stefan Kangas <stefankangas@gmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>

    Use lexical-binding in pcmpl-unix.el
    
    * lisp/pcmpl-unix.el: Use lexical-binding.
    (pcmpl-ssh-known-hosts, pcmpl-ssh-config-hosts, pcmpl-ssh-hosts):
    Adjust for lexical-binding.
---
 lisp/pcmpl-unix.el | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/lisp/pcmpl-unix.el b/lisp/pcmpl-unix.el
index f1c8725..822f6f3 100644
--- a/lisp/pcmpl-unix.el
+++ b/lisp/pcmpl-unix.el
@@ -1,4 +1,4 @@
-;;; pcmpl-unix.el --- standard UNIX completions
+;;; pcmpl-unix.el --- standard UNIX completions  -*- lexical-binding:t -*-
 
 ;; Copyright (C) 1999-2020 Free Software Foundation, Inc.
 
@@ -155,12 +155,14 @@ documentation), this function returns nil."
       (let ((host-re 
"\\(?:\\([-.[:alnum:]]+\\)\\|\\[\\([-.[:alnum:]]+\\)\\]:[0-9]+\\)[, ]")
             ssh-hosts-list)
         (while (re-search-forward (concat "^ *" host-re) nil t)
-          (add-to-list 'ssh-hosts-list (concat (match-string 1)
-                                               (match-string 2)))
+          (push (concat (match-string 1)
+                        (match-string 2))
+                ssh-hosts-list)
           (while (and (eq (char-before) ?,)
                       (re-search-forward host-re (line-end-position) t))
-            (add-to-list 'ssh-hosts-list (concat (match-string 1)
-                                                 (match-string 2)))))
+            (push  (concat (match-string 1)
+                           (match-string 2))
+                   ssh-hosts-list)))
         ssh-hosts-list))))
 
 (defun pcmpl-ssh-config-hosts ()
@@ -173,7 +175,7 @@ documentation), this function returns nil."
             (case-fold-search t))
         (while (re-search-forward "^ *host\\(name\\)? +\\([-.[:alnum:]]+\\)"
                                   nil t)
-          (add-to-list 'ssh-hosts-list (match-string 2)))
+          (push (match-string 2) ssh-hosts-list))
         ssh-hosts-list))))
 
 (defun pcmpl-ssh-hosts ()
@@ -181,7 +183,7 @@ documentation), this function returns nil."
 Uses both `pcmpl-ssh-config-file' and `pcmpl-ssh-known-hosts-file'."
   (let ((hosts (pcmpl-ssh-known-hosts)))
     (dolist (h (pcmpl-ssh-config-hosts))
-      (add-to-list 'hosts h))
+      (push h hosts))
     hosts))
 
 ;;;###autoload



reply via email to

[Prev in Thread] Current Thread [Next in Thread]