Skip to content

Instantly share code, notes, and snippets.

View hchbaw's full-sized avatar

Takeshi Banse hchbaw

View GitHub Profile
(format t "Hello World.")
;;; 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)
(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)))
;;;; Documentation
(defn- briefly-describe-symbol-for-emacs [var]
(let [lines (fn [s] (seq (.split s (System/getProperty "line.separator"))))
[_ symbol-name arglists d1 d2 & __] (lines (describe-to-string var))
macro? (= d1 "Macro")]
(list :designator symbol-name
(cond
macro? :macro
(:arglists ^var) :function
From 97ec3532c97606270b97ced7ca102fb27457f06b Mon Sep 17 00:00:00 2001
From: Takeshi Banse <takebi@laafc.net>
Date: Thu, 2 Jul 2009 21:18:49 +0900
Subject: [PATCH Emacs/swank-clojure] Add apropos-list-for-emacs
Signed-off-by: Takeshi Banse <takebi@laafc.net>
---
Hi all,
I Takeshi Banse live in Japan, have been teaching myself Clojure and in the
(require 'cl)
(defun* azs-make-source
(arg &optional name (skipp #'(lambda (s)
(equal
anything-zsh-screen-zle-line-source-name
(anything-attr 'name s)))))
(let* ((arg (concat (replace-regexp-in-string "[[:space:]]+$" "" arg) " "))
(name (or name (concat arg "(zsh screen)")))
(anything-source-name name))
(with-current-buffer (anything-candidate-buffer 'global)
int main(int argc, char** argv) {
return 0;
}
;;; swank_fuzzy.clj --- fuzzy symbol completion, Clojure implementation.
;; Original CL implementation authors (from swank-fuzzy.lisp) below,
;; Authors: Brian Downing <bdowning@lavos.net>
;; Tobias C. Rittweiler <tcr@freebits.de>
;; and others
;; This progam is based on the swank-fuzzy.lisp.
;; Thanks the CL implementation authors for that useful software.
@hchbaw
hchbaw / t.diff
Created September 18, 2009 23:14
diff --git a/vimpulse-text-object-system.el b/vimpulse-text-object-system.el
index d62225b..21e5445 100644
--- a/vimpulse-text-object-system.el
+++ b/vimpulse-text-object-system.el
@@ -135,6 +135,12 @@ (defun vimpulse-get-vWord-bounds (pos)
(re-search-backward "[\n\r[:space:]]")
(cons (1+ (point)) result))))
+ (defun vimpulse-get-sexp-bounds (pos)
+ (save-excursion