From 8320ae5e1126b94431bdda5fd0f2f47d08134763 Mon Sep 17 00:00:00 2001 From: 10sr Date: Fri, 9 Dec 2011 12:31:36 +0900 Subject: [PATCH 1/6] disable zone in windows --- .emacs.el | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.emacs.el b/.emacs.el index c4a318c..0d5e4eb 100644 --- a/.emacs.el +++ b/.emacs.el @@ -710,12 +710,13 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (add-hook (kill-local-variable 'before-save-hook) 'js2-before-save))) -(when (require 'zone nil t) - ;; (zone-when-idle 180) - (run-with-idle-timer 180 t (lambda () - (unless (memq major-mode - '(term-mode)) - (zone))))) +(and (require 'zone nil t) + (not (eq system-type 'windows-nt)) + ;; (zone-when-idle 180) + (run-with-idle-timer 180 t (lambda () + (unless (memq major-mode + '(term-mode)) + (zone))))) (when (require 'uniquify nil t) (setq uniquify-buffer-name-style 'post-forward-angle-brackets) @@ -1586,7 +1587,7 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." (eshell/export "GIT_EDITOR=") (eshell/export "LC_MESSAGES=C") (eshell/export "TERM=xterm") - ))))) + )) ;; (eval-after-load "em-alias" ;; '(progn ;; (eshell/alias "ll" "ls -l") From 4e5ea92f966c0b50a53eb7e44b07de465b2eeba9 Mon Sep 17 00:00:00 2001 From: 10sr Date: Mon, 12 Dec 2011 15:20:15 +0900 Subject: [PATCH 2/6] small bug fix --- .bashrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index 711f803..3b4d482 100644 --- a/.bashrc +++ b/.bashrc @@ -84,7 +84,7 @@ gitls(){ done } catclip(){ - if iscygwin + if iswindows then cat /dev/clipboard | tr -d \\r else @@ -92,7 +92,7 @@ catclip(){ fi } setclip(){ - if iscygwin + if iswindows then if test $# -eq 0 then From f50705bbdbc933ed836b0c9fd15dc7198201837c Mon Sep 17 00:00:00 2001 From: 10sr Date: Mon, 12 Dec 2011 15:25:14 +0900 Subject: [PATCH 3/6] merge origin/master --- .bashrc | 5 ++++- .emacs.el | 52 +++++++++++++++++++++++++++++++--------------------- 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/.bashrc b/.bashrc index 3b4d482..d2b93cb 100644 --- a/.bashrc +++ b/.bashrc @@ -167,7 +167,7 @@ _mygitconfig(){ git config --global core.autocrlf false git config --global color.ui auto git config --global status.relativePaths false - git config --global status.showUntrackedFiles no + git config --global status.showUntrackedFiles normal git config --global alias.graph "log --graph --date-order -C -M --pretty=format:\"<%h> %ad [%an] %Cgreen%d%Creset %s\" --all --date=short" git config --global alias.st "status -s" git config --global alias.b "branch" @@ -179,6 +179,9 @@ _mygitconfig(){ git config --global alias.ls "!git ls-files | xargs ls -CFG --color=auto --time-style=long-iso" git config --global alias.ll "!git ls-files | xargs ls -l -CFG --color=auto --time-style=long-iso" git config --global alias.addi "add -i" + if iswindows; then + git config --global core.fileMode false + fi } __my_parse_svn_branch() { diff --git a/.emacs.el b/.emacs.el index 0d5e4eb..58c12a2 100644 --- a/.emacs.el +++ b/.emacs.el @@ -340,7 +340,7 @@ ;; (my-set-ascii-and-jp-font-with-size '("monaco" 90 "takaogothic" 13)) ;; (my-set-ascii-and-jp-font-with-size '("ProggyCleanTTSZ" 120 "takaogothic" 11)) ;; あ a - +emacs-major-version (defun my-22-set-ascii-and-jp-font-with-size (list) "" (set-face-attribute 'default nil @@ -1120,7 +1120,9 @@ if arg is omitted use value of `buffer-list'." (require 'dired-aux) ;; needed to use dired-dwim-target-directory (defun my-dired-do-pack-or-unpack () - "" + "pack or unpack files. +if targetting one file and that is archive file defined in `pack-program-alist', unpack that. +otherwise, pack marked files. prompt user to decide filename for archive." (interactive) (let* ((infiles (dired-get-marked-files t)) (onefile (and (eq 1 ; filename if only one file targeted, otherwise nil. @@ -1147,14 +1149,6 @@ if arg is omitted use value of `buffer-list'." ;; (dired-unmark-all-marks) ) -(defun my-pack-file-name-association (filename) - "" - (let ((case-fold-search nil)) - (assoc-default filename - my-pack-program-alist - 'string-match-p - nil))) - (defun my-file-name-extension-with-tar (filename) "if FILENAME has extension with tar, like \"tar.gz\", return that. otherwise, return extension normally." @@ -1174,28 +1168,44 @@ otherwise, return FILENAME with `my-pack-default-extension'" (or (executable-find "7z") (executable-find "7za") (executable-find "7zr")) - "path to 7z program.") + "7z program.") (defvar my-pack-default-extension "7z" - "default suffix for packing. filename with this suffix must matches `pack-program-alist'") + "default suffix for packing. filename with this suffix must matches one of `pack-program-alist'") + +(defun my-pack-file-name-association (filename) + "if the pattern matching FILENAME is found at car of the list in `pack-program-alist', return cdr of that list. +otherwise, return nil." + (let ((case-fold-search nil)) + (assoc-default filename + my-pack-program-alist + 'string-match-p + nil))) (defvar my-pack-program-alist - `(("\\.7z\\'" ,(concat my-7z-program-name " a"), (concat my-7z-program-name " x")) + `( + ("\\.7z\\'" ,(concat my-7z-program-name " a") ,(concat my-7z-program-name " x")) + ("\\.zip\\'" "zip -r" "unzip") ("\\.tar\\'" "tar cf" "tar xf") ("\\.tgz\\'" "tar czf" "tar xzf") - ("\\.zip\\'" "zip -r" "unzip"))) + ("\\.tar\\.gz\\'" "tar czf" "tar xzf") + ) + "Alist of filename patterns, command for pack and unpack. +Each element looks like (REGEXP PACKING-COMMAND UNPACKING-COMMAND). +PACKING-COMMAND and UNPACKING-COMMAND can be nil if the command is not available. +alist is searched from the beginning so pattern for \".tar.gz\" should be ahead of pattern for \".gz\"") ;; (string-match-p "\\.gz\\'" "aaa.gz") ; \' matches string end, $ also matches the point before newline. (defun my-unpack (archive) "unpack ARCHIVE. command for unpacking is defined in `pack-program-alist'" (interactive "fArchive to extract: ") (let* ((earchive (expand-file-name archive)) - (lst (my-pack-file-name-association earchive)) + (cmd (nth 1 + (my-pack-file-name-association earchive))) ) - (if lst - (shell-command (concat (nth 1 - lst) + (if cmd + (shell-command (concat cmd " " (shell-quote-argument earchive))) (message "this is not archive file defined in `pack-program-alist'!")))) @@ -1205,10 +1215,10 @@ otherwise, return FILENAME with `my-pack-default-extension'" if ARCHIVE have extension defined in `pack-program-alist', use that command. otherwise, use `pack-default-extension' for pack." (let* ((archive-ext (my-pack-file-extension (expand-file-name archive))) - (lst (my-pack-file-name-association archive-ext)) + (cmd (car (my-pack-file-name-association archive-ext))) ) - (if lst - (shell-command (concat (nth 0 lst) + (if cmd + (shell-command (concat cmd " " (shell-quote-argument archive-ext) " " From 17475d1386b5f37cbbcc22e66683099578bbd5f4 Mon Sep 17 00:00:00 2001 From: 10sr Date: Tue, 13 Dec 2011 09:15:36 +0900 Subject: [PATCH 4/6] iswindows -> iscygwin --- .bashrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index d2b93cb..356581e 100644 --- a/.bashrc +++ b/.bashrc @@ -84,7 +84,7 @@ gitls(){ done } catclip(){ - if iswindows + if iscygwin then cat /dev/clipboard | tr -d \\r else @@ -92,7 +92,7 @@ catclip(){ fi } setclip(){ - if iswindows + if iscygwin then if test $# -eq 0 then From 94f722413161fac5ded7d8368bd194c0c0d5a219 Mon Sep 17 00:00:00 2001 From: 10sr Date: Tue, 13 Dec 2011 13:09:03 +0900 Subject: [PATCH 5/6] checkout origin/master --- .bashrc | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 .bashrc diff --git a/.bashrc b/.bashrc old mode 100644 new mode 100755 From 6b0519a1ed69dd96017840208d18cd28f9c9fef2 Mon Sep 17 00:00:00 2001 From: 10sr Date: Tue, 13 Dec 2011 13:16:23 +0900 Subject: [PATCH 6/6] iscygwin -> iswindows in catclip and setclip --- .bashrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.bashrc b/.bashrc index 356581e..d2b93cb 100755 --- a/.bashrc +++ b/.bashrc @@ -84,7 +84,7 @@ gitls(){ done } catclip(){ - if iscygwin + if iswindows then cat /dev/clipboard | tr -d \\r else @@ -92,7 +92,7 @@ catclip(){ fi } setclip(){ - if iscygwin + if iswindows then if test $# -eq 0 then