aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Dürer <me@hdurer.net>2017-05-02 20:39:09 +0100
committerJohnson Denen <johnson.denen@gmail.com>2017-05-05 15:01:50 -0400
commit4d0bd43c0ede0159c0f0130a5565ea5a6511997a (patch)
tree271f9ccfc077eb45885a05bf6a40ebb8e60c9565
parent9c8df73c253640f54e89c0c170336a9993290e6c (diff)
Clean up use of progn.
- Lambda, defun, let, etc. all have an implicit progn. - A progn with a single form is identical to that single form.
-rw-r--r--lisp/mastodon-auth.el7
-rw-r--r--lisp/mastodon-http.el10
-rw-r--r--lisp/mastodon-inspect.el12
-rw-r--r--lisp/mastodon-tl.el5
-rw-r--r--lisp/mastodon-toot.el14
5 files changed, 21 insertions, 27 deletions
diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el
index 1586e84..1ceb652 100644
--- a/lisp/mastodon-auth.el
+++ b/lisp/mastodon-auth.el
@@ -67,10 +67,9 @@
Generate token and set `mastodon-auth--token' if nil."
(or mastodon-auth--token
- (progn
- (let* ((json (mastodon-auth--get-token))
- (token (plist-get json :access_token)))
- (setq mastodon-auth--token token)))))
+ (let* ((json (mastodon-auth--get-token))
+ (token (plist-get json :access_token)))
+ (setq mastodon-auth--token token))))
(provide 'mastodon-auth)
;;; mastodon-auth.el ends here
diff --git a/lisp/mastodon-http.el b/lisp/mastodon-http.el
index 2b3f7dc..eb70a88 100644
--- a/lisp/mastodon-http.el
+++ b/lisp/mastodon-http.el
@@ -48,16 +48,14 @@
(defun mastodon-http--response-body (pattern)
"Return substring matching PATTERN from `mastodon-http--response'."
(let ((resp (mastodon-http--response)))
- (progn
- (string-match pattern resp)
- (match-string 0 resp))))
+ (string-match pattern resp)
+ (match-string 0 resp)))
(defun mastodon-http--status ()
"Return HTTP Response Status Code from `mastodon-http--response'."
(let* ((status-line (mastodon-http--response-body "^HTTP/1.*$")))
- (progn
- (string-match "[0-9][0-9][0-9]" status-line)
- (match-string 0 status-line))))
+ (string-match "[0-9][0-9][0-9]" status-line)
+ (match-string 0 status-line)))
(defun mastodon-http--triage (response success)
"Determine if RESPONSE was successful. Call SUCCESS if successful.
diff --git a/lisp/mastodon-inspect.el b/lisp/mastodon-inspect.el
index 989269e..9ae5049 100644
--- a/lisp/mastodon-inspect.el
+++ b/lisp/mastodon-inspect.el
@@ -39,12 +39,12 @@
(defun mastodon-inspect--dump-json-in-buffer (name json)
"Buffer NAME is opened and JSON in printed into it."
(switch-to-buffer-other-window name)
- (progn (setf print-level nil
- print-length nil)
- (insert (pp json t))
- (goto-char 1)
- (emacs-lisp-mode)
- (message "success")))
+ (setf print-level nil
+ print-length nil)
+ (insert (pp json t))
+ (goto-char 1)
+ (emacs-lisp-mode)
+ (message "success"))
(defun mastodon-inspect--toot ()
"Find next toot and dump its meta data into new buffer."
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index 9dade6c..e025a6e 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -248,9 +248,8 @@ Move forward (down) the timeline unless BACKWARD is non-nil."
(defun mastodon-tl--oldest-id ()
"Return toot-id from the bottom of the buffer."
- (progn
- (goto-char (point-max))
- (mastodon-tl--property 'toot-id t)))
+ (goto-char (point-max))
+ (mastodon-tl--property 'toot-id t))
(defun mastodon-tl--thread ()
"Open thread buffer for toot under `point'."
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 371d8ed..230277c 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -121,11 +121,10 @@ Set `mastodon-toot--content-warning' to nil."
("sensitive" . ,(when mastodon-toot--content-warning
(symbol-name t)))
("spoiler_text" . ,spoiler))))
- (progn
- (mastodon-toot--kill)
- (let ((response (mastodon-http--post endpoint args nil)))
- (mastodon-http--triage response
- (lambda () (message "Toot toot!")))))))
+ (mastodon-toot--kill)
+ (let ((response (mastodon-http--post endpoint args nil)))
+ (mastodon-http--triage response
+ (lambda () (message "Toot toot!"))))))
(defun mastodon-toot--reply ()
"Reply to toot at `point'."
@@ -151,9 +150,8 @@ Set `mastodon-toot--content-warning' to nil."
(bindings (remove nil (mapcar (lambda (i) (if (listp i) i))
(cadr binds)))))
(mapcar (lambda (b)
- (progn
- (setf (car b) (vector prefix (car b)))
- b))
+ (setf (car b) (vector prefix (car b)))
+ b)
bindings)))
(defun mastodon-toot--format-kbind-command (cmd)