Emacs: yasnippet support for bot new syntax and old syntax.

Emacs: set to load ~/emacs.d/plugins by default.
Shell: fixed 'archive' function to be compatible with both bsdtar and gnutar.
master
Ambrevar 2012-11-03 16:44:09 +01:00
parent 8c49b8fa49
commit 73f7f1a430
2 changed files with 20 additions and 14 deletions

View File

@ -2,6 +2,9 @@
;; PLUGINS ;; PLUGINS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; User plugin path.
(add-to-list 'load-path "~/.emacs.d/plugins")
;;============================================================================== ;;==============================================================================
;; Yasnippet ;; Yasnippet
;;============================================================================== ;;==============================================================================
@ -15,18 +18,21 @@
;; Next follows a traditional, yet not-optimized configuration for Yasnippet. ;; Next follows a traditional, yet not-optimized configuration for Yasnippet.
;; (add-to-list 'load-path "/usr/share/emacs/site-lisp/yas") ;; (add-to-list 'load-path "/usr/share/emacs/site-lisp/yas")
(require 'yasnippet) ;; not yasnippet-bundle (require 'yasnippet) ;; not yasnippet-bundle
(yas-global-mode 1)
;; (yas/initialize)
(setq yas-snippet-dirs "~/.emacs.d/snippets" ) (setq yas-snippet-dirs "~/.emacs.d/snippets" )
;; Personal snippets (if (fboundp 'yas/initialize)
;; (setq yas/root-directory "~/.emacs.d/plugins/yas/snippets" ) ;; Old yasnippet versions.
(progn
(yas/initialize)
(yas/load-directory yas-snippet-dirs))
;; New yasnippet versions.
(progn
(yas-global-mode 1)
(yas-load-directory yas-snippet-dirs))
)
;; Load the snippets
;; (yas/load-directory "~/.emacs.d/plugins/yas/snippets") ;; Warning: slow!
;; (yas/load-directory yas/root-directory)
(yas-load-directory yas-snippet-dirs)
;;============================================================================== ;;==============================================================================
;; Lua ;; Lua

View File

@ -564,10 +564,10 @@ archive ()
echo -e " -m:\t\tChoose compression method." echo -e " -m:\t\tChoose compression method."
echo -e " gz\t\tgzip (default)." echo -e " gz\t\tgzip (default)."
echo -e " xz\t\tLZMA." echo -e " xz\t\tLZMA."
echo -e " -v:\t\tInclude VCS data." echo -e " -v:\t\tExclude VCS data. (GNU tar only)."
} }
local OPTION_VCS="--exclude-vcs" local OPTION_VCS=""
local OPTION_METHOD="" local OPTION_METHOD=""
while getopts ":hm:v" opt; do while getopts ":hm:v" opt; do
@ -580,7 +580,7 @@ archive ()
OPTION_METHOD="${OPTARG}" OPTION_METHOD="${OPTARG}"
;; ;;
v) v)
OPTION_VCS="" OPTION_VCS="--exclude-vcs"
;; ;;
?) ?)
printhelp "$0" printhelp "$0"
@ -624,7 +624,7 @@ archive ()
ARCNAME="${ARCSOURCE}-$(date +%y-%m-%d-%H%M%S).${ARCEXT}" ARCNAME="${ARCSOURCE}-$(date +%y-%m-%d-%H%M%S).${ARCEXT}"
(cd "$ARCPATH" && \ (cd "$ARCPATH" && \
tar -${ARCOPT} -cvf "$ARCNAME" "$ARCSOURCE" ${OPTION_VCS}) tar -${ARCOPT} -cf "$ARCNAME" "$ARCSOURCE" ${OPTION_VCS})
else else
ARCSOURCE="$(basename $PWD)" ARCSOURCE="$(basename $PWD)"
@ -633,7 +633,7 @@ archive ()
if [ $# = 0 ];then if [ $# = 0 ];then
(cd "$PWD/.." && \ (cd "$PWD/.." && \
tar -${ARCOPT} -cvf "$ARCNAME" "$ARCSOURCE" ${OPTION_VCS}) tar -${ARCOPT} -cf "$ARCNAME" "$ARCSOURCE" ${OPTION_VCS})
else else
## Note for zsh: do NOT initialize an array with "myarray=()". ## Note for zsh: do NOT initialize an array with "myarray=()".
@ -643,7 +643,7 @@ archive ()
FILELIST=(${FILELIST[*]} "$i") FILELIST=(${FILELIST[*]} "$i")
done done
tar -${ARCOPT} -cvf "$ARCNAME" ${FILELIST[*]} ${OPTION_VCS} tar -${ARCOPT} -cf "$ARCNAME" ${FILELIST[*]} ${OPTION_VCS}
fi fi
fi fi
} }