]> code.delx.au - gnu-emacs/blobdiff - lisp/filesets.el
Add 2008 to copyright years.
[gnu-emacs] / lisp / filesets.el
index 4ca5a9d14207b7fb2999584705378d499772604d..afeae05b2b19a635ae3644d097fc9b9822728942 100644 (file)
@@ -1,6 +1,6 @@
 ;;; filesets.el --- handle group of files
 
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: Thomas Link <t.link@gmx.at>
 ;; Maintainer: FSF
@@ -10,7 +10,7 @@
 
 ;; This program 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 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
 ;; any later version.
 
 ;; This program is distributed in the hope that it will be useful,
@@ -162,7 +162,7 @@ COND-FN takes one argument: the current element."
        (setq rv (append rv (list elt)))))))
 
 (defun filesets-ormap (fsom-pred lst)
-  "Return the tail of FSOM-LST for the head of which FSOM-PRED is non-nil."
+  "Return the tail of LST for the head of which FSOM-PRED is non-nil."
   (let ((fsom-lst lst)
        (fsom-rv nil))
     (while (and (not (null fsom-lst))
@@ -539,7 +539,7 @@ computer environments."
   :group 'filesets)
 
 (defcustom filesets-sort-case-sensitive-flag t
-  "*Non-nil means sorting of the filesete menu is case sensitive."
+  "*Non-nil means sorting of the filesets menu is case sensitive."
   :set (function filesets-set-default)
   :type 'boolean
   :group 'filesets)
@@ -1096,7 +1096,6 @@ non-nil, remove all directory names."
 (defun filesets-conditional-sort (lst &optional access-fn simply-do-it)
   "Return a sorted copy of LST, LST being a list of strings.
 If `filesets-sort-menu-flag' is nil, return LST itself.
-
 ACCESS-FN ... function to get the string value of LST's elements.
 
 If SIMPLY-DO-IT is non-nil, the list is sorted regardless of
@@ -1368,7 +1367,7 @@ not be opened."
     (find-file file)))
 
 (defun filesets-find-or-display-file (&optional file viewer)
-  "Visit FILE using an external viewer or open it in an Emacs buffer."
+  "Visit FILE using an external VIEWER or open it in an Emacs buffer."
   (interactive)
   (let* ((file (or file
                   (read-file-name "Find file: " nil nil viewer)))
@@ -1419,24 +1418,24 @@ not be opened."
     something)))
 
 (defun filesets-data-get-name (entry)
-  "Access to `filesets-data'.  Get the entry's name"
+  "Access to `filesets-data'.  Get the ENTRY's name."
   (car entry))
 
 (defun filesets-data-get-data (entry)
-  "Access to `filesets-data'.  Get the entry's data section"
+  "Access to `filesets-data'.  Get the ENTRY's data section."
   (cdr entry))
 
 (defun filesets-alist-get (alist key &optional default carp)
   "Get KEY's value in the association list ALIST.
 Return DEFAULT if not found.  Return (car VALUE) if CARP is non-nil."
-  (let* ((elt (assoc key alist)))
+  (let ((elt (assoc key alist)))
     (cond
-     (elt
-      (if carp
-         (cadr elt)
-       (cdr elt)))
-     (default default)
-     (t nil))))
+      (elt
+       (if carp
+          (cadr elt)
+        (cdr elt)))
+      (default default)
+      (t nil))))
 
 (defun filesets-data-get (entry key &optional default carp)
   "Extract the value for KEY in the data part of fileset ENTRY.
@@ -1444,7 +1443,7 @@ Return DEFAULT if not found.  Return (car VALUE) if CARP is non-nil."
   (filesets-alist-get (filesets-data-get-data entry) key default carp))
 
 (defun filesets-data-set (entry key value)
-  "Set the value for KEY in the data part of fileset ENTRY."
+  "Set the VALUE for KEY in the data part of fileset ENTRY."
   (let* ((alist (filesets-data-get-data entry))
         (elt (assoc key alist)))
     (if elt
@@ -1603,7 +1602,7 @@ Replace <file-name> or <<file-name>> with filename."
                      ((equal arg "<file-name>")
                       (buffer-file-name))
                      ((equal arg "<<file-name>>")
-                      (filesets-quote (buffer-file-name)))
+                      (shell-quote-argument (buffer-file-name)))
                      (t
                       arg))))
 
@@ -1671,9 +1670,9 @@ Replace <file-name> or <<file-name>> with filename."
               filesets-commands)))
 
 
-;;; sampe commands
+;;; sample commands
 (defun filesets-cmd-query-replace-getargs ()
-  "Get arguments for `filesets-cmd-query-replace'."
+  "Get arguments for `query-replace' and `query-replace-regexp'."
   (let* ((from-string (read-string "Filesets query replace: "
                                   ""
                                   'query-replace-history))
@@ -1701,7 +1700,7 @@ Replace <file-name> or <<file-name>> with filename."
                  ok)
              t)))
     (when ok
-      (let ((cmd (format txt (buffer-file-name))))
+      (let ((cmd (format txt (shell-quote-argument (buffer-file-name)))))
        (message "Filesets: %s" cmd)
        (filesets-cmd-show-result cmd
                                  (shell-command-to-string cmd))))))
@@ -1798,7 +1797,7 @@ User will be queried, if no fileset name is provided."
                      filesets-data nil)))
          (entry  (or (assoc name filesets-data)
                      (when (y-or-n-p
-                            (format "Fileset %s does not exist. Create it?"
+                            (format "Fileset %s does not exist. Create it? "
                                     name))
                        (progn
       (add-to-list 'filesets-data (list name '(:files)))
@@ -1880,7 +1879,7 @@ User will be queried, if no fileset name is provided."
   (browse-url filesets-homepage))
 
 (defun filesets-remake-shortcut (count submenu)
-  "Remake a submenus shortcut when wrapping long menus."
+  "Remake a submenu's shortcut when wrapping long menus."
   (let* ((name (concat (filesets-get-shortcut count)
                       (substring (elt submenu 0) 2))))
     (if (listp submenu)
@@ -2037,7 +2036,7 @@ LOOKUP-NAME is used as lookup name for retrieving fileset specific settings."
          (lax-plist-put filesets-ingroup-cache emaster this))))
 
 (defun filesets-ingroup-collect-files (fs &optional remdupl-flag master depth)
-  "Helper function for `filesets-ingroup-collect'. Collect file names."
+  "Helper function for `filesets-ingroup-collect'.  Collect file names."
   (let* ((master       (or master
                           (filesets-entry-get-master fs)))
         (remdupl-flag (or remdupl-flag
@@ -2151,7 +2150,7 @@ FS is a fileset's name. FLIST is a list returned by
                          `([,nm (filesets-file-open nil ',master ',fsn)])))))))))
 
 (defun filesets-ingroup-collect (fs remdupl-flag master &optional depth)
-  "Collect names of included files & build submenu."
+  "Collect names of included files and build submenu."
   (filesets-ingroup-cache-put master nil)
   (filesets-message 2 "Filesets: parsing %S" master)
   (filesets-ingroup-collect-build-menu