diff --git a/.bashrc b/.bashrc index ab0ebc8..8b7a51b 100755 --- a/.bashrc +++ b/.bashrc @@ -9,8 +9,6 @@ safe-cmd(){ test -r /etc/bashrc && . /etc/bashrc -# export PS1="\[\e[32m\]\u@\H \[\e[33m\]\w\[\e[0m\] \d \t\n\s \# \j \$ " -# export PS1="[\[\e[33m\]\w\[\e[0m\]]\n\[\e[32m\]\u@\H\[\e[0m\] \d \t \s.\v\nhist:\# jobs:\j \$ " export PS1="\$(prompt_function)\$ " # PROMPT_COMMAND=prompt_function export PAGER="less" @@ -209,10 +207,12 @@ prompt_function(){ # used by PS1 local c3="\e[37m" local cdef="\e[0m" fi - local pwd=$(echo "${PWD}/" | sed -e "s:${HOME}:~:") - local oldpwd=$(echo "${OLDPWD}/" | sed -e "s:${HOME}:~:") - local date=$(LANG=C safe-cmd date +"%a, %d %b %Y %T %z") - local jobnum=$(jobs | wc -l) + iscygwin || { + local pwd=$(echo "${PWD}/" | sed -e "s:${HOME}:~:") + local oldpwd=$(echo "${OLDPWD}/" | sed -e "s:${HOME}:~:") + local date=$(LANG=C safe-cmd date +"%a, %d %b %Y %T %z") + local jobnum=$(jobs | wc -l) + } local git=$(safe-cmd __git_ps1 [GIT:%s]) local svn=$(type svn >/dev/null 2>&1 && safe-cmd __my_svn_ps1 [SVN:%s]) printf "${_MEMO}" @@ -321,8 +321,10 @@ if iscygwin; then : alias setclip="tee /dev/clipboard" : alias catclip="cat /dev/clipboard | tr -d \\r" alias cygsu="cygstart /cygwinsetup.exe" - alias emacs="CYGWIN=tty emacs" + alias em="CYGWIN=tty emacs -nw" echo "cygwin bash" + # export PS1=" \[\e[32m\]\u@\H \[\e[33m\]\w\[\e[0m\] \d \t\n\s \# \j \$ " + export PS1=" [\[\e[33m\]\w\[\e[0m\]]\n\[\e[32m\]\u@\H\[\e[0m\] \d \t \s.\v\nhist:\# jobs:\j \$ " fi ####################### diff --git a/.emacs.el b/.emacs.el old mode 100644 new mode 100755 index 3408b2a..1869982 --- a/.emacs.el +++ b/.emacs.el @@ -335,6 +335,7 @@ (font-spec :family (nth 2 list) :size (nth 3 list)))) ; font spec is available in emacs23 and later, cannot used in emacs22 ;; (my-set-ascii-and-jp-font-with-size '("dejavu sans mono" 90 "takaogothic" 13)) ;; (my-set-ascii-and-jp-font-with-size '("dejavu sans mono" 100 "takaogothic" 14)) +;; (my-set-ascii-and-jp-font-with-size '("dejavu sans mono" 100 "ms gothic" 14)) ;; (my-set-ascii-and-jp-font-with-size '("monaco" 75 "takaogothic" 11)) ;; (my-set-ascii-and-jp-font-with-size '("monaco" 90 "takaogothic" 13)) ;; (my-set-ascii-and-jp-font-with-size '("ProggyCleanTTSZ" 120 "takaogothic" 11)) @@ -825,32 +826,12 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (require 'multi-term nil t) (setq multi-term-switch-after-close nil)) -(defun my-term () - "" - (interactive) - (if (require 'multi-term nil t) - (multi-term) - (ansi-term "/bin/bash"))) - -(defvar my-frame-term-plist nil) -(setplist my-frame-term-plist nil) -(defun my-execute-or-find-term () - "" - (interactive) - (let* ((buf (get 'my-frame-term-plist (selected-frame)))) - (if (and buf - (buffer-name buf)) - (switch-to-buffer buf) - (put 'my-frame-term-plist - (selected-frame) - (my-term))))) - ;; http://d.hatena.ne.jp/goinger/20100416/1271399150 ;; (setq term-ansi-default-program shell-file-name) (add-hook 'term-setup-hook (lambda () (setq term-display-table (make-display-table)))) (add-hook 'term-mode-hook (lambda () - (unless (memq (current-buffer) (and (require 'multi-term nil t) ; current buffer is not multi-term buffer + (unless (memq (current-buffer) (and (featurep 'multi-term) ; current buffer is not multi-term buffer (multi-term-list))) ;; (define-key term-raw-map "\C-q" 'move-beginning-of-line) ;; (define-key term-raw-map "\C-r" 'term-send-raw) @@ -1471,9 +1452,9 @@ Optional prefix ARG says how many lines to unflag; default is one line." ;; (goto-line line)) ;; (view-file (pop args)))))) -(defun eshell/git (&rest args) - "" - (eshell-parse-arguments (point-at-bol) (point-at-eol))) +;; (defun eshell/git (&rest args) +;; "" +;; (eshell-parse-arguments (point-at-bol) (point-at-eol))) (defun eshell/o (&optional file) (my-x-open (or file "."))) @@ -1596,7 +1577,8 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." ("ut" "slogin 03110414@un001.ecc.u-tokyo.ac.jp") ("aptin" "sudo apt-get install") ("u" "uname") - ("eless" "cat >>> (with-current-buffer (get-buffer-create \"*eshell output\") (erase-buffer) (setq buffer-read-only nil) (current-buffer" + ("eless" "cat >>> (with-current-buffer (get-buffer-create \"*eshell output\") (erase-buffer) (setq buffer-read-only nil) (current-buffer)); (view-buffer (get-buffer \"*eshell output*\"))") + ("g" "git"))) (add-to-list 'eshell-output-filter-functions 'eshell-truncate-buffer) (apply 'eshell/addpath exec-path) (set (make-variable-buffer-local 'scroll-margin) 0) @@ -1700,13 +1682,38 @@ when SEC is nil, stop auto save if enabled." (defun my-execute-terminal () "" (interactive) - (if window-system + (if (and (or (eq system-type 'windows-nt) + window-system) + my-desktop-terminal + ) (let ((process-environment (cons "TERM=xterm" process-environment))) (start-process "terminal" nil my-desktop-terminal)) (my-execute-or-find-term))) +(defun my-term () + "" + (interactive) + (if (eq system-type 'windows-nt) + (eshell t) + (if (featurep 'multi-term) + (multi-term) + (ansi-term "/bin/bash")))) + +(defvar my-frame-term-plist nil) +(setplist my-frame-term-plist nil) +(defun my-execute-or-find-term () + "" + (interactive) + (let* ((buf (get 'my-frame-term-plist (selected-frame)))) + (if (and buf + (buffer-name buf)) + (switch-to-buffer buf) + (put 'my-frame-term-plist + (selected-frame) + (my-term))))) + (defun my-format-time-string (&optional time) "" (let ((system-time-locale "C")) @@ -2010,7 +2017,7 @@ this is test, does not rename files" "" (mapcar (lambda (path) (add-to-list 'exec-path (expand-file-name path))) - args) + (reverse args)) (setenv "PATH" (mapconcat 'convert-standard-filename exec-path