Skip to content

Commit

Permalink
fold too long lines
Browse files Browse the repository at this point in the history
  • Loading branch information
mhayashi1120 committed Oct 25, 2013
1 parent 9a7f69d commit 2e31d6a
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions yagist.el
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,9 @@ Example:
`(("Authorization" . ,auth)))
(url-request-method method)
(url-max-redirection -1)
(url (if params (concat url "?" (yagist-make-query-string params)) url)))
(url (if params
(concat url "?" (yagist-make-query-string params))
url)))
(url-retrieve url callback (list url json-or-params))))

(defun yagist-request (method url callback &optional json-or-params)
Expand Down Expand Up @@ -368,8 +370,9 @@ Copies the URL into the kill ring."

;;;###autoload
(defun yagist-region-or-buffer (&optional private)
"Post either the current region, or if mark is not set, the current buffer as a new paste at gist.github.com
Copies the URL into the kill ring.
"Post either the current region, or if mark is not set, the
current buffer as a new paste at gist.github.com Copies the URL
into the kill ring.
With a prefix argument, makes a private paste."
(interactive "P")
Expand All @@ -379,8 +382,9 @@ With a prefix argument, makes a private paste."

;;;###autoload
(defun yagist-region-or-buffer-private ()
"Post either the current region, or if mark is not set, the current buffer as a new private paste at gist.github.com
Copies the URL into the kill ring."
"Post either the current region, or if mark is not set, the
current buffer as a new private paste at gist.github.com Copies
the URL into the kill ring."
(interactive)
(if (yagist-region-active-p)
(yagist-region (region-beginning) (region-end) t)
Expand Down Expand Up @@ -502,7 +506,8 @@ With a prefix argument, kill the buffer instead."
(propertize "Private Gist"
'font-lock-face '(bold underline)))
"\n")
(insert " " (propertize "Description: " 'font-lock-face 'bold) (or description "") "\n")
(insert " " (propertize "Description: " 'font-lock-face 'bold)
(or description "") "\n")
(insert " " (propertize "URL: " 'font-lock-face 'bold) url "\n")
(insert " " (propertize "Updated: " 'font-lock-face 'bold)
(format-time-string
Expand All @@ -511,13 +516,17 @@ With a prefix argument, kill the buffer instead."

(insert "\n\n")

(yagist-describe-insert-button "Fetch Repository" 'yagist-fetch-button gist)
(yagist-describe-insert-button "Browse" 'yagist-open-web-button gist)
(yagist-describe-insert-button
"Fetch Repository" 'yagist-fetch-button gist)
(yagist-describe-insert-button
"Browse" 'yagist-open-web-button gist)

(insert "\n\n")

(yagist-describe-insert-button "Edit Description" 'yagist-update-button gist)
(yagist-describe-insert-button "Delete Gist" 'yagist-delete-button gist)))
(yagist-describe-insert-button
"Edit Description" 'yagist-update-button gist)
(yagist-describe-insert-button
"Delete Gist" 'yagist-delete-button gist)))

(defun yagist-fetch-button (button)
"Called when a gist [Fetch] button has been pressed.
Expand Down Expand Up @@ -755,9 +764,11 @@ and displays the list."
(let ((url (match-string 1)))
;; public gist have decimal, private gist have hex id
(cond
((string-match "^git://gist.github.com/\\([0-9a-fA-F]+\\)\\.git$" url)
((string-match
"^git://gist.github.com/\\([0-9a-fA-F]+\\)\\.git$" url)
(match-string 1 url))
((string-match "^git@gist.github.com:\\([0-9a-fA-F]+\\)\\.git$" url)
((string-match
"^git@gist.github.com:\\([0-9a-fA-F]+\\)\\.git$" url)
(match-string 1 url)))))))))

(defun yagist-after-save-commit ()
Expand Down

0 comments on commit 2e31d6a

Please sign in to comment.