]> code.delx.au - gnu-emacs/blobdiff - lisp/files-x.el
* net/tramp.el (tramp-handle-directory-files-and-attributes)
[gnu-emacs] / lisp / files-x.el
index c120c646e66010ccd3bbbb9558d1e0fb77ad8db9..222141bd357b8cc8b5aa49565ef7e826ba6ed5f8 100644 (file)
@@ -1,10 +1,11 @@
 ;;; files-x.el --- extended file handling commands
 
-;; Copyright (C) 2009 Free Software Foundation, Inc.
+;; Copyright (C) 2009, 2010 Free Software Foundation, Inc.
 
 ;; Author: Juri Linkov <juri@jurta.org>
 ;; Maintainer: FSF
 ;; Keywords: files
+;; Package: emacs
 
 ;; This file is part of GNU Emacs.
 
@@ -49,6 +50,7 @@ Intended to be used in the `interactive' spec of
           obarray
           (lambda (sym)
             (or (user-variable-p sym)
+                 (get sym 'safe-local-variable)
                 (memq sym '(mode eval coding unibyte))))
           nil nil nil default nil))
     (and (stringp variable) (intern variable))))
@@ -68,8 +70,7 @@ Intended to be used in the `interactive' spec of
               (format "Add %s with value: " variable))
             obarray
             (lambda (sym)
-              (and (string-match-p "-mode\\'" (symbol-name sym))
-                   (not (string-match-p "-minor-mode\\'" (symbol-name sym)))))
+              (string-match-p "-mode\\'" (symbol-name sym)))
             nil nil nil default nil))
       (and (stringp value)
           (intern (replace-regexp-in-string "-mode\\'" "" value))))
@@ -91,7 +92,8 @@ Intended to be used in the `interactive' spec of
                         nil 'set-variable-value-history
                         (format "%S"
                                 (cond ((eq variable 'unibyte) t)
-                                      (t (symbol-value variable))))))))))
+                                      ((boundp variable)
+                                       (symbol-value variable))))))))))
 
 (defun read-file-local-variable-mode ()
   "Read per-directory file-local variable's mode using completion.
@@ -354,7 +356,7 @@ If .dir-locals.el was not found and OP is not `delete' then create
 this file in the current directory.
 
 If OP is `delete' then delete all existing settings of VARIABLE
-from the the MODE alist ignoring the input argument VALUE."
+from the MODE alist ignoring the input argument VALUE."
   (catch 'exit
     (unless enable-local-variables
       (throw 'exit (message "Directory-local variables are disabled")))
@@ -450,7 +452,7 @@ from the the MODE alist ignoring the input argument VALUE."
 
 ;;;###autoload
 (defun copy-dir-locals-to-file-locals-prop-line ()
-  "Copy directory-local variables to the the -*- line."
+  "Copy directory-local variables to the -*- line."
   (interactive)
   (dolist (elt dir-local-variables-alist)
     (add-file-local-variable-prop-line (car elt) (cdr elt))))
@@ -458,4 +460,6 @@ from the the MODE alist ignoring the input argument VALUE."
 \f
 
 (provide 'files-x)
+
+;; arch-tag: 949d263c-30a8-4b49-af26-cda97c7c5477
 ;;; files-x.el ends here