Mercurial > emacs
annotate lisp/emacs-lisp/tcover-unsafep.el @ 109313:e856a274549b
Constify functions taking char *
* alloc.c (pending_malloc_warning, malloc_warning): Add const.
* callproc.c (relocate_fd, getenv_internal_1, getenv_internal)
(egetenv): Likewise.
* doprnt.c (doprnt): Likewise.
* editfns.c (set_time_zone_rule, format2): Likewise.
* emacs.c (decode_env_path): Likewise.
* eval.c (signal_error, error): Likewise.
* insdel.c (replace_range_2): Likewise.
* keyboard.c (cmd_error_internal): Likewise.
* lread.c (isfloat_string, make_symbol, dir_warning): Likewise.
* print.c (write_string, write_string_1, print_error_message):
Likewise.
* vm-limit.c (warn_function, memory_warnings): Likewise.
* xdisp.c (message1, message1_nolog, message_with_string)
(vmessage, message, message_nolog): Likewise.
* emacs.c: Remove duplicate declaration.
* keyboard.h: Likewise.
* lisp.h: Update prototypes.
author | Andreas Schwab <schwab@linux-m68k.org> |
---|---|
date | Sun, 11 Jul 2010 11:27:13 +0200 |
parents | 1d1d5d9bd884 |
children | 280c8ae2476d 376148b31b5e |
rev | line source |
---|---|
53440
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
1 ;;;; testcover-unsafep.el -- Use testcover to test unsafep's code coverage |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
2 |
106815 | 3 ;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. |
53440
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
4 |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
5 ;; Author: Jonathan Yavner <jyavner@engineer.com> |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
6 ;; Maintainer: Jonathan Yavner <jyavner@engineer.com> |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
7 ;; Keywords: safety lisp utility |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
8 |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
9 ;; This file is part of GNU Emacs. |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
10 |
94655
90a2847062be
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
11 ;; GNU Emacs is free software: you can redistribute it and/or modify |
53440
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
12 ;; it under the terms of the GNU General Public License as published by |
94655
90a2847062be
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
13 ;; the Free Software Foundation, either version 3 of the License, or |
90a2847062be
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
14 ;; (at your option) any later version. |
53440
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
15 |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
16 ;; GNU Emacs is distributed in the hope that it will be useful, |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
19 ;; GNU General Public License for more details. |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
20 |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
21 ;; You should have received a copy of the GNU General Public License |
94655
90a2847062be
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
93975
diff
changeset
|
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
53440
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
23 |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
24 (require 'testcover) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
25 |
65196
00f2dbd6f52a
(safe-functions): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
64751
diff
changeset
|
26 (defvar safe-functions) |
00f2dbd6f52a
(safe-functions): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents:
64751
diff
changeset
|
27 |
53440
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
28 ;;;These forms are all considered safe |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
29 (defconst testcover-unsafep-safe |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
30 '(((lambda (x) (* x 2)) 14) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
31 (apply 'cdr (mapcar '(lambda (x) (car x)) y)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
32 (cond ((= x 4) 5) (t 27)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
33 (condition-case x (car y) (error (car x))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
34 (dolist (x y) (message "here: %s" x)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
35 (dotimes (x 14 (* x 2)) (message "here: %d" x)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
36 (let (x) (dolist (y '(1 2 3) (1+ y)) (push y x))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
37 (let (x) (apply '(lambda (x) (* x 2)) 14)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
38 (let ((x '(2))) (push 1 x) (pop x) (add-to-list 'x 2)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
39 (let ((x 1) (y 2)) (setq x (+ x y))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
40 (let ((x 1)) (let ((y (+ x 3))) (* x y))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
41 (let* nil (current-time)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
42 (let* ((x 1) (y (+ x 3))) (* x y)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
43 (mapcar (lambda (x &optional y &rest z) (setq y (+ x 2)) (* y 3)) '(1 2 3)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
44 (mapconcat #'(lambda (var) (propertize var 'face 'bold)) '("1" "2") ", ") |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
45 (setq buffer-display-count 14 mark-active t) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
46 ;;This is not safe if you insert it into a buffer! |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
47 (propertize "x" 'display '(height (progn (delete-file "x") 1)))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
48 "List of forms that `unsafep' should decide are safe.") |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
49 |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
50 ;;;These forms are considered unsafe |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
51 (defconst testcover-unsafep-unsafe |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
52 '(( (add-to-list x y) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
53 . (unquoted x)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
54 ( (add-to-list y x) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
55 . (unquoted y)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
56 ( (add-to-list 'y x) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
57 . (global-variable y)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
58 ( (not (delete-file "unsafep.el")) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
59 . (function delete-file)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
60 ( (cond (t (aset local-abbrev-table 0 0))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
61 . (function aset)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
62 ( (cond (t (setq unsafep-vars ""))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
63 . (risky-local-variable unsafep-vars)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
64 ( (condition-case format-alist 1) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
65 . (risky-local-variable format-alist)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
66 ( (condition-case x 1 (error (setq format-alist ""))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
67 . (risky-local-variable format-alist)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
68 ( (dolist (x (sort globalvar 'car)) (princ x)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
69 . (function sort)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
70 ( (dotimes (x 14) (delete-file "x")) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
71 . (function delete-file)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
72 ( (let ((post-command-hook "/tmp/")) 1) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
73 . (risky-local-variable post-command-hook)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
74 ( (let ((x (delete-file "x"))) 2) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
75 . (function delete-file)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
76 ( (let (x) (add-to-list 'x (delete-file "x"))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
77 . (function delete-file)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
78 ( (let (x) (condition-case y (setq x 1 z 2))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
79 . (global-variable z)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
80 ( (let (x) (condition-case z 1 (error (delete-file "x")))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
81 . (function delete-file)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
82 ( (let (x) (mapc (lambda (x) (setcar x 1)) '((1 . 2) (3 . 4)))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
83 . (function setcar)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
84 ( (let (y) (push (delete-file "x") y)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
85 . (function delete-file)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
86 ( (let* ((x 1)) (setq y 14)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
87 . (global-variable y)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
88 ( (mapc 'car (list '(1 . 2) (cons 3 4) (kill-buffer "unsafep.el"))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
89 . (function kill-buffer)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
90 ( (mapcar x y) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
91 . (unquoted x)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
92 ( (mapcar '(lambda (x) (rename-file x "x")) '("unsafep.el")) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
93 . (function rename-file)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
94 ( (mapconcat x1 x2 " ") |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
95 . (unquoted x1)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
96 ( (pop format-alist) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
97 . (risky-local-variable format-alist)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
98 ( (push 1 format-alist) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
99 . (risky-local-variable format-alist)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
100 ( (setq buffer-display-count (delete-file "x")) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
101 . (function delete-file)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
102 ;;These are actualy safe (they signal errors) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
103 ( (apply '(x) '(1 2 3)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
104 . (function (x))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
105 ( (let (((x))) 1) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
106 . (variable (x))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
107 ( (let (1) 2) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
108 . (variable 1)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
109 ) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
110 "A-list of (FORM . REASON)... that`unsafep' should decide are unsafe.") |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
111 |
86247
fc93e9674475
* progmodes/python.el (info-lookup-maybe-add-help):
Dan Nicolaescu <dann@ics.uci.edu>
parents:
78217
diff
changeset
|
112 (declare-function unsafep-function "unsafep" (fun)) |
53440
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
113 |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
114 ;;;######################################################################### |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
115 (defun testcover-unsafep () |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
116 "Executes all unsafep tests and displays the coverage results." |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
117 (interactive) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
118 (testcover-unmark-all "unsafep.el") |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
119 (testcover-start "unsafep.el") |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
120 (let (save-functions) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
121 (dolist (x testcover-unsafep-safe) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
122 (if (unsafep x) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
123 (error "%S should be safe" x))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
124 (dolist (x testcover-unsafep-unsafe) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
125 (if (not (equal (unsafep (car x)) (cdr x))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
126 (error "%S should be unsafe: %s" (car x) (cdr x)))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
127 (setq safe-functions t) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
128 (if (or (unsafep '(delete-file "x")) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
129 (unsafep-function 'delete-file)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
130 (error "safe-functions=t should allow delete-file")) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
131 (setq safe-functions '(setcar)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
132 (if (unsafep '(setcar x 1)) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
133 (error "safe-functions=(setcar) should allow setcar")) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
134 (if (not (unsafep '(setcdr x 1))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
135 (error "safe-functions=(setcar) should not allow setcdr"))) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
136 (testcover-mark-all "unsafep.el") |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
137 (testcover-end "unsafep.el") |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
138 (message "Done")) |
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
139 |
93975
1e3a407766b9
Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
87649
diff
changeset
|
140 ;; arch-tag: a7616c27-1998-47ae-9304-76d1439dbf29 |
53440
296b4cb363cc
emacs-lisp/tcover-unsafep.el, emacs-lisp/tcover-ses.el: Renamed
Eli Zaretskii <eliz@is.elta.co.il>
parents:
diff
changeset
|
141 ;; testcover-unsafep.el ends here. |