Use cl-lib macros instead of cl.el

And fix arguments of error callback function
master
Syohei YOSHIDA 10 years ago
parent 6d2e063856
commit 4b9dfa937f
  1. 11
      webpaste.el

@ -7,7 +7,7 @@
;; Package-Version: 0.0.1 ;; Package-Version: 0.0.1
;; Version: 0.0.1 ;; Version: 0.0.1
;; Keywords: convenience, comm, paste ;; Keywords: convenience, comm, paste
;; Package-Requires: ((emacs "24.1") (request "0.2.0")) ;; Package-Requires: ((emacs "24.1") (request "0.2.0") (cl-lib "0.5"))
;;; Commentary: ;;; Commentary:
@ -35,6 +35,7 @@
;;; Code: ;;; Code:
(require 'request) (require 'request)
(require 'cl-lib)
(defgroup webpaste nil (defgroup webpaste nil
@ -73,11 +74,11 @@ each run.")
:type "POST" :type "POST"
:data post-data :data post-data
:parser 'buffer-string :parser 'buffer-string
:success (function* (lambda (&key data &allow-other-keys) :success (cl-function (lambda (&key data &allow-other-keys)
(when data (when data
(webpaste-return-url data)))) (webpaste-return-url data))))
:error :error
(function* (lambda (&key error-thrown &allow-other-keys&rest _) (cl-function (lambda (&key error-thrown &allow-other-keys)
(message "Got error: %S" error-thrown) (message "Got error: %S" error-thrown)
(webpaste-paste-text text))))) (webpaste-paste-text text)))))
nil)) nil))
@ -100,11 +101,11 @@ each run.")
:data post-data :data post-data
:parser 'buffer-string :parser 'buffer-string
:success :success
(function* (lambda (&key response &allow-other-keys) (cl-function (lambda (&key response &allow-other-keys)
(webpaste-return-url (webpaste-return-url
(request-response-header response "Location")))) (request-response-header response "Location"))))
:error :error
(function* (lambda (&key error-thrown &allow-other-keys&rest _) (cl-function (lambda (&key error-thrown &allow-other-keys)
(message "Got error: %S" error-thrown) (message "Got error: %S" error-thrown)
(webpaste-paste-text text))))) (webpaste-paste-text text)))))
nil))) nil)))

Loading…
Cancel
Save