Skip to content

Instantly share code, notes, and snippets.

View hchbaw's full-sized avatar

Takeshi Banse hchbaw

View GitHub Profile
(ns swank.commands.basic
(:refer-clojure :exclude [load-file])
(:use (swank util commands core)
(swank.util.concurrent thread)
(swank.util string clojure)
(swank.clj-contrib pprint macroexpand))
(:require (swank.util [sys :as sys]))
(:import (java.io StringReader File)
(java.util.zip ZipFile)
(clojure.lang LineNumberingPushbackReader)))
;;; Basic anything-show-completion+ machinery.
(defvar anything-show-completion+-display-function
'anything-show-completion-display-function)
(defun anything-show-completion+-display-function (buf)
(funcall anything-show-completion+-display-function buf))
(defun use-anything-show-completion+-display-function (function)
(eval
`(defadvice ,function (around anything-show-completion+ activate)
;; Hijack `asc-display-function' to replace it with
;; `anything-show-completion+-display-function',
(defvar anything-show-completion-height-percent 50
"Maximum percentage of display height that will be preserved when this
`anything-display-function' splits the window.")
(defvar asc-scroll 0
"Hold the state of the scrolled-upped value.")
(defun asc-scroll-display-function (buf)
(save-excursion
(setq asc-scroll 0)
(asc-scroll-up-maybe)
(format t "Hello World.")