From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Ken Manheimer" Newsgroups: gmane.emacs.devel Subject: Re: allout patch - more safe-local-variables, plus autoloads Date: Mon, 24 Apr 2006 17:19:17 -0400 Message-ID: <2cd46e7f0604241419w1dd12a65qa6513ea0da7a9c5d@mail.gmail.com> References: <2cd46e7f0604171211s5ef0e820gebc4e68b2ce2606d@mail.gmail.com> <8764l7m40w.fsf-monnier+emacs@gnu.org> <87r73uji3b.fsf-monnier+emacs@gnu.org> <87u08oqhq3.fsf-monnier+emacs@gnu.org> <2cd46e7f0604210802t28837d4r7aef3d3231a26ea3@mail.gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_2646_22954113.1145913557489" X-Trace: sea.gmane.org 1145913593 14734 80.91.229.2 (24 Apr 2006 21:19:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 24 Apr 2006 21:19:53 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 24 23:19:49 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FY8T6-0005qe-4L for ged-emacs-devel@m.gmane.org; Mon, 24 Apr 2006 23:19:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FY8T5-0005Kr-9y for ged-emacs-devel@m.gmane.org; Mon, 24 Apr 2006 17:19:39 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FY8Sp-0005J9-Q6 for emacs-devel@gnu.org; Mon, 24 Apr 2006 17:19:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FY8Sm-0005I7-KY for emacs-devel@gnu.org; Mon, 24 Apr 2006 17:19:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FY8Sm-0005I4-ES for emacs-devel@gnu.org; Mon, 24 Apr 2006 17:19:20 -0400 Original-Received: from [64.233.182.191] (helo=nproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FY8V5-0006JW-NZ for emacs-devel@gnu.org; Mon, 24 Apr 2006 17:21:44 -0400 Original-Received: by nproxy.gmail.com with SMTP id i2so879396nfe for ; Mon, 24 Apr 2006 14:19:18 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=qXNuWOoxO6MphgdQkTTBtaSDradmeHYMdYYZaYyu+0iCwrk0vOLPwvb+PdzdRLZ5TacWqjWnozKL6pHChVPm11KEaVXF9MUrKKVjyx9HvacIpTwaoyHav5BrxECnOn7HXG9qeZT8zd1SohzIBOW8K9XXFTM3DZUFyVlLG+QF2p4= Original-Received: by 10.48.4.6 with SMTP id 6mr3094644nfd; Mon, 24 Apr 2006 14:19:18 -0700 (PDT) Original-Received: by 10.49.51.17 with HTTP; Mon, 24 Apr 2006 14:19:17 -0700 (PDT) Original-To: emacs-devel@gnu.org In-Reply-To: X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:53356 Archived-At: ------=_Part_2646_22954113.1145913557489 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline this is yet another version of a patch (and ChangeLog) for allout.el which provides appropriate safe-local-variable settings. this patch differs from the prior ones in two ways: - it does not use `t' for the safe-local-variables property value, in anticipation the this feature may become obsolete - rectifies a bug in backward-compat move-{beginning,end}-of-line functio= ns for emacs versions that lack them this should supercede any other versions of the patch, and hopefully will obviate the need for further patches if/when the safe-local-variables value policy changes. -- ken manheimer ken.manheimer@gmail.com http://myriadicity.net ------=_Part_2646_22954113.1145913557489 Content-Type: text/plain; name=allout-patch.txt; charset=us-ascii Content-Transfer-Encoding: 7bit X-Attachment-Id: f_emfb7sy0 Content-Disposition: attachment; filename="allout-patch.txt" Index: allout.el =================================================================== RCS file: /sources/emacs/emacs/lisp/allout.el,v retrieving revision 1.71 diff -u -u -r1.71 allout.el --- allout.el 13 Apr 2006 10:44:37 -0000 1.71 +++ allout.el 24 Apr 2006 19:55:04 -0000 @@ -84,8 +84,6 @@ (require 'pgg-gpg) (require 'overlay) )) -(autoload 'pgg-gpg-symmetric-key-p "pgg-gpg" - "True if decoded armor MESSAGE-KEYS has symmetric encryption indicator.") ;;;_* USER CUSTOMIZATION VARIABLES: @@ -199,6 +197,9 @@ :type 'boolean :group 'allout) (make-variable-buffer-local 'allout-show-bodies) +;;;###autoload +(put 'allout-show-bodies 'safe-local-variable + (lambda (x) (member x '(t nil)))) ;;;_ = allout-header-prefix (defcustom allout-header-prefix "." @@ -212,6 +213,8 @@ :type 'string :group 'allout) (make-variable-buffer-local 'allout-header-prefix) +;;;###autoload +(put 'allout-header-prefix 'safe-local-variable 'stringp) ;;;_ = allout-primary-bullet (defcustom allout-primary-bullet "*" "Bullet used for top-level outline topics. @@ -227,6 +230,8 @@ :type 'string :group 'allout) (make-variable-buffer-local 'allout-primary-bullet) +;;;###autoload +(put 'allout-primary-bullet 'safe-local-variable 'stringp) ;;;_ = allout-plain-bullets-string (defcustom allout-plain-bullets-string ".," "*The bullets normally used in outline topic prefixes. @@ -241,6 +246,8 @@ :type 'string :group 'allout) (make-variable-buffer-local 'allout-plain-bullets-string) +;;;###autoload +(put 'allout-plain-bullets-string 'safe-local-variable 'stringp) ;;;_ = allout-distinctive-bullets-string (defcustom allout-distinctive-bullets-string "*+-=>()[{}&!?#%\"X@$~_\\:;^" "*Persistent outline header bullets used to distinguish special topics. @@ -274,6 +281,8 @@ :type 'string :group 'allout) (make-variable-buffer-local 'allout-distinctive-bullets-string) +;;;###autoload +(put 'allout-distinctive-bullets-string 'safe-local-variable 'stringp) ;;;_ = allout-use-mode-specific-leader (defcustom allout-use-mode-specific-leader t @@ -292,7 +301,7 @@ Set to the symbol for either of `allout-mode-leaders' or `comment-start' to use only one of them, respectively. -Value nil means to always use the default \(`.'). +Value nil means to always use the default \(`.').t comment-start strings that do not end in spaces are tripled, and an `_' underscore is tacked on the end, to distinguish them from regular @@ -305,6 +314,9 @@ (const allout-mode-leaders) (const comment-start)) :group 'allout) +;;;###autoload +(put 'allout-use-mode-specific-leader 'safe-local-variable + (lambda (x) (or (member x '(t nil)) (stringp x)))) ;;;_ = allout-mode-leaders (defvar allout-mode-leaders '() "Specific allout-prefix leading strings per major modes. @@ -330,6 +342,9 @@ :type 'boolean :group 'allout) (make-variable-buffer-local 'allout-old-style-prefixes) +;;;###autoload +(put 'allout-old-style-prefixes 'safe-local-variable + (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. @@ -376,6 +391,9 @@ :type 'boolean :group 'allout) (make-variable-buffer-local 'allout-stylish-prefixes) +;;;###autoload +(put 'allout-stylish-prefixes 'safe-local-variable + (lambda (x) (member x '(t nil)))) ;;;_ = allout-numbered-bullet (defcustom allout-numbered-bullet "#" @@ -388,6 +406,9 @@ :type '(choice (const nil) string) :group 'allout) (make-variable-buffer-local 'allout-numbered-bullet) +;;;###autoload +(put 'allout-numbered-bullet 'safe-local-variable + (lambda (x) (or (not x) (stringp x)))) ;;;_ = allout-file-xref-bullet (defcustom allout-file-xref-bullet "@" "*Bullet signifying file cross-references, for `allout-resolve-xref'. @@ -395,6 +416,9 @@ Set this var to the bullet you want to use for file cross-references." :type '(choice (const nil) string) :group 'allout) +;;;###autoload +(put 'allout-file-xref-bullet 'safe-local-variable + (lambda (x) (or (not x) (stringp x)))) ;;;_ = allout-presentation-padding (defcustom allout-presentation-padding 2 "*Presentation-format white-space padding factor, for greater indent." @@ -402,6 +426,8 @@ :group 'allout) (make-variable-buffer-local 'allout-presentation-padding) +;;;###autoload +(put 'allout-presentation-padding 'safe-local-variable 'integerp) ;;;_ = allout-abbreviate-flattened-numbering (defcustom allout-abbreviate-flattened-numbering nil @@ -455,11 +481,16 @@ :group 'allout) ;;;_ + Topic encryption +;;;_ = allout-encryption group +(defgroup allout-encryption nil + "Settings for topic encryption features of allout outliner." + :group 'allout) ;;;_ = allout-topic-encryption-bullet (defcustom allout-topic-encryption-bullet "~" "*Bullet signifying encryption of the entry's body." :type '(choice (const nil) string) - :group 'allout) + :version "22.0" + :group 'allout-encryption) ;;;_ = allout-passphrase-verifier-handling (defcustom allout-passphrase-verifier-handling t "*Enable use of symmetric encryption passphrase verifier if non-nil. @@ -467,7 +498,8 @@ See the docstring for the `allout-enable-file-variable-adjustment' variable for details about allout ajustment of file variables." :type 'boolean - :group 'allout) + :version "22.0" + :group 'allout-encryption) (make-variable-buffer-local 'allout-passphrase-verifier-handling) ;;;_ = allout-passphrase-hint-handling (defcustom allout-passphrase-hint-handling 'always @@ -482,7 +514,8 @@ :type '(choice (const always) (const needed) (const disabled)) - :group 'allout) + :version "22.0" + :group 'allout-encryption) (make-variable-buffer-local 'allout-passphrase-hint-handling) ;;;_ = allout-encrypt-unencrypted-on-saves (defcustom allout-encrypt-unencrypted-on-saves t @@ -514,7 +547,8 @@ :type '(choice (const :tag "Yes" t) (const :tag "All except current topic" except-current) (const :tag "No" nil)) - :group 'allout) + :version "22.0" + :group 'allout-encryption) (make-variable-buffer-local 'allout-encrypt-unencrypted-on-saves) ;;;_ + Miscellaneous customization @@ -585,6 +619,9 @@ :type 'boolean :group 'allout) (make-variable-buffer-local 'allout-use-hanging-indents) +;;;###autoload +(put 'allout-use-hanging-indents 'safe-local-variable + (lambda (x) (member x '(t nil)))) ;;;_ = allout-reindent-bodies (defcustom allout-reindent-bodies (if allout-use-hanging-indents @@ -602,6 +639,9 @@ :group 'allout) (make-variable-buffer-local 'allout-reindent-bodies) +;;;###autoload +(put 'allout-reindent-bodies 'safe-local-variable + (lambda (x) (member x '(nil t text force)))) ;;;_ = allout-enable-file-variable-adjustment (defcustom allout-enable-file-variable-adjustment t @@ -667,7 +707,9 @@ case the value of `allout-default-layout' is used.") (make-variable-buffer-local 'allout-layout) ;;;###autoload -(put 'allout-layout 'safe-local-variable t) +(put 'allout-layout 'safe-local-variable + (lambda (x) (or (numberp x) (listp x) (integerp x) + (member x '(: * + -))))) ;;;_ : Topic header format ;;;_ = allout-regexp @@ -1053,7 +1095,8 @@ the emacs buffer state, if file variable adjustments are enabled. See `allout-enable-file-variable-adjustment' for details about that.") (make-variable-buffer-local 'allout-passphrase-verifier-string) -(put 'allout-passphrase-verifier-string 'safe-local-variable t) +;;;###autoload +(put 'allout-passphrase-verifier-string 'safe-local-variable 'stringp) ;;;_ = allout-passphrase-hint-string (defvar allout-passphrase-hint-string "" "Variable used to retain reminder string for file's encryption passphrase. @@ -1065,8 +1108,9 @@ state, if file variable adjustments are enabled. See `allout-enable-file-variable-adjustment' for details about that.") (make-variable-buffer-local 'allout-passphrase-hint-string) -(put 'allout-passphrase-hint-string 'safe-local-variable t) (setq-default allout-passphrase-hint-string "") +;;;###autoload +(put 'allout-passphrase-hint-string 'safe-local-variable 'stringp) ;;;_ = allout-after-save-decrypt (defvar allout-after-save-decrypt nil "Internal variable, is nil or has the value of two points: @@ -1573,6 +1617,12 @@ ; epoch, minor-mode key bindings: (setq allout-mode-map (produce-allout-mode-map allout-keybindings-list)) + (substitute-key-definition 'beginning-of-line + 'move-beginning-of-line + allout-mode-map global-map) + (substitute-key-definition 'end-of-line + 'move-end-of-line + allout-mode-map global-map) (produce-allout-mode-menubar-entries) (fset 'allout-mode-map allout-mode-map) ; Include on minor-mode-map-alist, @@ -5778,17 +5828,14 @@ (if (/= arg 1) (condition-case nil (line-move (1- arg)) (error nil))) - (let ((orig (point))) - ;; Move to beginning-of-line, ignoring fields and invisibles. - (skip-chars-backward "^\n") - (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) - (goto-char (if (featurep 'xemacs) - (previous-property-change (point)) - (previous-char-property-change (point)))) - (skip-chars-backward "^\n")) - (vertical-motion 0) - (if (/= orig (point)) - (goto-char orig)))) + ;; Move to beginning-of-line, ignoring fields and invisibles. + (skip-chars-backward "^\n") + (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) + (goto-char (if (featurep 'xemacs) + (previous-property-change (point)) + (previous-char-property-change (point)))) + (skip-chars-backward "^\n")) + (vertical-motion 0)) ) ;;;_ > move-end-of-line if necessary - older emacs, xemacs (if (not (fboundp 'move-end-of-line)) @@ -5802,8 +5849,7 @@ To ignore intangibility, bind `inhibit-point-motion-hooks' to t." (interactive "p") (or arg (setq arg 1)) - (let ((orig (point)) - done) + (let (done) (while (not done) (let ((newpos (save-excursion @@ -5813,8 +5859,10 @@ (error nil)) (not (bobp)) (progn - (while (and (not (bobp)) (line-move-invisible-p (1- (point)))) - (goto-char (previous-char-property-change (point)))) + (while (and (not (bobp)) + (line-move-invisible-p (1- (point)))) + (goto-char + (previous-char-property-change (point)))) (backward-char 1))) (point))))) (goto-char newpos) @@ -5827,9 +5875,7 @@ ;; and now we're not really at eol, ;; keep going. (setq arg 1) - (setq done t))))) - (if (/= orig (point)) - (goto-char orig)))) + (setq done t))))))) ) ;;;_ > line-move-invisible-p if necessary (if (not (fboundp 'line-move-invisible-p)) ------=_Part_2646_22954113.1145913557489 Content-Type: text/plain; name=allout-ChangeLog.txt; charset=us-ascii Content-Transfer-Encoding: 7bit X-Attachment-Id: f_emfba5xi Content-Disposition: attachment; filename="allout-ChangeLog.txt" 2006-04-17 Ken Manheimer * allout.el: Remove local autoload declaration for pgg-gpg-symmetric-key-p, since that's now done in pgg-gpg.el. (allout-show-bodies, allout-header-prefix, allout-primary-bullet, allout-plain-bullets-string, allout-distinctive-bullets-string, allout-use-mode-specific-leader, allout-old-style-prefixes, allout-stylish-prefixes, allout-numbered-bullet, allout-file-xref-bullet, allout-presentation-padding, allout-use-hanging-indents, allout-reindent-bodies): Mark as safe-local-variable with suitable value spec, and add autoload cookie for loaddefs inclusion. We use an explicit spec everywhere, rather than the defaulting 't', in anticipation of change in or obsolescence of the meaning of `t' in this context. (move-beginning-of-line, move-end-of-line): Repair so these compat functions now actually resituate the point, when appropriate. ------=_Part_2646_22954113.1145913557489 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel ------=_Part_2646_22954113.1145913557489--