From: "Ken Manheimer" <ken.manheimer@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: allout patch - more safe-local-variables, plus autoloads
Date: Wed, 19 Apr 2006 19:08:00 -0400 [thread overview]
Message-ID: <2cd46e7f0604191608o52f500ferc1955a131bd5fde4@mail.gmail.com> (raw)
In-Reply-To: <E1FVpm4-0005uv-W8@fencepost.gnu.org>
[-- Attachment #1: Type: text/plain, Size: 662 bytes --]
On 4/18/06, Richard Stallman <rms@gnu.org> wrote:
> I see that you've used t as the property value.
> That allows any type of value.
>
> Most of these variables are supposed to be strings.
> I don't know what would happen if they were set to other types;
> did you check each one?
>
> It would be safer to use stringp as the property value
> for a variable that is supposed to be a string.
i was too casual when i read the info about safe-local-variable. i've
revised my patch to better discriminate values, where appropriate.
the revised patch and the ChangeLog are attached.
--
ken manheimer
ken.manheimer@gmail.com
http://myriadicity.net
[-- Attachment #2: allout-patch.txt --]
[-- Type: text/plain, Size: 7516 bytes --]
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 19 Apr 2006 23:02:28 -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,8 @@
:type 'boolean
:group 'allout)
(make-variable-buffer-local 'allout-show-bodies)
+;;;###autoload
+(put 'allout-show-bodies 'safe-local-variable t)
;;;_ = allout-header-prefix
(defcustom allout-header-prefix "."
@@ -212,6 +212,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 +229,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 +245,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 +280,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
@@ -305,6 +313,8 @@
(const allout-mode-leaders)
(const comment-start))
:group 'allout)
+;;;###autoload
+(put 'allout-use-mode-specific-leader 'safe-local-variable t)
;;;_ = allout-mode-leaders
(defvar allout-mode-leaders '()
"Specific allout-prefix leading strings per major modes.
@@ -330,6 +340,8 @@
:type 'boolean
:group 'allout)
(make-variable-buffer-local 'allout-old-style-prefixes)
+;;;###autoload
+(put 'allout-old-style-prefixes 'safe-local-variable t)
;;;_ = allout-stylish-prefixes - alternating bullets
(defcustom allout-stylish-prefixes t
"*Do fancy stuff with topic prefix bullets according to level, etc.
@@ -376,6 +388,8 @@
:type 'boolean
:group 'allout)
(make-variable-buffer-local 'allout-stylish-prefixes)
+;;;###autoload
+(put 'allout-stylish-prefixes 'safe-local-variable t)
;;;_ = allout-numbered-bullet
(defcustom allout-numbered-bullet "#"
@@ -388,6 +402,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 +412,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 +422,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 +477,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 +494,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 +510,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 +543,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 +615,8 @@
:type 'boolean
:group 'allout)
(make-variable-buffer-local 'allout-use-hanging-indents)
+;;;###autoload
+(put 'allout-use-hanging-indents 'safe-local-variable t)
;;;_ = allout-reindent-bodies
(defcustom allout-reindent-bodies (if allout-use-hanging-indents
@@ -602,6 +634,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
@@ -1053,7 +1088,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 +1101,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:
[-- Attachment #3: allout-ChangeLog.txt --]
[-- Type: text/plain, Size: 626 bytes --]
2006-04-17 Ken Manheimer <ken.manheimer@gmail.com>
* 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.
[-- Attachment #4: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
next prev parent reply other threads:[~2006-04-19 23:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-17 19:11 allout patch - more safe-local-variables, plus autoloads Ken Manheimer
2006-04-18 12:57 ` Richard Stallman
2006-04-18 13:18 ` Stefan Monnier
2006-04-19 4:17 ` Richard Stallman
2006-04-19 4:39 ` Stefan Monnier
2006-04-19 21:12 ` Richard Stallman
2006-04-20 2:47 ` Luc Teirlinck
2006-04-20 17:34 ` Stefan Monnier
2006-04-21 13:07 ` Richard Stallman
2006-04-21 15:02 ` Ken Manheimer
2006-04-21 15:09 ` David Kastrup
2006-04-21 15:39 ` Ken Manheimer
2006-04-21 17:15 ` Stefan Monnier
2006-04-24 21:19 ` Ken Manheimer
2006-04-19 23:08 ` Ken Manheimer [this message]
2006-04-20 10:35 ` Richard Stallman
2006-04-20 18:49 ` autoloads for safe-local-variables (was: allout patch - more safe-local-variables, plus autoloads) Reiner Steib
2006-04-20 19:52 ` autoloads for safe-local-variables (was: allout patch - moresafe-local-variables, " Stuart D. Herring
2006-04-21 13:07 ` autoloads for safe-local-variables (was: allout patch - more safe-local-variables, " Richard Stallman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2cd46e7f0604191608o52f500ferc1955a131bd5fde4@mail.gmail.com \
--to=ken.manheimer@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).