diff options
| author | Stefan Monnier | 2006-02-01 17:01:03 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2006-02-01 17:01:03 +0000 |
| commit | 60ee0957757f8bb884beaf19fb4c6bd0c23f7620 (patch) | |
| tree | 2461a16c443d4ba84c7aa8ffa0b449414d2b3c90 | |
| parent | ea56cdf1b7716fca51374a5471adbb862d9a31f1 (diff) | |
| download | emacs-60ee0957757f8bb884beaf19fb4c6bd0c23f7620.tar.gz emacs-60ee0957757f8bb884beaf19fb4c6bd0c23f7620.zip | |
Minor twiddles in comments and docstrings.
| -rw-r--r-- | lisp/emacs-lisp/unsafep.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/emacs-lisp/unsafep.el b/lisp/emacs-lisp/unsafep.el index 4b1312d58d7..27e079b1dcd 100644 --- a/lisp/emacs-lisp/unsafep.el +++ b/lisp/emacs-lisp/unsafep.el | |||
| @@ -79,11 +79,13 @@ | |||
| 79 | ;; passed a circular list to `assoc', Emacs would crash. Historically, | 79 | ;; passed a circular list to `assoc', Emacs would crash. Historically, |
| 80 | ;; problems of this kind have been few and short-lived. | 80 | ;; problems of this kind have been few and short-lived. |
| 81 | 81 | ||
| 82 | ;;; Code: | ||
| 83 | |||
| 82 | (provide 'unsafep) | 84 | (provide 'unsafep) |
| 83 | (require 'byte-opt) ;Set up the `side-effect-free' properties | 85 | (require 'byte-opt) ;Set up the `side-effect-free' properties |
| 84 | 86 | ||
| 85 | (defcustom safe-functions nil | 87 | (defcustom safe-functions nil |
| 86 | "t to disable `unsafep', or a list of assumed-safe functions." | 88 | "A list of assumed-safe functions, or t to disable `unsafep'." |
| 87 | :group 'lisp | 89 | :group 'lisp |
| 88 | :type '(choice (const :tag "No" nil) (const :tag "Yes" t) hook)) | 90 | :type '(choice (const :tag "No" nil) (const :tag "Yes" t) hook)) |
| 89 | 91 | ||
| @@ -210,7 +212,7 @@ of symbols with local bindings." | |||
| 210 | 212 | ||
| 211 | 213 | ||
| 212 | (defun unsafep-function (fun) | 214 | (defun unsafep-function (fun) |
| 213 | "Return nil if FUN is a safe function | 215 | "Return nil iff FUN is a safe function. |
| 214 | \(either a safe lambda or a symbol that names a safe function). Otherwise | 216 | \(either a safe lambda or a symbol that names a safe function). Otherwise |
| 215 | result is a reason code." | 217 | result is a reason code." |
| 216 | (cond | 218 | (cond |
| @@ -233,7 +235,8 @@ for the first unsafe form." | |||
| 233 | (if reason (throw 'unsafep-progn reason)))))) | 235 | (if reason (throw 'unsafep-progn reason)))))) |
| 234 | 236 | ||
| 235 | (defun unsafep-let (clause) | 237 | (defun unsafep-let (clause) |
| 236 | "CLAUSE is a let-binding, either SYM or (SYM) or (SYM VAL). Checks VAL | 238 | "Check the safety of a let binding. |
| 239 | CLAUSE is a let-binding, either SYM or (SYM) or (SYM VAL). Checks VAL | ||
| 237 | and throws a reason to `unsafep' if unsafe. Returns SYM." | 240 | and throws a reason to `unsafep' if unsafe. Returns SYM." |
| 238 | (let (reason sym) | 241 | (let (reason sym) |
| 239 | (if (atom clause) | 242 | (if (atom clause) |
| @@ -245,7 +248,7 @@ and throws a reason to `unsafep' if unsafe. Returns SYM." | |||
| 245 | sym)) | 248 | sym)) |
| 246 | 249 | ||
| 247 | (defun unsafep-variable (sym global-okay) | 250 | (defun unsafep-variable (sym global-okay) |
| 248 | "Returns nil if SYM is safe as a let-binding sym | 251 | "Return nil if SYM is safe as a let-binding sym |
| 249 | \(because it already has a temporary binding or is a non-risky buffer-local | 252 | \(because it already has a temporary binding or is a non-risky buffer-local |
| 250 | variable), otherwise a reason why it is unsafe. Failing to be locally bound | 253 | variable), otherwise a reason why it is unsafe. Failing to be locally bound |
| 251 | is okay if GLOBAL-OKAY is non-nil." | 254 | is okay if GLOBAL-OKAY is non-nil." |
| @@ -259,5 +262,5 @@ is okay if GLOBAL-OKAY is non-nil." | |||
| 259 | (local-variable-p sym))) | 262 | (local-variable-p sym))) |
| 260 | `(global-variable ,sym)))) | 263 | `(global-variable ,sym)))) |
| 261 | 264 | ||
| 262 | ;;; arch-tag: 6216f98b-eb8f-467a-9c33-7a7644f50658 | 265 | ;; arch-tag: 6216f98b-eb8f-467a-9c33-7a7644f50658 |
| 263 | ;; unsafep.el ends here. | 266 | ;;; unsafep.el ends here |