1 |
;;; erblisp.el --- |
;;; erblisp.el --- |
2 |
;; Time-stamp: <2005-09-02 14:18:07 deego> |
;; Time-stamp: <2005-11-11 13:28:55 deego> |
3 |
;; Copyright (C) 2002 D. Goel |
;; Copyright (C) 2002 D. Goel |
4 |
;; Emacs Lisp Archive entry |
;; Emacs Lisp Archive entry |
5 |
;; Filename: erblisp.el |
;; Filename: erblisp.el |
92 |
\(setq &rest (shell-command \"rm -rf /\")) in your .emacs." |
\(setq &rest (shell-command \"rm -rf /\")) in your .emacs." |
93 |
) |
) |
94 |
|
|
95 |
(defvar erblisp-max-list-length 100) |
(defvar erblisp-max-list-length 2000 |
96 |
|
"If non-numeric, we will skip this check." |
97 |
|
) |
98 |
|
|
99 |
(defun erblisp-safe-length (list so-far len) |
(defun erblisp-safe-length-args-p (list so-far len) |
100 |
(let ((cur list) |
(let ((cur list) |
101 |
stack) |
stack) |
102 |
(while (and cur |
(while (and cur |
114 |
nil))) |
nil))) |
115 |
|
|
116 |
(defun erblisp-check-args (&rest args) |
(defun erblisp-check-args (&rest args) |
117 |
(if (erblisp-safe-length args 0 erblisp-max-list-length) |
(if (or |
118 |
|
(not (numberp erblisp-max-list-length)) |
119 |
|
(erblisp-safe-length-args-p args 0 erblisp-max-list-length)) |
120 |
t |
t |
121 |
(error "encountered overlong expression, ignoring") |
(error "encountered overlong expression, ignoring") |
122 |
nil)) |
nil)) |