X-Git-Url: http://47.100.26.94:8080/?a=blobdiff_plain;f=emacs.d%2Fconfig.org;h=8bb6d51e8fb8236ab14d04d19b69e8c981b664bf;hb=e04c0fcc7bd57fb36ced8539e56db4ab652ff468;hp=63e3373bd3260627e119dd13f30529cc7a4b3ed6;hpb=465ba1c51a6d69453710051de3c7abb52accb10b;p=dotfiles.git diff --git a/emacs.d/config.org b/emacs.d/config.org index 63e3373..8bb6d51 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -1471,6 +1471,28 @@ brew install the-silver-searcher (add-hook 'text-mode-hook 'table-recognize) #+END_SRC +** url-download +Refer [[http://stackoverflow.com/questions/4448055/download-a-file-with-emacs-lisp][download-a-file-with-emacs-lisp]] +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (defun sd/download-file (&optional url download-dir download-name) + (interactive) + (let ((url (or url + (read-string "Enter download URL: "))) + (download-dir (or (read-string "Save to (~/Downloads): ") "~/Downloads"))) + (let ((download-buffer (url-retrieve-synchronously url))) + (save-excursion + (set-buffer download-buffer) + ;; we may have to trim the http response + (goto-char (point-min)) + (re-search-forward "^$" nil 'move) + (forward-char) + (delete-region (point-min) (point)) + (write-file (concat (or download-dir + "~/Downloads/") + (or download-name + (car (last (split-string url "/" t)))))))))) +#+END_SRC + * Dired ** Dired bindings =C-o= is defined as a global key for window operation, here unset it in dired mode @@ -2056,6 +2078,24 @@ irony-company :ensure t) #+END_SRC +** Scheme +Install =guile=, =guile= is an implementation of =Scheme= programming language. +#+BEGIN_SRC sh + brew install guile +#+END_SRC + +#+BEGIN_SRC emacs-lisp :tangle yes :results silent + (setq geiser-scheme-implementation 'guile) +#+END_SRC + +#+BEGIN_SRC scheme + (define a "3") + a +#+END_SRC + +#+RESULTS: +: 3 + ** Racket #+BEGIN_SRC emacs-lisp :tangle yes :results silent (use-package racket-mode @@ -2117,7 +2157,7 @@ Set the environments vairables in compilation mode (file-name-nondirectory (buffer-file-name))) ".hpp\"" \n \n "using namespace std;" \n \n - "int main ()" + "int main (int argc, char *argv[])" "\n{" \n > _ \n "return 0;" @@ -2136,7 +2176,7 @@ Set the environments vairables in compilation mode (file-name-sans-extension (file-name-nondirectory (buffer-file-name))) ".h\"" \n \n - "int main ()\n" + "int main (int argc, char *argv[])\n" "{" \n > _ \n "return 0;\n"