Skip to content

Commit

Permalink
Fix language collect script
Browse files Browse the repository at this point in the history
- Original code does not return language list. It returns value of
  kill-buffer
- Original code ignores language which contains space like 'Emacs Lisp'
- Replace space with '-' like 'Emacs Lisp' -> 'Emacs-Lisp'
  • Loading branch information
syohex committed Jan 21, 2016
1 parent 40f00a5 commit 8a3c9a5
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions scripts/get-recognized-gfm-languages.el
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
(url-retrieve-synchronously
"https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml"
t)))
(with-current-buffer urlbuf
(goto-char (point-min))
;; get past http headers
(re-search-forward "^$")
(cl-loop while (re-search-forward "^\\([^#[:space:]]+?\\):" nil t)
collect (match-string-no-properties 1)))
(kill-buffer urlbuf))
(prog1 (with-current-buffer urlbuf
(goto-char (point-min))
;; get past http headers
(re-search-forward "^$")
(cl-loop while (re-search-forward "^\\([^#[:space:]][^:]+\\):" nil t)
for lang = (match-string-no-properties 1)
collect (replace-regexp-in-string " " "-" lang)))
(kill-buffer urlbuf)))

0 comments on commit 8a3c9a5

Please sign in to comment.