Display fortunes in scratch buffer
This commit is contained in:
parent
3f925fc0e3
commit
340c8583cc
|
@ -24,5 +24,16 @@ For `kill-buffer-query-functions'."
|
|||
(next-line 2))
|
||||
(rename-buffer (concat "*scratch<" mode ">*") t)))
|
||||
|
||||
(defun +scratch-fortune ()
|
||||
(let* ((fmt (if (executable-find "fmt")
|
||||
(format "| fmt -%d -s" (- fill-column 2))
|
||||
""))
|
||||
(s (string-trim
|
||||
(if (executable-find "fortune")
|
||||
(shell-command-to-string (concat "fortune -s" fmt))
|
||||
"ABANDON ALL HOPE YE WHO ENTER HERE"))))
|
||||
(concat (replace-regexp-in-string "^" ";; " s)
|
||||
"\n\n")))
|
||||
|
||||
(provide '+scratch)
|
||||
;;; +scratch.el ends here
|
||||
|
|
Loading…
Reference in New Issue