]> code.delx.au - gnu-emacs/commitdiff
* subr.el (string-or-null-p): New function.
authorReiner Steib <Reiner.Steib@gmx.de>
Thu, 6 Apr 2006 19:20:38 +0000 (19:20 +0000)
committerReiner Steib <Reiner.Steib@gmx.de>
Thu, 6 Apr 2006 19:20:38 +0000 (19:20 +0000)
* textmodes/paragraphs.el (sentence-end): Use string-or-null-p.

* textmodes/ispell.el (ispell-local-dictionary): Use
string-or-null-p.

* files.el: Update comment about safe-local-variable declarations.

lisp/ChangeLog
lisp/files.el
lisp/subr.el
lisp/textmodes/ispell.el
lisp/textmodes/paragraphs.el

index a0d8e64a1fc2a9af917c64020ac6d86b742fb673..f914e5dbc487c7296fe418b4566ecb5045da03e0 100644 (file)
@@ -1,3 +1,14 @@
+2006-04-06  Reiner Steib  <Reiner.Steib@gmx.de>
+
+       * subr.el (string-or-null-p): New function.
+
+       * textmodes/paragraphs.el (sentence-end): Use string-or-null-p.
+
+       * textmodes/ispell.el (ispell-local-dictionary): Use
+       string-or-null-p.
+
+       * files.el: Update comment about safe-local-variable declarations.
+
 2006-04-06  J.D. Smith  <jdsmith@as.arizona.edu>
 
        * progmodes/idlwave.el: Updated to IDLWAVE version 6.0.  See
index 7ab7d593e4cc5a0301d3552558f0b39632c5eb16..2ca497e09b180e3cb577b899e7ae7ae6c9bc7bf3 100644 (file)
@@ -2322,13 +2322,22 @@ asking you for confirmation."
 
 ;; Safe local variables:
 ;;
-;; For variables defined by minor modes, put the safety declarations
-;; here, not in the file defining the minor mode (when Emacs visits a
-;; file specifying that local variable, the minor mode file may not be
-;; loaded yet).  For variables defined by major modes, the safety
-;; declarations can go into the major mode's file, since that will be
-;; loaded before file variables are processed.
+;; For variables defined by major modes, the safety declarations can go into
+;; the major mode's file, since that will be loaded before file variables are
+;; processed.
+;;
+;; For variables defined by minor modes, put the safety declarations in the
+;; file defining the minor mode after the defcustom/defvar using an autoload
+;; cookie, e.g.:
+;;
+;;   ;;;###autoload(put 'variable 'safe-local-variable 'stringp)
+;;
+;; Otherwise, when Emacs visits a file specifying that local variable, the
+;; minor mode file may not be loaded yet.
+;;
+;; For variables defined in the C source code the declaration should go here:
 
+;; FIXME: Some variables should be moved according to the rules above.
 (let ((string-or-null (lambda (a) (or (stringp a) (null a)))))
   (eval
    `(mapc (lambda (pair)
@@ -2340,15 +2349,15 @@ asking you for confirmation."
            (c-file-style       .  stringp)
            (c-indent-level     .  integerp)
            (comment-column     .  integerp)
-           (compile-command    . ,string-or-null)
+           (compile-command    .  string-or-null-p)
            (fill-column        .  integerp)
-           (fill-prefix        . ,string-or-null)
+           (fill-prefix        .  string-or-null-p)
            (indent-tabs-mode   .  t)
            (kept-new-versions  .  integerp)
            (left-margin        .  t)
            (no-byte-compile    .  t)
            (no-update-autoloads . t)
-           (outline-regexp     . ,string-or-null)
+           (outline-regexp     .  string-or-null-p)
            (tab-width          .  integerp) ;; C source code
            (truncate-lines     .  t) ;; C source code
            (version-control    .  t)))))
index f515b6b37533416060ed727588c87ab3e1b0704c..9aba619581603f81e08d84e215c7299c1f8324cf 100644 (file)
@@ -1916,6 +1916,12 @@ a system-dependent default device name is used."
                                 "\\" (substring argument end (1+ end)))
                  start (1+ end)))
          (concat result (substring argument start)))))))
+
+(defun string-or-null-p (object)
+  "Return t if OBJECT is a string or nil.
+Otherwise, return nil."
+  (or (stringp object) (null object)))
+
 \f
 ;;;; Support for yanking and text properties.
 
index 8a08f9dd07879e2432e348c468b3800e827d4f11..da77508dce3ec6bb8ff01a0670de22494cc9b3ba 100644 (file)
@@ -462,7 +462,7 @@ is automatically set when defined in the file with either
   :type '(choice string
                 (const :tag "default" nil))
   :group 'ispell)
-;;;###autoload(put 'ispell-local-dictionary 'safe-local-variable (lambda (a) (or (stringp a) (null a))))
+;;;###autoload(put 'ispell-local-dictionary 'safe-local-variable 'string-or-null-p)
 
 (make-variable-buffer-local 'ispell-local-dictionary)
 
index c62f337e456e061755a2a29362fd60e370118e41..6693be4e0c94d7e1b8beee1b0182d493550ee25c 100644 (file)
@@ -163,7 +163,7 @@ function `sentence-end'.  You should always use this function
 to obtain the value of this variable."
   :group 'paragraphs
   :type '(choice regexp (const :tag "Use default value" nil)))
-;;;###autoload(put 'sentence-end 'safe-local-variable (lambda (a) (or (stringp a) (null a))))
+;;;###autoload(put 'sentence-end 'safe-local-variable 'string-or-null-p)
 
 (defcustom sentence-end-base "[.?!][]\"'\e$B!I\e$,1r}\e(B)}]*"
   "*Regexp matching the basic end of a sentence, not including following space."