Skip to content

Instantly share code, notes, and snippets.

@Mekk
Mekk / my-window-reuse.el
Last active November 18, 2015 06:26
Emacs snippet to keep single *Man* window (or similar).
;; Based on http://stackoverflow.com/questions/28309340/managing-emacs-man-buffer-location/28311686
(defun enable-window-reuse-for-modes (&rest modes)
"Enables window reuse for given modes - for any of modes specified,
in case there already exist window of given mode, new incarnation will reuse them.
Examples:
(require 'my-window-reuse)
object Speed {
val N = 10000
val M = 1000
def calc():Double = {
val step = 20.0 / N
val total = ((0 until N) map { step * _ - 10.0 }
map { x => Math.pow(Math.E,-x*x) * step }
reduceLeft { _ + _ })
total