Added try.

This commit is contained in:
larstvei 2014-09-23 21:44:44 +02:00
parent 18be40c001
commit b9a683e915
2 changed files with 20 additions and 0 deletions

View File

@ -603,6 +603,15 @@ the languages in ISPELL-LANGUAGES when invoked."
(whitespace-cleanup) (whitespace-cleanup)
(untabify beg (if (< end (point-max)) end (point-max))))) (untabify beg (if (< end (point-max)) end (point-max)))))
;; If you have a link to a raw =.el=-file, run =M-x try= and yank an URL
;; into the minibuffer, and the file will be evaluated.
(defun try (url)
"Takes an URL to a .el-file, and evaluates it."
(interactive (list (read-from-minibuffer "url: ")))
(with-current-buffer (url-retrieve-synchronously url)
(eval-region (search-forward-regexp "^$") (point-max))))
;; Key bindings ;; Key bindings
;; Bindings for [[https://github.com/magnars/expand-region.el][expand-region]]. ;; Bindings for [[https://github.com/magnars/expand-region.el][expand-region]].

View File

@ -749,6 +749,17 @@
(untabify beg (if (< end (point-max)) end (point-max))))) (untabify beg (if (< end (point-max)) end (point-max)))))
#+END_SRC #+END_SRC
If you have a link to a raw =.el=-file, run =M-x try= and yank an URL
into the minibuffer, and the file will be evaluated.
#+BEGIN_SRC emacs-lisp
(defun try (url)
"Takes an URL to a .el-file, and evaluates it."
(interactive (list (read-from-minibuffer "url: ")))
(with-current-buffer (url-retrieve-synchronously url)
(eval-region (search-forward-regexp "^$") (point-max))))
#+END_SRC
** Key bindings ** Key bindings
Bindings for [[https://github.com/magnars/expand-region.el][expand-region]]. Bindings for [[https://github.com/magnars/expand-region.el][expand-region]].