in light of these new realizations, i'm attaching a new allout patch
and changelog.  reiner, i really like the compromise of using the
simple predicates for safe-local-variable property qualifiers, when
available, and falling back to the lambdas when they're not.  this
patch includes changes that do that, and also has yet another minor
allout fix.
--
ken
http://myriadicity.net


On 5/15/06, Reiner Steib <[EMAIL PROTECTED]> wrote:
[ Johan didn't cc you on his reply, and I forgot to add you:
  Cf. http://thread.gmane.org/gmane.emacs.pretest.bugs/12009/focus=12023 ]

On Sun, May 14 2006, Johan Bockgård wrote:

> Reiner Steib <[EMAIL PROTECTED]> writes:
>
>> Emacs 21 doesn't look at the safe-local-variable property at all.
>
> It does.

Thanks for the correction.  If `allout.el' wants to be compatible with
Emacs 21, also `string-or-null-p' shouldn't be used.

Or `booleanp' and `string-or-null-p' might be conditionally, e.g.:

(put 'TeX-PDF-mode 'safe-local-variable (if (fboundp 'booleanp)
                                            'booleanp
                                          '(lambda (x) (memq x '(nil t)))))
2006-05-11  Ken Manheimer  <[EMAIL PROTECTED]>

        * allout.el: (allout-view-change-hook): Marked as being deprecated,
        to be replaced by `allout-exposure-change-hook'.  Both are now
        respected, for the meanwhile.
        (allout-exposure-change-hook): New, an alternative to
        `allout-view-change-hook' which will eventually replace it.
        (allout-flag-region): Run new hook `allout-exposure-change-hook',
        in addition to `allout-view-change-hook'.
        (allout-current-topic-collapsed-p): Do the right thing regarding
        trailing blank lines.
        (allout-show-bodies, allout-old-style-prefixes)
        (allout-stylish-prefixes, allout-use-hanging-indents): Quote the
        lambda forms to prevent their showing up in variable help
        presentations as inscrutable byte-compiled code.
        (allout-numbered-bullet, allout-file-xref-bullet, allout-layout):
        Use string-or-null-p to qualify safe-local-variable values.
        (allout-reindent-bodies): Use memq to qualify matches against
        valid safe-local-variable values.  Also, quote the lambda as above.
        (allout-use-mode-specific-leader): Add missing candidate-value
        symbols, use memq, and quote the lambda.
        (allout-overlay-interior-modification-handler): Remove unused
        variables `msg' and 'opened'.
        (allout-hidden-p): Constrain invisibility consideration to allout's
        invisibility spec, disregarding invisibility for other reasons.







Index: allout.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/allout.el,v
retrieving revision 1.75
diff -u -u -r1.75 allout.el
--- allout.el   12 May 2006 15:45:09 -0000      1.75
+++ allout.el   15 May 2006 18:17:48 -0000
@@ -6,7 +6,7 @@
 ;; Author: Ken Manheimer <ken dot manheimer at gmail dot com>
 ;; Maintainer: Ken Manheimer <ken dot manheimer at gmail dot com>
 ;; Created: Dec 1991 - first release to usenet
-;; Version: 2.2.1
+;; Version: 2.2.1 ($Revision: 1.143 $)
 ;; Keywords: outlines wp languages
 
 ;; This file is part of GNU Emacs.
@@ -199,7 +199,7 @@
 (make-variable-buffer-local 'allout-show-bodies)
 ;;;###autoload
 (put 'allout-show-bodies 'safe-local-variable
-     '(lambda (x) (member x '(t nil))))
+     (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil)))))
 
 ;;;_  = allout-header-prefix
 (defcustom allout-header-prefix "."
@@ -345,7 +345,7 @@
 (make-variable-buffer-local 'allout-old-style-prefixes)
 ;;;###autoload
 (put 'allout-old-style-prefixes 'safe-local-variable
-     '(lambda (x) (member x '(t nil))))
+     (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil)))))
 ;;;_  = allout-stylish-prefixes - alternating bullets
 (defcustom allout-stylish-prefixes t
   "*Do fancy stuff with topic prefix bullets according to level, etc.
@@ -394,7 +394,7 @@
 (make-variable-buffer-local 'allout-stylish-prefixes)
 ;;;###autoload
 (put 'allout-stylish-prefixes 'safe-local-variable
-     '(lambda (x) (member x '(t nil))))
+     (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil)))))
 
 ;;;_  = allout-numbered-bullet
 (defcustom allout-numbered-bullet "#"
@@ -408,7 +408,10 @@
   :group 'allout)
 (make-variable-buffer-local 'allout-numbered-bullet)
 ;;;###autoload
-(put 'allout-numbered-bullet 'safe-local-variable 'string-or-null-p)
+(put 'allout-numbered-bullet 'safe-local-variable
+     (if (fboundp 'string-or-null-p)
+         'string-or-null-p
+       '(lambda (x) (or (stringp x) (null x)))))
 ;;;_  = allout-file-xref-bullet
 (defcustom allout-file-xref-bullet "@"
   "*Bullet signifying file cross-references, for `allout-resolve-xref'.
@@ -417,7 +420,10 @@
   :type '(choice (const nil) string)
   :group 'allout)
 ;;;###autoload
-(put 'allout-file-xref-bullet 'safe-local-variable 'string-or-null-p)
+(put 'allout-file-xref-bullet 'safe-local-variable
+     (if (fboundp 'string-or-null-p)
+         'string-or-null-p
+       '(lambda (x) (or (stringp x) (null x)))))
 ;;;_  = allout-presentation-padding
 (defcustom allout-presentation-padding 2
   "*Presentation-format white-space padding factor, for greater indent."
@@ -620,7 +626,7 @@
 (make-variable-buffer-local 'allout-use-hanging-indents)
 ;;;###autoload
 (put 'allout-use-hanging-indents 'safe-local-variable
-     '(lambda (x) (member x '(t nil))))
+     (if (fboundp 'booleanp) 'booleanp '(lambda (x) (member x '(t nil)))))
 
 ;;;_  = allout-reindent-bodies
 (defcustom allout-reindent-bodies (if allout-use-hanging-indents
@@ -663,7 +669,7 @@
 ;;;_ #1 Internal Outline Formatting and Configuration
 ;;;_  : Version
 ;;;_   = allout-version
-(defvar allout-version "2.2.1"
+(defvar allout-version "2.2.1 ($Revision: 1.143 $)"
   "Version of currently loaded outline package.  \(allout.el)")
 ;;;_   > allout-version
 (defun allout-version (&optional here)
@@ -1067,14 +1073,14 @@
   "*\(Deprecated\)  Hook that's run after allout outline exposure changes.
 
 Switch to using `allout-exposure-change-hook' instead.  Both
-variables are currently used if populated, but this one will be
-ignored in a subsequent allout version.")
+variables are currently respected, but this one will be ignored
+in a subsequent allout version.")
 ;;;_   = allout-exposure-change-hook
 (defvar allout-exposure-change-hook nil
   "*Hook that's run after allout outline exposure changes.
 
 This variable will replace `allout-view-change-hook' in a subsequent allout
-version, though both are currently checked and used, if populated.")
+version, though both are currently respected.")
 
 ;;;_   = allout-outside-normal-auto-fill-function
 (defvar allout-outside-normal-auto-fill-function nil
@@ -1761,8 +1767,6 @@
     (let ((start (point))
           (ol-start (overlay-start ol))
           (ol-end (overlay-end ol))
-          (msg "Change within concealed text disallowed.")
-          opened
           first)
       (goto-char beg)
       (while (< (point) end)
@@ -1772,7 +1776,6 @@
               (save-excursion (forward-char 1)
                               (allout-show-to-offshoot)))
           (when (not first)
-            (setq opened t)
             (setq first (point))))
         (goto-char (if (featurep 'xemacs)
                        (next-property-change (1+ (point)) nil end)
@@ -4008,17 +4011,18 @@
 (defun allout-current-topic-collapsed-p (&optional include-single-liners)
   "True if the currently visible containing topic is already collapsed.
 
-If optional INCLUDE-SINGLE-LINERS is true, then include single-line
-topics \(which intrinsically can be considered both collapsed and
-not\), as collapsed.  Otherwise they are considered uncollapsed."
+Single line topics intrinsically can be considered as being both
+collapsed and uncollapsed.  If optional INCLUDE-SINGLE-LINERS is
+true, then single-line topics are considered to be collapsed.  By
+default, they are treated as being uncollapsed."
   (save-excursion
-      (and
-       (= (progn (allout-back-to-current-heading)
-                 (move-end-of-line 1)
-                 (point))
-          (allout-end-of-current-subtree))
-       (or include-single-liners
-           (progn (backward-char 1) (allout-hidden-p))))))
+    (and
+     (= (progn (allout-back-to-current-heading)
+               (move-end-of-line 1)
+               (point))
+        (allout-end-of-current-subtree (not (looking-at "\n\n"))))
+     (or include-single-liners
+         (progn (backward-char 1) (allout-hidden-p))))))
 ;;;_   > allout-hide-current-subtree (&optional just-close)
 (defun allout-hide-current-subtree (&optional just-close)
   "Close the current topic, or containing topic if this one is already closed.
_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to