+2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * autorevert.el (auto-revert-notify-handler): Use memq.
+ Hide assertion failure.
+
+ * skeleton.el: Use cl-lib.
+ (skeleton-further-elements): Use defvar-local.
+ (skeleton-insert): Use cl-progv.
+
2013-06-05 Teodor Zlatanov <tzz@lifelogs.com>
* progmodes/prog-mode.el (prog-prettify-symbols)
((featurep 'w32notify) (nth 2 event)))))
(defun auto-revert-notify-handler (event)
- "Handle an event returned from file notification."
+ "Handle an EVENT returned from file notification."
(when (auto-revert-notify-event-p event)
(let* ((descriptor (auto-revert-notify-event-descriptor event))
(action (auto-revert-notify-event-action event))
(cl-assert descriptor)
(cond
((featurep 'gfilenotify)
- (cl-assert (or (eq 'attribute-changed action)
- (eq 'changed action)
- (eq 'created action)
- (eq 'deleted action))))
+ (cl-assert (memq action '(attribute-changed changed created deleted
+ ;; FIXME: I keep getting this action, so I
+ ;; added it here, but I have no idea what
+ ;; I'm doing. --Stef
+ changes-done-hint))
+ t))
((featurep 'inotify)
(cl-assert (or (memq 'attrib action)
(memq 'create action)
;;; Code:
+(eval-when-compile (require 'cl-lib))
+
;; page 1: statement skeleton language definition & interpreter
;; page 2: paired insertion
;; page 3: mirror-mode, an example for setting up paired insertion
"When non-nil, indent rigidly under current line for element `\\n'.
Else use mode's `indent-line-function'.")
-(defvar skeleton-further-elements ()
+(defvar-local skeleton-further-elements ()
"A buffer-local varlist (see `let') of mode specific skeleton elements.
These variables are bound while interpreting a skeleton. Their value may
in turn be any valid skeleton element if they are themselves to be used as
skeleton elements.")
-(make-variable-buffer-local 'skeleton-further-elements)
-
(defvar skeleton-subprompt
(substitute-command-keys
skeleton-modified skeleton-point resume: help input v1 v2)
(setq skeleton-positions nil)
(unwind-protect
- (eval `(let ,skeleton-further-elements
- (skeleton-internal-list skeleton str)))
+ (cl-progv
+ (mapcar #'car skeleton-further-elements)
+ (mapcar (lambda (x) (eval (cadr x))) skeleton-further-elements)
+ (skeleton-internal-list skeleton str))
(run-hooks 'skeleton-end-hook)
(sit-for 0)
(or (pos-visible-in-window-p beg)