Commit 5514cc4c authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/emacs-lisp/timer.el (timer--time-setter): New function.

(timer--time): Use it as gv-setter.
* lisp/emacs-lisp/gv.el (gv-define-simple-setter): Output warning when
setter is not a symbol.
parent 5c41e9ff
2013-08-13 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/timer.el (timer--time-setter): New function.
(timer--time): Use it as gv-setter.
* emacs-lisp/gv.el (gv-define-simple-setter): Output warning when
setter is not a symbol.
2013-08-12 Grégoire Jadi <daimrod@gmail.com>
* mail/sendmail.el (sendmail-send-it): Don't kill the error buffer
......@@ -20,8 +28,8 @@
2013-08-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
* net/eww.el (eww-display-html): Ignore coding system errors. One
web site uses "utf-8lias" as the coding system.
* net/eww.el (eww-display-html): Ignore coding system errors.
One web site uses "utf-8lias" as the coding system.
2013-08-11 Juanma Barranquero <lekktu@gmail.com>
......@@ -222,7 +230,7 @@
(allout-up-current-level, allout-end-of-level, allout-reindent-body)
(allout-yank-processing, allout-process-exposed)
(allout-latex-verb-quote, allout-latexify-one-item, outlineify-sticky)
(allout-latex-verbatim-quote-curr-line): Removed unused variables.
(allout-latex-verbatim-quote-curr-line): Remove unused variables.
* emacs-lisp/lisp-mode.el (lisp-eval-defun, last-sexp-toggle-display)
(lisp-indent-defform): Mark ignored arguments.
(lisp-indent-line): Mark ignored arguments. Remove unused variables.
......
......@@ -616,7 +616,7 @@ The result of the body appears to the compiler as a quoted constant."
(declare (debug (form &optional sexp)))
(if (cl--compiling-file)
(let* ((temp (cl-gentemp "--cl-load-time--"))
(set `(set ',temp ,form)))
(set `(setq ,temp ,form)))
(if (and (fboundp 'byte-compile-file-form-defmumble)
(boundp 'this-kind) (boundp 'that-one))
(fset 'byte-compile-file-form
......
......@@ -217,13 +217,15 @@ instead the assignment is turned into something equivalent to
temp)
so as to preserve the semantics of `setf'."
(declare (debug (sexp (&or symbolp lambda-expr) &optional sexp)))
(when (eq 'lambda (car-safe setter))
(message "Use `gv-define-setter' or name %s's setter function" name))
`(gv-define-setter ,name (val &rest args)
,(if fix-return
`(macroexp-let2 nil v val
`(progn
(,',setter ,@(append args (list v)))
(,',setter ,@args ,v)
,v))
`(cons ',setter (append args (list val))))))
``(,',setter ,@args ,val))))
;;; Typical operations on generalized variables.
......
......@@ -55,30 +55,29 @@
(defsubst timer--check (timer)
(or (timerp timer) (signal 'wrong-type-argument (list #'timerp timer))))
(defun timer--time-setter (timer time)
(timer--check timer)
(setf (timer--high-seconds timer) (pop time))
(let ((low time) (usecs 0) (psecs 0))
(when (consp time)
(setq low (pop time))
(when time
(setq usecs (pop time))
(when time
(setq psecs (car time)))))
(setf (timer--low-seconds timer) low)
(setf (timer--usecs timer) usecs)
(setf (timer--psecs timer) psecs)
time))
;; Pseudo field `time'.
(defun timer--time (timer)
(declare (gv-setter timer--time-setter))
(list (timer--high-seconds timer)
(timer--low-seconds timer)
(timer--usecs timer)
(timer--psecs timer)))
(gv-define-setter timer--time (time timer)
(macroexp-let2 nil val time
`(progn
(timer--check ,timer)
(setf (timer--high-seconds ,timer) (pop ,val))
(let ((low ,val) (usecs 0) (psecs 0))
(when (consp ,val)
(setq low (pop ,val))
(when ,val
(setq usecs (pop ,val))
(when ,val
(setq psecs (car ,val)))))
(setf (timer--low-seconds ,timer) low)
(setf (timer--usecs ,timer) usecs)
(setf (timer--psecs ,timer) psecs))
,val)))
(defun timer-set-time (timer time &optional delta)
"Set the trigger time of TIMER to TIME.
TIME must be in the internal format returned by, e.g., `current-time'.
......
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