aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2001-11-08 00:57:57 +0000
committerStefan Monnier2001-11-08 00:57:57 +0000
commit0764e16fbe3d6f7a09e13378b09faa7314a53734 (patch)
treeadd173637cecfb4fa23d0cc63bbe0d60288af3be
parentecd91f5fea97ea2b69c17cedd24c353ef31c3815 (diff)
downloademacs-0764e16fbe3d6f7a09e13378b09faa7314a53734.tar.gz
emacs-0764e16fbe3d6f7a09e13378b09faa7314a53734.zip
(with-local-quit): New macro.
(make-syntax-table): Always inherit. (functionp): Be more careful when `object' is a symbol.
-rw-r--r--lisp/subr.el33
1 files changed, 20 insertions, 13 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index ff9d9e57824..2f976515371 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -35,6 +35,8 @@ Each element of this list holds the arguments to one call to `defcustom'.")
35 35
36;;;; Lisp language features. 36;;;; Lisp language features.
37 37
38(defalias 'not 'null)
39
38(defmacro lambda (&rest cdr) 40(defmacro lambda (&rest cdr)
39 "Return a lambda expression. 41 "Return a lambda expression.
40A call of the form (lambda ARGS DOCSTRING INTERACTIVE BODY) is 42A call of the form (lambda ARGS DOCSTRING INTERACTIVE BODY) is
@@ -664,7 +666,6 @@ Please convert your programs to use the variable `baud-rate' directly."
664(defalias 'string= 'string-equal) 666(defalias 'string= 'string-equal)
665(defalias 'string< 'string-lessp) 667(defalias 'string< 'string-lessp)
666(defalias 'move-marker 'set-marker) 668(defalias 'move-marker 'set-marker)
667(defalias 'not 'null)
668(defalias 'rplaca 'setcar) 669(defalias 'rplaca 'setcar)
669(defalias 'rplacd 'setcdr) 670(defalias 'rplacd 'setcdr)
670(defalias 'beep 'ding) ;preserve lingual purity 671(defalias 'beep 'ding) ;preserve lingual purity
@@ -1204,6 +1205,13 @@ See also `with-temp-file' and `with-output-to-string'."
1204 (buffer-string) 1205 (buffer-string)
1205 (kill-buffer nil))))) 1206 (kill-buffer nil)))))
1206 1207
1208(defmacro with-local-quit (&rest body)
1209 "Execute BODY with `inhibit-quit' temporarily bound to nil."
1210 `(condition-case nil
1211 (let ((inhibit-quit nil))
1212 ,@body)
1213 (quit (setq quit-flag t))))
1214
1207(defmacro combine-after-change-calls (&rest body) 1215(defmacro combine-after-change-calls (&rest body)
1208 "Execute BODY, but don't call the after-change functions till the end. 1216 "Execute BODY, but don't call the after-change functions till the end.
1209If BODY makes changes in the buffer, they are recorded 1217If BODY makes changes in the buffer, they are recorded
@@ -1445,14 +1453,11 @@ and replace a sub-expression, e.g.
1445 1453
1446(defun make-syntax-table (&optional oldtable) 1454(defun make-syntax-table (&optional oldtable)
1447 "Return a new syntax table. 1455 "Return a new syntax table.
1448If OLDTABLE is non-nil, copy OLDTABLE. 1456Create a syntax table which inherits from OLDTABLE (if non-nil) or
1449Otherwise, create a syntax table which inherits from the 1457from `standard-syntax-table' otherwise."
1450`standard-syntax-table'." 1458 (let ((table (make-char-table 'syntax-table nil)))
1451 (if oldtable 1459 (set-char-table-parent table (or oldtable (standard-syntax-table)))
1452 (copy-syntax-table oldtable) 1460 table))
1453 (let ((table (make-char-table 'syntax-table nil)))
1454 (set-char-table-parent table (standard-syntax-table))
1455 table)))
1456 1461
1457(defun add-to-invisibility-spec (arg) 1462(defun add-to-invisibility-spec (arg)
1458 "Add elements to `buffer-invisibility-spec'. 1463 "Add elements to `buffer-invisibility-spec'.
@@ -1528,10 +1533,12 @@ configuration."
1528 (eq (car object) 'frame-configuration))) 1533 (eq (car object) 'frame-configuration)))
1529 1534
1530(defun functionp (object) 1535(defun functionp (object)
1531 "Non-nil if OBJECT is a type of object that can be called as a function." 1536 "Non-nil iff OBJECT is a type of object that can be called as a function."
1532 (or (subrp object) (byte-code-function-p object) 1537 (or (and (symbolp object) (setq object (indirect-function object))
1533 (eq (car-safe object) 'lambda) 1538 (eq (car-safe object) 'autoload)
1534 (and (symbolp object) (fboundp object)))) 1539 (not (car-safe (cdr-safe (cdr-safe (cdr-safe (cdr-safe object)))))))
1540 (subrp object) (byte-code-function-p object)
1541 (eq (car-safe object) 'lambda)))
1535 1542
1536(defun interactive-form (function) 1543(defun interactive-form (function)
1537 "Return the interactive form of FUNCTION. 1544 "Return the interactive form of FUNCTION.