Commit fccdc796 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

* lisp/autorevert.el (auto-revert-notify-handler): Use memq.

Hide assertion failure.
* lisp/skeleton.el: Use cl-lib.
(skeleton-further-elements): Use defvar-local.
(skeleton-insert): Use cl-progv.
parent 398b4366
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)
......@@ -578,7 +578,7 @@ will use an up-to-date value of `auto-revert-interval'"
((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))
......@@ -591,10 +591,12 @@ will use an up-to-date value of `auto-revert-interval'"
(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)
......
......@@ -31,6 +31,8 @@
;;; 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
......@@ -84,13 +86,11 @@ The variables `v1' and `v2' are still set when calling this.")
"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
......@@ -260,8 +260,10 @@ When done with skeleton, but before going back to `_'-point call
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)
......
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