|
|
@ -268,13 +268,16 @@ buffer is not visiting a file." |
|
|
(file-writable-p buffer-file-name)) |
|
|
(file-writable-p buffer-file-name)) |
|
|
(find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name)))) |
|
|
(find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name)))) |
|
|
|
|
|
|
|
|
(defun prelude-switch-or-start (function buffer) |
|
|
|
|
|
"If BUFFER is current, bury it, otherwise invoke FUNCTION." |
|
|
|
|
|
(if (equal (buffer-name (current-buffer)) buffer) |
|
|
|
|
|
(bury-buffer) |
|
|
|
|
|
(if (get-buffer buffer) |
|
|
|
|
|
(switch-to-buffer buffer) |
|
|
|
|
|
(funcall function)))) |
|
|
|
|
|
|
|
|
(defun prelude-start-or-switch-to (function buffer-name) |
|
|
|
|
|
"Invoke FUNCTION if there is no buffer with BUFFER-NAME. |
|
|
|
|
|
Otherwise switch to the buffer named BUFFER-NAME. Don't clobber |
|
|
|
|
|
the current buffer." |
|
|
|
|
|
(if (not (get-buffer buffer-name)) |
|
|
|
|
|
(progn |
|
|
|
|
|
(split-window-sensibly (selected-window)) |
|
|
|
|
|
(other-window 1) |
|
|
|
|
|
(funcall function)) |
|
|
|
|
|
(switch-to-buffer-other-window buffer-name))) |
|
|
|
|
|
|
|
|
(defun prelude-insert-date () |
|
|
(defun prelude-insert-date () |
|
|
"Insert a timestamp according to locale's date and time format." |
|
|
"Insert a timestamp according to locale's date and time format." |
|
|
|