Browse Source

changes for windows

pull/1/head
10sr 13 years ago
parent
commit
53f1704516
2 changed files with 38 additions and 31 deletions
  1. +6
    -4
      .bashrc
  2. +32
    -27
      .emacs.el

+ 6
- 4
.bashrc View File

@@ -209,10 +209,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}"


+ 32
- 27
.emacs.el View File

@@ -331,6 +331,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))
@@ -801,32 +802,12 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB."
t)
(require 'multi-term nil t))

(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)
@@ -1453,9 +1434,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 ".")))
@@ -1578,7 +1559,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)); (view-buffer (get-buffer \"*eshell output*\"))")))
("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)
@@ -1692,13 +1674,36 @@ when SEC is nil, stop auto save if enabled."
(defun my-execute-terminal ()
""
(interactive)
(if window-system
(if (and window-system
(not (eq window-system 'w32)))
(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 window-system 'w32)
(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"))
@@ -2001,7 +2006,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


Loading…
Cancel
Save