Browse Source

Fix byte compilatin warnings

workspaces
Nicolas Petton 6 years ago
parent
commit
51cd0ce49f
6 changed files with 16 additions and 15 deletions
  1. +1
    -1
      jade-backend.el
  2. +1
    -1
      jade-chrome.el
  3. +7
    -5
      jade-debugger.el
  4. +2
    -2
      jade-interaction.el
  5. +1
    -1
      jade-render.el
  6. +4
    -5
      jade-repl.el

+ 1
- 1
jade-backend.el View File

@ -62,7 +62,7 @@ When called interactively, prompt for a confirmation first."
(interactive)
(unless jade-connection
(user-error "No active connection to close"))
(when (or (not (called-interactively-p))
(when (or (not (called-interactively-p 'interactive))
(y-or-n-p (format "Do you really want to close the connection to %s ? "
(map-elt jade-connection 'url))))
(jade-backend-close-connection (jade-backend) jade-connection)


+ 1
- 1
jade-chrome.el View File

@ -44,7 +44,7 @@
(defun jade-chrome--get-tabs-data (host port callback)
"Get the list of open tabs on HOST:PORT and evaluate CALLBACK with it."
(url-retrieve (format "http://%s:%s/json" host port)
(lambda (status)
(lambda (_status)
;; TODO: handle errors
(funcall callback (jade-chrome--read-tab-data)))))


+ 7
- 5
jade-debugger.el View File

@ -39,7 +39,8 @@
(defcustom jade-debugger-major-mode
#'js-mode
"Major mode used in debugger buffers."
:group 'jade-debugger)
:group 'jade-debugger
:type 'function)
(defvar jade-debugger-buffer nil "Buffer used for debugging JavaScript sources.")
@ -83,10 +84,11 @@
source)
(erase-buffer)
(insert source))
(goto-line (1+ line))
(goto-char (point-min))
(forward-line line)
(forward-char column)
(jade-debugger-setup-overlay-arrow)
(jade-debugger-highlight-node frame))))
(jade-debugger-highlight-node))))
(defun jade-debugger-setup-overlay-arrow ()
(let ((pos (line-beginning-position)))
@ -94,7 +96,7 @@
(setq overlay-arrow-position (make-marker))
(set-marker overlay-arrow-position pos (current-buffer))))
(defun jade-debugger-highlight-node (frame)
(defun jade-debugger-highlight-node ()
(let ((beg (point))
(end (line-end-position)))
(remove-overlays)
@ -251,7 +253,7 @@ Unless NO-POP is non-nil, pop the locals buffer."
(goto-char (point-max))
(jade-render-keyword description)
(insert "\n\n")
(jade-render-properties properties scope)
(jade-render-properties properties)
(insert "\n")))
(unless no-pop
(pop-to-buffer buf))))


+ 2
- 2
jade-interaction.el View File

@ -56,14 +56,14 @@ current buffer."
(jade-interaction--ensure-connection)
(jade-backend-evaluate (jade-backend)
(js2-node-string (jade-interaction-node-before-point))
(lambda (result error)
(lambda (result _error)
(jade-inspector-inspect result))))
(defun jade-interaction-node-before-point ()
"Return the node before point to be evaluated."
(save-excursion
(forward-comment -1)
(while (looking-back "[:,]")
(while (looking-back "[:,]" nil)
(backward-char 1))
(backward-char 1)
(let* ((node (js2-node-at-point))


+ 1
- 1
jade-render.el View File

@ -87,7 +87,7 @@ definitions."
(when preview
(insert preview))))
(defun jade-render-properties (properties value)
(defun jade-render-properties (properties)
(seq-map #'jade-render-property
(seq-sort (lambda (p1 p2)
(string< (map-elt p1 'name)


+ 4
- 5
jade-repl.el View File

@ -57,8 +57,7 @@
(defun jade-repl-get-buffer-create (connection)
"Return a REPL buffer for CONNECTION.
If no buffer exists, create one."
(let* ((ws (map-elt connection 'ws))
(url (map-elt connection 'url))
(let* ((url (map-elt connection 'url))
(buf (get-buffer-create (jade-repl-buffer-name url))))
(jade-repl-setup-buffer buf connection)
buf))
@ -168,7 +167,7 @@ If URL is nil, use the current connection."
When ERROR is non-nil, use the error face."
(with-current-buffer (jade-repl-get-buffer)
(save-excursion
(end-of-buffer)
(goto-char (point-max))
(insert-before-markers "\n")
(set-marker jade-repl-output-start-marker (point))
(jade-render-value value error)
@ -243,14 +242,14 @@ DIRECTION is `forward' or `backard' (in the history list)."
(interactive)
(let ((inhibit-read-only t))
(save-excursion
(beginning-of-buffer)
(goto-char (point-min))
(delete-region (point) jade-repl-prompt-start-marker))))
(defun jade-repl--handle-connection-closed ()
"Display a message when the connection is closed."
(with-current-buffer (jade-repl-get-buffer)
(save-excursion
(end-of-buffer)
(goto-char (point-min))
(insert-before-markers "\n")
(set-marker jade-repl-output-start-marker (point))
(insert "Connection closed. ")


Loading…
Cancel
Save