Commit a5297ce3 authored by Jonathan Yavner's avatar Jonathan Yavner
Browse files

Fixed first-line problem for function documentation strings.

parent d2d70cb6
...@@ -83,13 +83,13 @@ ...@@ -83,13 +83,13 @@
(require 'byte-opt) ;Set up the `side-effect-free' properties (require 'byte-opt) ;Set up the `side-effect-free' properties
(defcustom safe-functions nil (defcustom safe-functions nil
"t to disable all safety checks, or a list of assumed-safe functions." "t to disable `unsafep', or a list of assumed-safe functions."
:group 'lisp :group 'lisp
:type '(choice (const :tag "No" nil) (const :tag "Yes" t) hook)) :type '(choice (const :tag "No" nil) (const :tag "Yes" t) hook))
(defvar unsafep-vars nil (defvar unsafep-vars nil
"Dynamically-bound list of variables that have lexical bindings at this "Dynamically-bound list of variables with lexical bindings at this point
point in the parse.") in the parse.")
(put 'unsafep-vars 'risky-local-variable t) (put 'unsafep-vars 'risky-local-variable t)
;;Side-effect-free functions from subr.el ;;Side-effect-free functions from subr.el
...@@ -114,9 +114,9 @@ point in the parse.") ...@@ -114,9 +114,9 @@ point in the parse.")
;;;###autoload ;;;###autoload
(defun unsafep (form &optional unsafep-vars) (defun unsafep (form &optional unsafep-vars)
"Return nil if evaluating FORM couldn't possibly do any harm; otherwise "Return nil if evaluating FORM couldn't possibly do any harm;
result is a reason why FORM is unsafe. UNSAFEP-VARS is a list of symbols otherwise result is a reason why FORM is unsafe. UNSAFEP-VARS is a list
with local bindings." of symbols with local bindings."
(catch 'unsafep (catch 'unsafep
(if (or (eq safe-functions t) ;User turned off safety-checking (if (or (eq safe-functions t) ;User turned off safety-checking
(atom form)) ;Atoms are never unsafe (atom form)) ;Atoms are never unsafe
...@@ -210,8 +210,9 @@ with local bindings." ...@@ -210,8 +210,9 @@ with local bindings."
(defun unsafep-function (fun) (defun unsafep-function (fun)
"Return nil if FUN is a safe function (either a safe lambda or a "Return nil if FUN is a safe function
symbol that names a safe function). Otherwise result is a reason code." \(either a safe lambda or a symbol that names a safe function). Otherwise
result is a reason code."
(cond (cond
((eq (car-safe fun) 'lambda) ((eq (car-safe fun) 'lambda)
(unsafep fun unsafep-vars)) (unsafep fun unsafep-vars))
...@@ -223,8 +224,8 @@ symbol that names a safe function). Otherwise result is a reason code." ...@@ -223,8 +224,8 @@ symbol that names a safe function). Otherwise result is a reason code."
`(function ,fun)))) `(function ,fun))))
(defun unsafep-progn (list) (defun unsafep-progn (list)
"Return nil if all forms in LIST are safe, or the reason for the first "Return nil if all forms in LIST are safe, or the reason
unsafe form." for the first unsafe form."
(catch 'unsafep-progn (catch 'unsafep-progn
(let (reason) (let (reason)
(dolist (x list) (dolist (x list)
...@@ -232,8 +233,8 @@ unsafe form." ...@@ -232,8 +233,8 @@ unsafe form."
(if reason (throw 'unsafep-progn reason)))))) (if reason (throw 'unsafep-progn reason))))))
(defun unsafep-let (clause) (defun unsafep-let (clause)
"CLAUSE is a let-binding, either SYM or (SYM) or (SYM VAL). Throws a "CLAUSE is a let-binding, either SYM or (SYM) or (SYM VAL). Checks VAL
reason to `unsafep' if VAL isn't safe. Returns SYM." and throws a reason to `unsafep' if unsafe. Returns SYM."
(let (reason sym) (let (reason sym)
(if (atom clause) (if (atom clause)
(setq sym clause) (setq sym clause)
...@@ -244,8 +245,9 @@ reason to `unsafep' if VAL isn't safe. Returns SYM." ...@@ -244,8 +245,9 @@ reason to `unsafep' if VAL isn't safe. Returns SYM."
sym)) sym))
(defun unsafep-variable (sym global-okay) (defun unsafep-variable (sym global-okay)
"Returns nil if SYM is lexically bound or is a non-risky buffer-local "Returns nil if SYM is safe as a let-binding sym
variable, otherwise a reason why it is unsafe. Failing to be locally bound \(because it already has a temporary binding or is a non-risky buffer-local
variable), otherwise a reason why it is unsafe. Failing to be locally bound
is okay if GLOBAL-OKAY is non-nil." is okay if GLOBAL-OKAY is non-nil."
(cond (cond
((not (symbolp sym)) ((not (symbolp sym))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment