Skip to content

Instantly share code, notes, and snippets.

View hchbaw's full-sized avatar

Takeshi Banse hchbaw

View GitHub Profile
#autoload +X
__git_files () {
local expl files ls_opts opts gitdir gitcdup
zparseopts -D -E -a opts -- -cached -deleted -modified -others -ignored -unmerged -killed
gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
__git_command_successful || return
#autoload +X
__git_files () {
local expl
_wanted files expl 'file' _files
}
#autoload +X
__git_files () {
local expl files ls_opts opts gitdir gitcdup
zparseopts -D -E -a opts -- -cached -deleted -modified -others -ignored -unmerged -killed
gitdir=$(_call_program gitdir git rev-parse --git-dir 2>/dev/null)
__git_command_successful || return
diff --git a/auto-install.el b/auto-install.el
index 75b1e04..609239f 100644
--- a/auto-install.el
+++ b/auto-install.el
@@ -858,12 +858,12 @@ (defun auto-install-batch (&optional extension-name)
(defun auto-install-batch-edit ()
"Edit auto-install-batch-list.el"
(interactive)
- (con ((fboundp 'yaoddmuse-edit)
- (yaoddmuse-edit "EmacsWiki" "auto-install-batch-list.el"))
#!zsh
# 直前のコマンドを再度実行して、その出力を補完候補するようなスクリプトです
_complete_previous_output () {
local command xs
command=${(Q)$(fc -l -n -1)}
xs=(${(f)"$(${=command})"})
_message "($command)"
#!zsh
# 直前のコマンドラインの要素を補完候補にするようなスクリプトです。
_complete_previous_commandline () {
local cl xs
cl="$(fc -l -n -1)"
xs=${(@z)cl}
compadd \
#!zsh
# コマンドライン上の今のカーソルの左の要素の展開具合を補完候補にするようなス
# クリプトです。
_expand_word_fu () {
compstate[insert]=
local origprefix=$PREFIX
case $origprefix[1] in
#!zsh
# エディタのファイルの履歴を補完候補にするようなスクリプトです
_rf () {
local ref=$1
shift
local -a xs
xs=("$@")
local -a ret
ret=()
#autoload
local -a flags
flags=(
'):end of flags'
'#:as numeric'
'%:expand %s in result as in prompts'
'@:array expand even in double quotes'
'A:create an array parameter with ${...=...}, (AA) associative array'
;; http://repo.or.cz/w/emacs.git/blob/HEAD:/src/fileio.c#l5557
;; (install-my-restore-message-function alcs-make-candidates)
(defmacro w/uniq (names &rest body)
(declare (indent 1))
`(let ,(mapcar (lambda (s) `(,s (gensym ,(symbol-name s))))
(if (consp names) names (list names)))
,@body))
(defmacro with-my-restore-message (&rest body)