File: get-recognized-gfm-languages.el

package info (click to toggle)
markdown-mode 2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,232 kB
  • sloc: lisp: 15,415; makefile: 60; sh: 17
file content (15 lines) | stat: -rw-r--r-- 548 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
;; -*- lexical-binding: t; -*-

(require 'cl-lib)
(require 'url)

(let ((urlbuf
       (url-retrieve-synchronously
        "https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml"
        t)))
  (prog1 (with-current-buffer urlbuf
           (goto-char url-http-end-of-headers)
           (cl-loop while (re-search-forward "^\\([^#[:space:]][^:\n]*\\):" nil t)
                    for lang = (match-string-no-properties 1)
                    collect (replace-regexp-in-string " " "-" lang)))
    (kill-buffer urlbuf)))