X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/5ed99d3685cc8d13f8e4c63ad449a6e4d63c8eb0..05d76dba6604f78e4b2b7b9f8b30c916cad7d32a:/lisp/emacs-lisp/ewoc.el?ds=sidebyside diff --git a/lisp/emacs-lisp/ewoc.el b/lisp/emacs-lisp/ewoc.el index a71f3c7244..932b7fb262 100644 --- a/lisp/emacs-lisp/ewoc.el +++ b/lisp/emacs-lisp/ewoc.el @@ -1,6 +1,6 @@ -;;; ewoc.el --- utility to maintain a view of a list of objects in a buffer +;;; ewoc.el --- utility to maintain a view of a list of objects in a buffer -*- lexical-binding: t -*- -;; Copyright (C) 1991-2011 Free Software Foundation, Inc. +;; Copyright (C) 1991-2016 Free Software Foundation, Inc. ;; Author: Per Cederqvist ;; Inge Wallin @@ -26,7 +26,7 @@ ;;; Commentary: ;; Ewoc Was Once Cookie -;; But now it's Emacs' Widget for Object Collections +;; But now it's Emacs's Widget for Object Collections ;; As the name implies this derives from the `cookie' package (part ;; of Elib). The changes are pervasive though mostly superficial: @@ -96,11 +96,11 @@ ;;; Code: -(eval-when-compile (require 'cl)) +(eval-when-compile (require 'cl-lib)) ;; The doubly linked list is implemented as a circular list with a dummy ;; node first and last. The dummy node is used as "the dll". -(defstruct (ewoc--node +(cl-defstruct (ewoc--node (:type vector) ;ewoc--node-nth needs this (:constructor nil) (:constructor ewoc--node-create (start-marker data))) @@ -140,7 +140,7 @@ and (ewoc--node-nth dll -1) returns the last node." ;;; The ewoc data type -(defstruct (ewoc +(cl-defstruct (ewoc (:constructor nil) (:constructor ewoc--create (buffer pretty-printer dll)) (:conc-name ewoc--)) @@ -216,10 +216,9 @@ NODE and leaving the new node's start there. Return the new node." (ewoc--adjust m (point) R dll))) (defun ewoc--wrap (func) - (lexical-let ((ewoc--user-pp func)) - (lambda (data) - (funcall ewoc--user-pp data) - (insert "\n")))) + (lambda (data) + (funcall func data) + (insert "\n"))) ;;; ===========================================================================