* progmodes/sh-script.el (sh-mode): Use define-derived-mode.
[bpt/emacs.git] / lisp / files-x.el
index f7be79e..096f302 100644 (file)
@@ -1,6 +1,6 @@
 ;;; 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
@@ -49,6 +49,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 +69,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 +91,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.