mirror of
https://github.com/larstvei/dot-emacs.git
synced 2024-11-26 07:28:31 +00:00
Added try.
This commit is contained in:
parent
18be40c001
commit
b9a683e915
9
init.el
9
init.el
@ -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]].
|
||||||
|
11
init.org
11
init.org
@ -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]].
|
||||||
|
Loading…
Reference in New Issue
Block a user