X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/f67e15be8d94718b2e2ea7da68eb0b2dc94ce016..a7e302dc1dc18770aaf9eeedfd638f73b574bc19:/lisp/pcmpl-linux.el diff --git a/lisp/pcmpl-linux.el b/lisp/pcmpl-linux.el index 69d48a7bde..3cb38b95c7 100644 --- a/lisp/pcmpl-linux.el +++ b/lisp/pcmpl-linux.el @@ -1,14 +1,15 @@ ;;; 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-2016 Free Software Foundation, Inc. + +;; Package: pcomplete ;; This file is part of GNU Emacs. -;; GNU Emacs is free software; you can redistribute it and/or modify +;; GNU Emacs is free software: you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 3, or (at your option) -;; any later version. +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. ;; GNU Emacs is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -16,9 +17,7 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GNU Emacs. If not, see . ;;; Commentary: @@ -32,9 +31,10 @@ (require 'pcomplete) -(defgroup pcmpl-linux nil - "Functions for dealing with GNU/Linux completions." - :group 'pcomplete) +;; Unused. +;;; (defgroup pcmpl-linux nil +;;; "Functions for dealing with GNU/Linux completions." +;;; :group 'pcomplete) ;; Functions: @@ -49,9 +49,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 @@ -70,13 +68,8 @@ (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." @@ -91,6 +84,19 @@ (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) @@ -106,5 +112,4 @@ (pcomplete-uniqify-list points) (cons "swap" (pcmpl-linux-mounted-directories)))))) -;; arch-tag: bb0961a6-a623-463d-92c6-497c317293b1 ;;; pcmpl-linux.el ends here