[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/trunk r108377: Use `declare' in `lambda' an
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/trunk r108377: Use `declare' in `lambda' and mis minor changes. |
Date: |
Sat, 26 May 2012 11:52:27 -0400 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 108377
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Sat 2012-05-26 11:52:27 -0400
message:
Use `declare' in `lambda' and mis minor changes.
* lisp/subr.el (lambda): Use declare.
* lisp/emacs-lisp/lisp-mode.el (lambda):
* lisp/emacs-lisp/edebug.el (lambda): Move properties to its definition.
* lisp/gnus/legacy-gnus-agent.el (gnus-agent-unhook-expire-days):
* lisp/gnus/gnus-demon.el (gnus-demon-init): Don't bother with type-of.
modified:
lisp/ChangeLog
lisp/emacs-lisp/edebug.el
lisp/emacs-lisp/lisp-mode.el
lisp/emacs-lisp/pcase.el
lisp/gnus/ChangeLog
lisp/gnus/gnus-demon.el
lisp/gnus/legacy-gnus-agent.el
lisp/subr.el
src/print.c
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-05-26 02:40:47 +0000
+++ b/lisp/ChangeLog 2012-05-26 15:52:27 +0000
@@ -1,3 +1,9 @@
+2012-05-26 Stefan Monnier <address@hidden>
+
+ * subr.el (lambda): Use declare.
+ * emacs-lisp/lisp-mode.el (lambda):
+ * emacs-lisp/edebug.el (lambda): Move properties to its definition.
+
2012-05-26 Aaron S. Hawley <address@hidden>
* thingatpt.el (forward-same-syntax): Handle no ARG case. (Bug#11560)
=== modified file 'lisp/emacs-lisp/edebug.el'
--- a/lisp/emacs-lisp/edebug.el 2012-05-22 16:45:44 +0000
+++ b/lisp/emacs-lisp/edebug.el 2012-05-26 15:52:27 +0000
@@ -2010,12 +2010,6 @@
;; A macro is allowed by Emacs.
(def-edebug-spec function (&or symbolp lambda-expr))
-;; lambda is a macro in emacs 19.
-(def-edebug-spec lambda (&define lambda-list
- [&optional stringp]
- [&optional ("interactive" interactive)]
- def-body))
-
;; A macro expression is a lambda expression with "macro" prepended.
(def-edebug-spec macro (&define "lambda" lambda-list def-body))
=== modified file 'lisp/emacs-lisp/lisp-mode.el'
--- a/lisp/emacs-lisp/lisp-mode.el 2012-05-18 01:46:20 +0000
+++ b/lisp/emacs-lisp/lisp-mode.el 2012-05-26 15:52:27 +0000
@@ -140,7 +140,6 @@
(put 'defvar 'doc-string-elt 3)
(put 'defconst 'doc-string-elt 3)
(put 'defmacro 'doc-string-elt 3)
-(put 'lambda 'doc-string-elt 2)
(put 'defalias 'doc-string-elt 3)
(put 'defvaralias 'doc-string-elt 3)
(put 'define-category 'doc-string-elt 2)
@@ -1213,7 +1212,6 @@
;; like defun if the first form is placed on the next line, otherwise
;; it is indented like any other form (i.e. forms line up under first).
-(put 'lambda 'lisp-indent-function 'defun)
(put 'autoload 'lisp-indent-function 'defun)
(put 'progn 'lisp-indent-function 0)
(put 'prog1 'lisp-indent-function 1)
=== modified file 'lisp/emacs-lisp/pcase.el'
--- a/lisp/emacs-lisp/pcase.el 2012-05-17 21:40:47 +0000
+++ b/lisp/emacs-lisp/pcase.el 2012-05-26 15:52:27 +0000
@@ -39,12 +39,15 @@
;; - along these lines, provide patterns to match CL structs.
;; - provide something like (setq VAR) so a var can be set rather than
;; let-bound.
-;; - provide a way to fallthrough to subsequent cases.
+;; - provide a way to fallthrough to subsequent cases (not sure what I meant by
+;; this :-()
;; - try and be more clever to reduce the size of the decision tree, and
;; to reduce the number of leaves that need to be turned into function:
;; - first, do the tests shared by all remaining branches (it will have
-;; to be performed anyway, so better so it first so it's shared).
+;; to be performed anyway, so better do it first so it's shared).
;; - then choose the test that discriminates more (?).
+;; - provide Agda's `with' (along with its `...' companion).
+;; - implement (not UPAT). This might require a significant redesign.
;; - ideally we'd want (pcase s ((re RE1) E1) ((re RE2) E2)) to be able to
;; generate a lex-style DFA to decide whether to run E1 or E2.
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog 2012-05-25 14:58:17 +0000
+++ b/lisp/gnus/ChangeLog 2012-05-26 15:52:27 +0000
@@ -1,3 +1,8 @@
+2012-05-26 Stefan Monnier <address@hidden>
+
+ * legacy-gnus-agent.el (gnus-agent-unhook-expire-days):
+ * gnus-demon.el (gnus-demon-init): Don't bother with type-of.
+
2012-05-25 Stefan Monnier <address@hidden>
* gnus-win.el (gnus-configure-frame): Don't signal an error when
=== modified file 'lisp/gnus/gnus-demon.el'
--- a/lisp/gnus/gnus-demon.el 2012-02-19 23:55:16 +0000
+++ b/lisp/gnus/gnus-demon.el 2012-05-26 15:52:27 +0000
@@ -116,7 +116,6 @@
;; Set up the timer.
(let* ((func (nth 0 handler))
(time (nth 1 handler))
- (time-type (type-of time))
(idle (nth 2 handler))
;; Compute time according with timestep.
;; If t, replace by 1
@@ -140,10 +139,10 @@
(run-with-idle-timer idle t 'gnus-demon-run-callback func))
;; (func number any)
;; Call every `time'
- ((eq time-type 'integer)
+ ((integerp time)
(run-with-timer time time 'gnus-demon-run-callback func idle))
;; (func string any)
- ((eq time-type 'string)
+ ((stringp time)
(run-with-timer time (* 24 60 60) 'gnus-demon-run-callback func
idle)))))
(when timer
(add-to-list 'gnus-demon-timers timer)))))
=== modified file 'lisp/gnus/legacy-gnus-agent.el'
--- a/lisp/gnus/legacy-gnus-agent.el 2012-01-19 07:21:25 +0000
+++ b/lisp/gnus/legacy-gnus-agent.el 2012-05-26 15:52:27 +0000
@@ -206,29 +206,31 @@
(gnus-convert-mark-converter-prompt 'gnus-agent-unlist-expire-days t)
(defun gnus-agent-unhook-expire-days (converting-to)
- "Remove every lambda from gnus-group-prepare-hook that mention the
-symbol gnus-agent-do-once in their definition. This should NOT be
+ "Remove every lambda from `gnus-group-prepare-hook' that mention the
+symbol `gnus-agent-do-once' in their definition. This should NOT be
necessary as gnus-agent.el no longer adds them. However, it is
possible that the hook was persistently saved."
- (let ((h t)) ; iterate from bgn of hook
+ (let ((h t)) ; Iterate from bgn of hook.
(while h
(let ((func (progn (when (eq h t)
- ;; init h to list of functions
+ ;; Init h to list of functions.
(setq h (cond ((listp gnus-group-prepare-hook)
gnus-group-prepare-hook)
((boundp 'gnus-group-prepare-hook)
(list gnus-group-prepare-hook)))))
(pop h))))
- (when (cond ((eq (type-of func) 'compiled-function)
- ;; Search def. of compiled function for
gnus-agent-do-once string
+ (when (cond ((byte-code-function-p func)
+ ;; Search def. of compiled function for
+ ;; gnus-agent-do-once string.
(let* (definition
print-level
print-length
(standard-output
(lambda (char)
(setq definition (cons char definition)))))
- (princ func) ; populates definition with reversed
list of characters
+ (princ func) ; Populates definition with reversed list
+ ; of characters.
(let* ((i (length definition))
(s (make-string i 0)))
(while definition
@@ -236,7 +238,7 @@
(string-match "\\bgnus-agent-do-once\\b" s))))
((listp func)
- (eq (cadr (nth 2 func)) 'gnus-agent-do-once) ; handles
eval'd lambda
+ (eq (cadr (nth 2 func)) 'gnus-agent-do-once) ; Handles
eval'd lambda.
))
(remove-hook 'gnus-group-prepare-hook func)
=== modified file 'lisp/subr.el'
--- a/lisp/subr.el 2012-05-08 14:11:47 +0000
+++ b/lisp/subr.el 2012-05-26 15:52:27 +0000
@@ -112,6 +112,11 @@
BODY should be a list of Lisp expressions.
\(fn ARGS [DOCSTRING] [INTERACTIVE] BODY)"
+ (declare (doc-string 2) (indent defun)
+ (debug (&define lambda-list
+ [&optional stringp]
+ [&optional ("interactive" interactive)]
+ def-body)))
;; Note that this definition should not use backquotes; subr.el should not
;; depend on backquote.el.
(list 'function (cons 'lambda cdr)))
=== modified file 'src/print.c'
--- a/src/print.c 2012-05-25 18:19:24 +0000
+++ b/src/print.c 2012-05-26 15:52:27 +0000
@@ -1086,9 +1086,7 @@
if (HASH_TABLE_P (Vprint_number_table))
{ /* Remove unnecessary objects, which appear only once in OBJ;
- that is, whose status is Qt.
- Maybe a better way to do that is to copy elements to
- a new hash table. */
+ that is, whose status is Qt. */
struct Lisp_Hash_Table *h = XHASH_TABLE (Vprint_number_table);
ptrdiff_t i;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/trunk r108377: Use `declare' in `lambda' and mis minor changes.,
Stefan Monnier <=