diff --git a/README.md b/README.md index 74d9bfb..8388019 100644 --- a/README.md +++ b/README.md @@ -286,7 +286,7 @@ Keybinding | Description <kbd>C-c n</kbd> | Fix indentation in buffer and strip whitespace. <kbd>C-c f</kbd> | Open recently visited file. <kbd>C-M-\\</kbd> | Indent region (if selected) or the entire buffer. -<kbd>C-c u</kbd> | Open URL in your default browser. +<kbd>C-c u</kbd> | Open a new buffer containing the contents of URL. <kbd>C-c e</kbd> | Eval a bit of Emacs Lisp code and replace it with its result. <kbd>C-c s</kbd> | Swap two active windows. <kbd>C-c D</kbd> | Delete current file and buffer. diff --git a/core/prelude-core.el b/core/prelude-core.el index 8716521..265803f 100644 --- a/core/prelude-core.el +++ b/core/prelude-core.el @@ -266,8 +266,11 @@ there's a region, all lines that region covers will be duplicated." (url (read-from-minibuffer "URL: " default))) (switch-to-buffer (url-retrieve-synchronously url)) (rename-buffer url t) - (cond ((search-forward "<?xml" nil t) (nxml-mode)) - ((search-forward "<html" nil t) (html-mode))))) + (goto-char (point-min)) + (re-search-forward "^$") + (delete-region (point-min) (point)) + (delete-blank-lines) + (set-auto-mode))) (defun prelude-cleanup-buffer-or-region () "Cleanup a region if selected, otherwise the whole buffer."