]> code.delx.au - gnu-emacs/blobdiff - lisp/pcmpl-linux.el
Fix race conditions with MS-Windows lock files by using _sopen.
[gnu-emacs] / lisp / pcmpl-linux.el
index 74a696e7c15cd3add716a3e775281fe9cbfeb94e..7e7bfe287131ac2b389419e7e0155b85d53d890c 100644 (file)
@@ -1,7 +1,8 @@
 ;;; pcmpl-linux.el --- functions for dealing with GNU/Linux completions
 
-;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+;; Copyright (C) 1999-2013 Free Software Foundation, Inc.
+
+;; Package: pcomplete
 
 ;; This file is part of GNU Emacs.
 
@@ -47,9 +48,7 @@
        (pcomplete-match-string 1 0)))
   (while (pcomplete-here
          (if (file-directory-p "/proc")
-             (let ((default-directory "/proc/"))
-               (mapcar 'directory-file-name
-                       (pcomplete-entries "[0-9]+/$"))))
+              (directory-files "/proc" nil "\\`[0-9]+\\'"))
          nil 'identity)))
 
 ;;;###autoload
 (defun pcmpl-linux-fs-types ()
   "Return a list of available fs modules on GNU/Linux systems."
   (let ((kernel-ver (pcomplete-process-result "uname" "-r")))
-    (mapcar
-     (function
-      (lambda (fsobj)
-       (substring fsobj 0 (- (length fsobj) 2))))
-     (let ((default-directory
-            (concat "/lib/modules/" kernel-ver "/fs/")))
-       (pcomplete-entries "\\.o$")))))
+    (directory-files
+     (concat "/lib/modules/" kernel-ver "/kernel/fs/"))))
 
 (defun pcmpl-linux-mounted-directories ()
   "Return a list of mounted directory names."
          (forward-line)))
       (pcomplete-uniqify-list points))))
 
+(defun pcomplete-pare-list (l r)
+  "Destructively remove from list L all elements matching any in list R.
+Test is done using `equal'."
+  (while (and l (and r (member (car l) r)))
+    (setq l (cdr l)))
+  (let ((m l))
+    (while m
+      (while (and (cdr m)
+                 (and r (member (cadr m) r)))
+       (setcdr m (cddr m)))
+      (setq m (cdr m))))
+  l)
+
 (defun pcmpl-linux-mountable-directories ()
   "Return a list of mountable directory names."
   (let (points)
        (pcomplete-uniqify-list points)
        (cons "swap" (pcmpl-linux-mounted-directories))))))
 
-;; arch-tag: bb0961a6-a623-463d-92c6-497c317293b1
 ;;; pcmpl-linux.el ends here