# HG changeset patch # User Reiner Steib # Date 1144351238 0 # Node ID 196122ba0b05a517320424b9f1f8483bfa0fb950 # Parent 4341d4876712953db0717cc072422714288433c3 * 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. diff -r 4341d4876712 -r 196122ba0b05 lisp/ChangeLog --- a/lisp/ChangeLog Thu Apr 06 19:12:13 2006 +0000 +++ b/lisp/ChangeLog Thu Apr 06 19:20:38 2006 +0000 @@ -1,3 +1,14 @@ +2006-04-06 Reiner Steib + + * 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 * progmodes/idlwave.el: Updated to IDLWAVE version 6.0. See diff -r 4341d4876712 -r 196122ba0b05 lisp/files.el --- a/lisp/files.el Thu Apr 06 19:12:13 2006 +0000 +++ b/lisp/files.el Thu Apr 06 19:20:38 2006 +0000 @@ -2322,13 +2322,22 @@ ;; 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 @@ (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))))) diff -r 4341d4876712 -r 196122ba0b05 lisp/subr.el --- a/lisp/subr.el Thu Apr 06 19:12:13 2006 +0000 +++ b/lisp/subr.el Thu Apr 06 19:20:38 2006 +0000 @@ -1916,6 +1916,12 @@ "\\" (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))) + ;;;; Support for yanking and text properties. diff -r 4341d4876712 -r 196122ba0b05 lisp/textmodes/ispell.el --- a/lisp/textmodes/ispell.el Thu Apr 06 19:12:13 2006 +0000 +++ b/lisp/textmodes/ispell.el Thu Apr 06 19:20:38 2006 +0000 @@ -462,7 +462,7 @@ :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) diff -r 4341d4876712 -r 196122ba0b05 lisp/textmodes/paragraphs.el --- a/lisp/textmodes/paragraphs.el Thu Apr 06 19:12:13 2006 +0000 +++ b/lisp/textmodes/paragraphs.el Thu Apr 06 19:20:38 2006 +0000 @@ -163,7 +163,7 @@ 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 "[.?!][]\"'$B!I$,1r}(B)}]*" "*Regexp matching the basic end of a sentence, not including following space."