{"action":"created","issue":{"url":"https://api.github.com/repos/zilongshanren/Spacemacs-rocks/issues/24","repository_url":"https://api.github.com/repos/zilongshanren/Spacemacs-rocks","labels_url":"https://api.github.com/repos/zilongshanren/Spacemacs-rocks/issues/24/labels{/name}","comments_url":"https://api.github.com/repos/zilongshanren/Spacemacs-rocks/issues/24/comments","events_url":"https://api.github.com/repos/zilongshanren/Spacemacs-rocks/issues/24/events","html_url":"https://github.com/zilongshanren/Spacemacs-rocks/issues/24","id":143782613,"number":24,"title":"Spacemacs Rocks 第二季: Day 2","user":{"login":"zilongshanren","id":785541,"avatar_url":"https://avatars.githubusercontent.com/u/785541?v=3","gravatar_id":"","url":"https://api.github.com/users/zilongshanren","html_url":"https://github.com/zilongshanren","followers_url":"https://api.github.com/users/zilongshanren/followers","following_url":"https://api.github.com/users/zilongshanren/following{/other_user}","gists_url":"https://api.github.com/users/zilongshanren/gists{/gist_id}","starred_url":"https://api.github.com/users/zilongshanren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zilongshanren/subscriptions","organizations_url":"https://api.github.com/users/zilongshanren/orgs","repos_url":"https://api.github.com/users/zilongshanren/repos","events_url":"https://api.github.com/users/zilongshanren/events{/privacy}","received_events_url":"https://api.github.com/users/zilongshanren/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-27T07:12:16Z","updated_at":"2016-03-29T03:09:23Z","closed_at":null,"body":"百度网盘地址： http://pan.baidu.com/s/1c2Cw9ck\r\n优酷地址：  http://v.youku.com/v_show/id_XMTUxMzQyODI4MA==.html\r\nYoutube: https://youtu.be/aQRZxaU3pAI \r\n\r\n视频outline: https://github.com/zilongshanren/Spacemacs-rocks/blob/master/episode2/day2/Readme.org\r\n\r\nHacking Scripts: https://github.com/zilongshanren/Spacemacs-rocks/blob/master/episode2/day2/init.el\r\n\r\n练习：\r\n\r\n1. 搞懂setq和setq-default的区别\r\nhttp://stackoverflow.com/questions/18172728/the-difference-between-setq-and-setq-default-in-emacs-lisp\r\n\r\n2. 搞懂auto-mode-alist和cons cells，使用js2-mode打开.json文件。\r\nhttps://www.gnu.org/software/emacs/manual/html_node/elisp/Cons-Cells.html#Cons-Cells\r\n\r\n3. 学习emacs lisp里面的cl(common lisp)扩展，弄懂loop for ... in 的用法。\r\nhttp://www.gnu.org/software/emacs/manual/html_mono/cl.html#Loop-Facility\r\n\r\n4. 使用customize-group去配置js2-mode\r\n\r\n5. setq和defvar的区别是什么？\r\n\r\n6. 下面这三行代码有什么区别和联系？什么是quote?\r\n```emacs-lisp\r\n(setq package-selected-packages zilongshanren/packages)\r\n(setq package-selected-packages 'zilongshanren/packages)\r\n(setq package-selected-packages (quote zilongshanren/packages))\r\n```\r\n\r\n**友情提示：关于练习的答案，尽量问Emacs和Google，实在搞不定再来问我。**\r\n\r\n视频中提到的链接：\r\n\r\n1. http://melpa.org/\r\n2. https://github.com/abicky/nodejs-repl.el\r\n3. https://github.com/mooz/js2-mode\r\n4. https://github.com/nflath/hungry-delete\r\n5. http://company-mode.github.io/\r\n6. https://github.com/abo-abo/swiper\r\n7. https://github.com/Fuco1/smartparens\r\n\r\n\r\n强烈推荐大家把视频中提到的Package的Readme都好好看一下，这次视频内容有点多，遇到啥问题欢迎在下面留言。\r\n\r\n\r\nHappy Hacking :smile: "},"comment":{"url":"https://api.github.com/repos/zilongshanren/Spacemacs-rocks/issues/comments/202684763","html_url":"https://github.com/zilongshanren/Spacemacs-rocks/issues/24#issuecomment-202684763","issue_url":"https://api.github.com/repos/zilongshanren/Spacemacs-rocks/issues/24","id":202684763,"user":{"login":"li-xinyang","id":3349406,"avatar_url":"https://avatars.githubusercontent.com/u/3349406?v=3","gravatar_id":"","url":"https://api.github.com/users/li-xinyang","html_url":"https://github.com/li-xinyang","followers_url":"https://api.github.com/users/li-xinyang/followers","following_url":"https://api.github.com/users/li-xinyang/following{/other_user}","gists_url":"https://api.github.com/users/li-xinyang/gists{/gist_id}","starred_url":"https://api.github.com/users/li-xinyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/li-xinyang/subscriptions","organizations_url":"https://api.github.com/users/li-xinyang/orgs","repos_url":"https://api.github.com/users/li-xinyang/repos","events_url":"https://api.github.com/users/li-xinyang/events{/privacy}","received_events_url":"https://api.github.com/users/li-xinyang/received_events","type":"User","site_admin":false},"created_at":"2016-03-29T03:09:23Z","updated_at":"2016-03-29T03:09:23Z","body":"```elisp\r\n(when (>= emacs-major-version 24)\r\n    (require 'package)\r\n    (package-initialize)\r\n    (add-to-list 'package-archives '(\"melpa\" . \"http://melpa.org/packages/\") t)\r\n    )\r\n\r\n;; TODO: DO NOT KNOW WHAT IS 'cl\r\n;; (require 'cl)\r\n\r\n;; Add Packages\r\n(defvar xinyang/packages '(\r\n\t\t\t    company\r\n\t\t\t    monokai-theme\r\n\t\t\t    hungry-delete\r\n\t\t\t    swiper\r\n\t\t\t    counsel\r\n\t\t\t    smartparens\r\n\t\t\t    js2-mode\r\n\t\t\t    nodejs-repl\r\n\t\t\t    exec-path-from-shell\r\n\t\t\t    )  \"Default packages\")\r\n\r\n(setq package-selected-packages xinyang/packages)\r\n\r\n(defun xinyang/packages-installed-p ()\r\n    (loop for pkg in xinyang/packages\r\n          when (not (package-installed-p pkg)) do (return nil)\r\n          finally (return t)))\r\n\r\n(unless (xinyang/packages-installed-p)\r\n    (message \"%s\" \"Refreshing package database...\")\r\n    (package-refresh-contents)\r\n    (dolist (pkg xinyang/packages)\r\n      (when (not (package-installed-p pkg))\r\n        (package-install pkg))))\r\n\r\n;; let emacs could find the execuable\r\n(when (memq window-system '(mac ns))\r\n  (exec-path-from-shell-initialize))\r\n\r\n\r\n\r\n;; Better Default\r\n;; ==================================================================\r\n;; Disable Backup File\r\n(setq make-backup-files nil)\r\n;; Regular Replace Selection Behavior\r\n(delete-selection-mode 1)\r\n;; Auto Parenthesis Matching\r\n(add-hook 'emacs-lisp-mode-hook 'show-paren-mode)\r\n;; Enable Recent Files\r\n(require 'recentf)\r\n(recentf-mode 1)\t\t\t\r\n(setq recentf-max-menu-items 25)\r\n\r\n\r\n;; Appearance Related Setting\r\n;; ===================================================================\r\n;; Hide Startup screen\r\n(setq inhibit-splash-screen 1)\r\n;; Default Full-screen Mode\r\n(setq initial-frame-alist (quote ((fullscreen . maximized))))\r\n;; Hide menu bar\r\n(tool-bar-mode -1)\r\n;; Hide scroll bar\r\n(scroll-bar-mode -1)\r\n;; Highlight Current Line\r\n(global-hl-line-mode 1)\r\n;; Show line number\r\n(global-linum-mode 1)\r\n;; Change cursor style\r\n(setq-default cursor-type 'bar)\r\n\r\n\r\n;; Package Related Setting\r\n;; ===================================================================\r\n\r\n;; Company Mode\r\n;; -------------------------------------------------------------------\r\n;; Enable global company mode\r\n(global-company-mode t)\r\n\r\n;; Help Functions\r\n;; ===================================================================\r\n;; Open Config Files (init.el)\r\n(defun open-init-file()\r\n  (interactive)\r\n  (find-file \"~/.emacs.d/init.el\"))\r\n\r\n\r\n;; Key Binding\r\n;; ===================================================================\r\n;; Quick Open Config File (init.el)\r\n(global-set-key (kbd \"C-c C-c\") 'open-init-file\r\n\r\n;; Open Recent Files List\r\n(global-set-key (kbd \"C-x C-r\") 'recentf-open-files)\r\n\r\n;; TODO: THE BINDINGS ARE NOT WORKING\r\n;; Better Find Definition for Vairbale, Function and Key Binding\r\n(global-set-key (kbd \"C-h C-v\") 'find-variable)\r\n(global-set-key (kbd \"C-h C-f\") 'find-function)\r\n(global-set-key (kbd \"C-h C-k\") 'find-function-on-key)\r\n\r\n\r\n;; Org-mode Related Setting\r\n;; ===================================================================\r\n\r\n\r\n(custom-set-variables\r\n ;; custom-set-variables was added by Custom.\r\n ;; If you edit it by hand, you could mess it up, so be careful.\r\n ;; Your init file should contain only one such instance.\r\n ;; If there is more than one, they won't work right.\r\n '(package-selected-packages (quote (company))))\r\n(custom-set-faces\r\n ;; custom-set-faces was added by Custom.\r\n ;; If you edit it by hand, you could mess it up, so be careful.\r\n ;; Your init file should contain only one such instance.\r\n ;; If there is more than one, they won't work right.\r\n )\r\n```\r\n一直显示 `Symbol's function definition is void: loop` 检查多遍 使用和你一样的配置（拷贝粘贴）也是同样的错误。\r\n"}}