Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Roll back CL adaptor layer

  • Loading branch information...
commit 29378740232babecc2124644425a81f1146a91f2 1 parent 0552ab8
@jscheid authored
View
1  Makefile
@@ -23,7 +23,6 @@ all: byte-compile
ELISP_SOURCES = \
kite-breakpoint.el \
- kite-cl.el \
kite-color.el \
kite-console.el \
kite-debug.el \
View
26 kite-breakpoint.el
@@ -32,8 +32,8 @@
;;; Code:
-(require 'kite-cl)
(require 'kite-global)
+(require 'cl)
(require 'browse-url nil t)
@@ -74,7 +74,7 @@
"WebKit DOM breakpoint names, taken from
Source/WebCore/dom/EventNames.h")
-(kite--defstruct
+(defstruct
(kite-breakpoint
(:constructor nil)) ; no default constructor
to-string-function
@@ -82,7 +82,7 @@
remove-function
sort-priority)
-(kite--defstruct
+(defstruct
(kite-next-instruction-breakpoint
(:include kite-breakpoint)
(:constructor nil) ; no default constructor
@@ -106,7 +106,7 @@
"Remove a breakpoint of type `next-instruction'"
(kite-send "Debugger.resume" :success-function response-handler))
-(kite--defstruct
+(defstruct
(kite-all-exceptions-breakpoint
(:include kite-breakpoint)
(:constructor nil) ; no default constructor
@@ -127,7 +127,7 @@
:params '(:state "all")
:success-function response-handler))
-(kite--defstruct
+(defstruct
(kite-uncaught-exceptions-breakpoint
(:include kite-breakpoint)
(:constructor nil) ; no default constructor
@@ -155,7 +155,7 @@
;; Location breakpoints
-(kite--defstruct
+(defstruct
(kite-location-breakpoint
(:include kite-breakpoint)
(:constructor nil) ; no default constructor
@@ -174,7 +174,7 @@
;; DOM Node breakpoints
-(kite--defstruct
+(defstruct
(kite-dom-node-breakpoint
(:include kite-breakpoint)
(:constructor nil) ; no default constructor
@@ -218,7 +218,7 @@
;; DOM Event breakpoints
-(kite--defstruct
+(defstruct
(kite-dom-event-breakpoint
(:include kite-breakpoint)
(:constructor nil) ; no default constructor
@@ -250,7 +250,7 @@
;; Instrumentation breakpoints
-(kite--defstruct
+(defstruct
(kite-instrumentation-breakpoint
(:include kite-breakpoint)
(:constructor nil) ; no default constructor
@@ -282,7 +282,7 @@
;; XHR breakpoints
-(kite--defstruct
+(defstruct
(kite-xhr-breakpoint
(:include kite-breakpoint)
(:constructor nil) ; no default constructor
@@ -329,8 +329,8 @@
;; High-level functions
(defun kite--session-has-breakpoint (kite-session predicate)
- (kite--find-if predicate
- (kite-session-breakpoint-list kite-session)))
+ (find-if predicate
+ (kite-session-breakpoint-list kite-session)))
(defun kite--session-add-breakpoint (kite-session breakpoint)
(lexical-let ((lex-kite-session kite-session)
@@ -339,7 +339,7 @@
breakpoint
(lambda (result)
(setf (kite-session-breakpoint-list lex-kite-session)
- (kite--stable-sort
+ (stable-sort
(cons lex-breakpoint
(kite-session-breakpoint-list lex-kite-session))
(lambda (a b)
View
64 kite-cl.el
@@ -1,64 +0,0 @@
-;;; kite-net.el --- Temporary Kite Common Lisp adaptor
-
-;; Copyright (C) 2012 Julian Scheid
-
-;; Author: Julian Scheid <julians37@gmail.com>
-;; Keywords: tools
-;; Package: kite
-;; Compatibility: GNU Emacs 24
-
-;; This file is not part of GNU Emacs.
-
-;; Kite is free software: you can redistribute it and/or modify it
-;; under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; Kite is distributed in the hope that it will be useful, but WITHOUT
-;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
-;; License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with Kite. If not, see <http://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This package provides aliases to smooth out the differences between
-;; cl and cl-lib. It is intended to be temporary, to be removed once
-;; cl-lib is available widely.
-;;
-;; It is part of Kite, a WebKit inspector front-end.
-
-
-;;; Code:
-
-(if (require 'cl-lib nil t)
- (progn
- (defalias 'kite--defstruct 'cl-defstruct)
- (defalias 'kite--defun 'cl-defun)
- (defalias 'kite--every 'cl-every)
- (defalias 'kite--find-if 'cl-find-if)
- (defalias 'kite--flet 'cl-flet)
- (defalias 'kite--incf 'cl-incf)
- (defalias 'kite--mapcar 'cl-mapcar)
- (defalias 'kite--position 'cl-position)
- (defalias 'kite--remove-if 'cl-remove-if)
- (defalias 'kite--stable-sort 'cl-stable-sort)
- (defalias 'kite--subseq 'cl-subseq))
- (require 'cl)
- (defalias 'kite--defstruct 'defstruct)
- (defalias 'kite--defun 'defun*)
- (defalias 'kite--every 'every)
- (defalias 'kite--find-if 'find-if)
- (defalias 'kite--flet 'flet)
- (defalias 'kite--incf 'incf)
- (defalias 'kite--mapcar 'mapcar*)
- (defalias 'kite--position 'position)
- (defalias 'kite--remove-if 'remove-if)
- (defalias 'kite--stable-sort 'stable-sort)
- (defalias 'kite--subseq 'subseq))
-
-(provide 'kite-cl)
-
-;;; kite-cl.el ends here
View
28 kite-color.el
@@ -33,19 +33,19 @@
;;; Code:
-(require 'kite-cl)
+(require 'cl)
(require 'color)
(eval-when-compile
(require 'rx))
-(kite--defun kite--make-color-image
- (rgba-float-color
- &key
- (width 16)
- (height 16)
- (checker-size 8)
- (bg-color-1 (color-hsl-to-rgb 0 0 1))
- (bg-color-2 (color-hsl-to-rgb 0 0 0.5)))
+(defun* kite--make-color-image
+ (rgba-float-color
+ &key
+ (width 16)
+ (height 16)
+ (checker-size 8)
+ (bg-color-1 (color-hsl-to-rgb 0 0 1))
+ (bg-color-2 (color-hsl-to-rgb 0 0 0.5)))
"Return an image that visualizes the given RGBA-FLOAT-COLOR,
which should be a list containing four float values in the range
0..1.
@@ -72,10 +72,10 @@ for the checkerboard tiles."
(mod (/ row checker-size) 2))
bg-color-list)))
(dolist (component
- (kite--mapcar (lambda (fg bg)
- (+ (* fg alpha)
- (* bg (- 1 alpha))))
- rgba-float-color bg-color))
+ (mapcar* (lambda (fg bg)
+ (+ (* fg alpha)
+ (* bg (- 1 alpha))))
+ rgba-float-color bg-color))
(princ (format "%d " (round (* scale component)))))
(setq column (1+ column)))))
(princ "\n")
@@ -411,7 +411,7 @@ four float values in the range 0..1 corresponding to red, green,
blue, and alpha otherwise. This function does not deal in color
spaces or color profiles and thus its result should be treated as
a 'raw' color value."
- (kite--flet
+ (flet
((clamp (n)
(max 0.0 (min 1.0 n)))
(color-hue-to-rgb (v1 v2 h)
View
8 kite-console.el
@@ -31,7 +31,7 @@
;;; Code:
-(require 'kite-cl)
+(require 'cl)
(require 'kite-debug)
(require 'kite-dom)
(require 'kite-global)
@@ -919,9 +919,9 @@ doesn't support asynchronicity."
(kite--get-properties-fast
(if (> (length components) 1)
(mapconcat 'identity
- (kite--subseq components
- 0
- (- (length components) 1))
+ (subseq components
+ 0
+ (- (length components) 1))
".")
"window")
(concat "^" (regexp-quote last-component))
View
4 kite-debug.el
@@ -33,10 +33,10 @@
;;; Code:
(require 'kite-breakpoint)
-(require 'kite-cl)
(require 'kite-sourcemap)
(require 'kite-global)
(require 'kite-object)
+(require 'cl)
(require 'url-expand)
(require 'ewoc)
(require 'wid-edit)
@@ -379,7 +379,7 @@ is available, go to the original location instead."
column))
(url (plist-get original-source :url))
(url-parts (url-generic-parse-url url)))
- (kite--flet
+ (flet
((after-load ()
(goto-char (point-min))
(forward-line
View
20 kite-dom.el
@@ -32,9 +32,9 @@
;;; Code:
(require 'kite-global)
-(require 'kite-cl)
(require 'kite-color)
(require 'kite-dom-css)
+(require 'cl)
(require 'widget)
;; Try loading nxml-mode so we can steal their faces
(require 'nxml-mode nil t)
@@ -42,7 +42,7 @@
(eval-when-compile
(require 'wid-edit))
-(kite--defstruct (node-region)
+(defstruct (node-region)
line-begin
line-end
outer-begin
@@ -58,7 +58,7 @@
node-id
node-type)
-(kite--defstruct (attr-region)
+(defstruct (attr-region)
outer-begin
outer-end
value-begin
@@ -430,7 +430,7 @@ line under mouse and the corresponding DOM node in the browser."
"Insert the whole HTML document into the DOM buffer, given the
ROOT-PLIST as received in the response to `DOM.getDocument'."
(let ((html-plist
- (kite--find-if
+ (find-if
(lambda (child-plist)
(string= (plist-get child-plist :nodeName) "HTML"))
(plist-get root-plist :children))))
@@ -614,7 +614,7 @@ is the last child."
(set-marker (node-region-outer-end child) save-point)
(set-marker (node-region-line-end child) (point)))))
- (kite--mapcar
+ (mapcar*
(lambda (overlay old-length)
(kite--log "overlay %s old-length %s" overlay old-length)
(move-overlay overlay (overlay-start overlay) (+ (overlay-start overlay) old-length)))
@@ -625,7 +625,7 @@ is the last child."
LOADP, recursively and asynchronously load and insert children.
FIXME: this needs to be smarter about when to load children."
- (kite--flet
+ (flet
((indent-prefix (indent node-id)
(propertize
(make-string (* kite-dom-offset indent) 32)
@@ -938,17 +938,17 @@ child node into a DOM element."
(if (eq previous-node-id 0)
(push new-node-region (node-region-children node-region))
(let ((insert-position
- (1+ (kite--position
+ (1+ (position
previous-node-region
(node-region-children node-region)))))
(setf (node-region-children node-region)
(append
- (kite--subseq
+ (subseq
(node-region-children node-region)
0
insert-position)
(list new-node-region)
- (kite--subseq
+ (subseq
(node-region-children node-region)
insert-position)))))
(setf (node-region-parent new-node-region) node-region))
@@ -1053,7 +1053,7 @@ Negative ARG means move backward."
(let* ((node-region (kite--dom-node-region-at-point))
(parent-children (node-region-children
(node-region-parent node-region)))
- (node-position (kite--position node-region parent-children))
+ (node-position (position node-region parent-children))
(new-position (max 0 (min (+ node-position arg)
(- (length parent-children) 1))))
(next-node-region (nth new-position parent-children)))
View
8 kite-global.el
@@ -29,7 +29,7 @@
;;; Code:
-(require 'kite-cl)
+(require 'cl)
(require 'websocket)
(require 'json)
@@ -86,7 +86,7 @@
(defconst kite--debugger-state-paused
(propertize "Paused" 'face 'warning))
-(kite--defstruct (kite-session)
+(defstruct (kite-session)
"Represents an active debugging session, i.e. a connection to a
remote WebKit debugger instance."
websocket
@@ -113,7 +113,7 @@ remote WebKit debugger instance."
(dom-nodes (make-hash-table))
document-root)
-(kite--defstruct (kite-script-info)
+(defstruct (kite-script-info)
"Information about a script used in a debugging session. Used
to cache data received via the ` Debugger.scriptParsed'
notification."
@@ -130,7 +130,7 @@ notification."
(defun kite--default-error-handler (error-result)
(error "Kite: %s" (plist-get error-result :message)))
-(kite--defun kite-send (method &key params success-function error-function callback-args)
+(defun* kite-send (method &key params success-function error-function callback-args)
"Send a JSON-RPC 2.0 packet to the remote debugger for the
current session. The current session is retrieved from variable
`kite-session', which is buffer-local or taken from a let
View
10 kite-net.el
@@ -31,9 +31,9 @@
;;; Code:
-(require 'kite-cl)
(require 'kite-global)
(require 'kite-util)
+(require 'cl)
(require 'ewoc)
(require 'websocket)
@@ -517,10 +517,10 @@ point."
:response))
(mime-type (plist-get response :mimeType))
(buffer-mode
- (nth 1 (kite--find-if (lambda (candidate)
- (string-match (car candidate)
- mime-type))
- kite--mime-map)))
+ (nth 1 (find-if (lambda (candidate)
+ (string-match (car candidate)
+ mime-type))
+ kite--mime-map)))
(buffer-name (format "%s (%s)"
(plist-get response :url)
request-id))
View
22 kite-object.el
@@ -31,8 +31,8 @@
;;; Code:
-(require 'kite-cl)
(require 'kite-global)
+(require 'cl)
(require 'wid-edit)
(defcustom kite-short-object-max-properties 5
@@ -145,7 +145,7 @@ given PROPERTIES vector. The representation will look like
`Object {prop: value, prop: value, ...}'. A maximum of
`kite-short-object-max-properties' properties will be included."
(let ((properties-without-proto
- (kite--remove-if
+ (remove-if
(lambda (element)
(string= "__proto__" (plist-get element :name)))
properties)))
@@ -156,10 +156,10 @@ given PROPERTIES vector. The representation will look like
"%s: %s"
(plist-get element :name)
(kite--format-object (plist-get element :value))))
- (kite--subseq properties-without-proto
- 0
- (min kite-short-object-max-properties
- (length properties-without-proto)))
+ (subseq properties-without-proto
+ 0
+ (min kite-short-object-max-properties
+ (length properties-without-proto)))
", ")
(when (> (length properties-without-proto)
kite-short-object-max-properties)
@@ -170,7 +170,7 @@ given PROPERTIES vector. The representation will look like
"Return a short representation of the array described by the
given PROPERTIES vector."
(let ((array-elements
- (kite--remove-if
+ (remove-if
(lambda (element)
(or (not (eq t (plist-get element :enumerable)))
(string= "length" (plist-get element :name))))
@@ -181,10 +181,10 @@ given PROPERTIES vector."
(lambda (element)
(kite--format-object
(plist-get element :value)))
- (kite--subseq array-elements
- 0
- (min kite-short-array-max-elements
- (length array-elements)))
+ (subseq array-elements
+ 0
+ (min kite-short-array-max-elements
+ (length array-elements)))
", ")
(when (> (length array-elements)
kite-short-array-max-elements)
View
22 kite-sourcemap.el
@@ -40,7 +40,7 @@
;;; Code:
-(require 'kite-cl)
+(require 'cl)
(defconst kite--vlq-base-shift 5)
@@ -60,10 +60,10 @@ ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
(dolist (char
(string-to-list base64-chars))
(puthash char index map)
- (kite--incf index))
+ (incf index))
map))
-(kite--defstruct (kite-source-mapping)
+(defstruct (kite-source-mapping)
"Holds the parsed mapping coordinates from the source map's
`mappings' attribute."
generated-line
@@ -73,7 +73,7 @@ ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")
original-column
name)
-(kite--defstruct (kite-source-map)
+(defstruct (kite-source-map)
"Representation of a parsed source map suitable for fast
lookup."
names
@@ -113,8 +113,8 @@ values, that is a list (VALUE STRING-REST)."
(setq continuation
(not (eq 0 (logand digit kite--vlq-continuation-bit))))
(setq digit (logand digit kite--vlq-base-mask))
- (kite--incf result (lsh digit shift)))
- (kite--incf shift kite--vlq-base-shift)
+ (incf result (lsh digit shift)))
+ (incf shift kite--vlq-base-shift)
(setq string-as-list (cdr string-as-list)))
(list :value (kite--from-vlq-signed result)
:rest string-as-list)))
@@ -142,7 +142,7 @@ object, and return a `kite-source-map' struct."
(previous-original-column 0)
(previous-source 0)
(previous-name 0))
- (kite--flet
+ (flet
((starts-with-mapping-separator (string)
(or (null string)
(eq (car string) ?,)
@@ -150,7 +150,7 @@ object, and return a `kite-source-map' struct."
(while string
(cond
((eq (car string) ?\;)
- (kite--incf generated-line)
+ (incf generated-line)
(setq string (cdr string))
(setq previous-generated-column 0))
((eq (car string) ?,)
@@ -177,7 +177,7 @@ object, and return a `kite-source-map' struct."
(elt sources
(+ previous-source
(plist-get temp :value)))))
- (kite--incf previous-source (plist-get temp :value))
+ (incf previous-source (plist-get temp :value))
(setq string (plist-get temp :rest)))
(when (starts-with-mapping-separator string)
@@ -192,7 +192,7 @@ object, and return a `kite-source-map' struct."
(kite-source-mapping-original-line mapping))
;; Lines are stored 0-based
- (kite--incf (kite-source-mapping-original-line mapping))
+ (incf (kite-source-mapping-original-line mapping))
(setq string (plist-get temp :rest)))
@@ -216,7 +216,7 @@ object, and return a `kite-source-map' struct."
(setf (kite-source-mapping-name mapping)
(elt names (+ previous-name
(plist-get temp :value))))
- (kite--incf previous-name (plist-get temp :value))
+ (incf previous-name (plist-get temp :value))
(setq string (plist-get temp :rest)))))
View
1  kite-tests.el
@@ -29,7 +29,6 @@
;; It is part of Kite, a WebKit inspector front-end.
(require 'kite)
-(require 'kite-cl)
(require 'kite-dom-tests)
(require 'kite-breakpoint-tests)
(require 'kite-console-tests)
View
8 kite-util.el
@@ -31,8 +31,8 @@
;;; Code:
-(require 'kite-cl)
(require 'kite-global)
+(require 'cl)
(require 'color)
(require 'url-parse)
(require 'wid-edit)
@@ -49,7 +49,7 @@
background color of FACE. (If FACE doesn't have a background
color set, the current frame's background color will be used
instead.)"
- (kite--flet
+ (flet
((lerp (a b w)
(+ (* a w)
(* b (- 1 w)))))
@@ -72,13 +72,13 @@ which should be a sequence of strings. Naive implementation."
""
(let ((max-length (length (car strings))))
(while (let ((prefix-candidate (substring (car strings) 0 max-length)))
- (not (kite--every
+ (not (every
(apply-partially 'string-prefix-p prefix-candidate)
strings)))
(setq max-length (- max-length 1)))
(substring (car strings) 0 max-length))))
-(kite--defun kite--fill-overflow (string width &key (align 'left) (trim 'right))
+(defun* kite--fill-overflow (string width &key (align 'left) (trim 'right))
(let ((string-length (length string)))
(if (> string-length width)
(if (eq 'right trim)
View
10 kite.el
@@ -36,8 +36,8 @@
(require 'json)
(require 'websocket)
(require 'url-parse)
+(require 'cl)
-(require 'kite-cl)
(require 'kite-debug)
(require 'kite-dom)
(require 'kite-memory)
@@ -287,7 +287,7 @@ enters the empty string at the prompt."
;; For each human readable identifier (url or title), see
;; if it is ambiguous
- (kite--flet
+ (flet
((add-item (item url)
(let ((existing (gethash item available-strings '(0))))
(puthash item
@@ -307,7 +307,7 @@ enters the empty string at the prompt."
;; Final pass, disambiguate and rearrange
- (kite--flet
+ (flet
((disambiguate (string websocket-url)
(let ((existing
(gethash string available-strings)))
@@ -637,7 +637,7 @@ context is created."
(setf (kite-session-last-message kite-session)
(plist-get packet :message))
(when (string= "error" (kite--get packet :message :level))
- (kite--incf (kite-session-error-count kite-session)))
+ (incf (kite-session-error-count kite-session)))
(kite--mode-line-update))
(defun kite--messageRepeatCountUpdated (websocket-url packet)
@@ -645,7 +645,7 @@ context is created."
(when (string= "error"
(plist-get (kite-session-last-message kite-session)
:level))
- (kite--incf (kite-session-error-count kite-session)))
+ (incf (kite-session-error-count kite-session)))
(kite--mode-line-update))
(defun kite--globalObjectCleared (websocket-url packet)
Please sign in to comment.
Something went wrong with that request. Please try again.