From d5194bc537d3e643acbcb67664be108ac627cb5b Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 30 Jan 2012 18:59:28 +0900 Subject: [PATCH 001/107] fix bug --- emacs.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/emacs.el b/emacs.el index d8d636c..d15339a 100644 --- a/emacs.el +++ b/emacs.el @@ -1131,14 +1131,15 @@ if arg is omitted use value of `buffer-list'." (defun my-dired-echo-file-head (&optional arg) "" - (interactive) + (interactive "P") (let ((f (dired-get-filename))) (message "%s" (with-temp-buffer (insert-file-contents f) (buffer-substring-no-properties (point-min) - (progn (goto-line (or arg - 10)) + (progn (goto-line (if arg + (prefix-numeric-value arg) + 10)) (point-at-eol))))))) (defun my-dired-diff () From 457612f170f804455eba8988fcfbd58788bd5a2f Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 30 Jan 2012 19:01:43 +0900 Subject: [PATCH 002/107] rm my-dired-find-file --- emacs.el | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/emacs.el b/emacs.el index d15339a..1925cfd 100644 --- a/emacs.el +++ b/emacs.el @@ -1328,22 +1328,6 @@ otherwise, use `pack-default-extension' for pack." (interactive) (my-x-open (dired-get-filename t t))) -(defun my-dired-up-directory () - "" - (interactive) - (my-dired-find-file "..")) - -(defun my-dired-find-file (&optional filename) - "if the file to open is a directory, kill current buffer after opening that file." - (interactive) - (let ((f (expand-file-name (or filename - (dired-get-filename)))) - (bf (current-buffer))) - (find-file f) - (when (and (file-directory-p f) - (not (get-buffer-window bf))) - (kill-buffer bf)))) - (if (eq window-system 'mac) (setq dired-listing-switches "-lhFG") (setq dired-listing-switches "-lhFG --time-style=long-iso") @@ -1412,9 +1396,6 @@ otherwise, use `pack-default-extension' for pack." (define-key dired-mode-map "P" 'my-dired-do-pack-or-unpack) (define-key dired-mode-map "a" 'my-dired-display-all-mode) (define-key dired-mode-map "/" 'dired-isearch-filenames) - ;; (substitute-key-definition 'dired-advertised-find-file 'my-dired-find-file dired-mode-map) - ;; (substitute-key-definition 'dired-up-directory 'my-dired-up-directory dired-mode-map) - ;; (define-key dired-mode-map (kbd "DEL") 'my-dired-up-directory) (define-key dired-mode-map (kbd "DEL") 'dired-up-directory) (substitute-key-definition 'dired-next-line 'my-dired-next-line dired-mode-map) (substitute-key-definition 'dired-previous-line 'my-dired-previous-line dired-mode-map) From 00149693d76252ba0f008ece508d283592866963 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 30 Jan 2012 19:02:29 +0900 Subject: [PATCH 003/107] rm commented pref and advice --- emacs.el | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/emacs.el b/emacs.el index 1925cfd..31c05aa 100644 --- a/emacs.el +++ b/emacs.el @@ -1405,21 +1405,6 @@ otherwise, use `pack-default-extension' for pack." (when (file-readable-p file) (delete-file file))))) -;; http://homepage1.nifty.com/blankspace/emacs/dired.html -;; (add-hook 'dired-load-hook -;; (lambda () -;; (load-library "ls-lisp") -;; (setq ls-lisp-dirs-first t) -;; (setq dired-listing-switches "-alhF"))) ;これ書く場所間違えてね? - -;; (defadvice dired-next-line (after dired-next-line-print-directory activate) -;; "print current directory when go down line" -;; (dired-print-current-dir-and-file)) - -;; (defadvice dired-previous-line (after dired-previous-line-print-directory activate) -;; "print current directory when go up line" -;; (dired-print-current-dir-and-file)) - ;; http://blog.livedoor.jp/tek_nishi/archives/4693204.html (defun my-dired-toggle-mark() From ead561d7cb092fead83449b2b1482adcbddfc2aa Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 30 Jan 2012 19:05:51 +0900 Subject: [PATCH 004/107] rm my delete-trailing-whitespace --- emacs.el | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/emacs.el b/emacs.el index 31c05aa..d9c0f27 100644 --- a/emacs.el +++ b/emacs.el @@ -1777,7 +1777,7 @@ when SEC is nil, stop auto save if enabled." sgml-mode c-mode c++-mode)) -(setq my-auto-indent-buffer-mode-list nil) +(setq my-auto-indent-buffer-mode-list nil) ;disable (defun my-indent-buffer () "indent whole buffer." (interactive) @@ -1856,15 +1856,6 @@ this is test, does not rename files" ;; nil ;; func)))) -;; delete-trailing-whitespace -;; (defun my-delete-blanks-on-eol () -;; "" -;; (interactive) -;; (save-excursion -;; (goto-char (point-min)) -;; (while (re-search-forward "[ \t]+$" nil t) -;; (replace-match "" nil nil)))) - (defvar my-revert-buffer-if-needed-last-buffer nil) (defun my-revert-buffer-if-needed () From c3b59b482f2466df2ac9679854601055cf0f5436 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 30 Jan 2012 19:11:29 +0900 Subject: [PATCH 005/107] rm comment --- emacs.el | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/emacs.el b/emacs.el index d9c0f27..27e5b8e 100644 --- a/emacs.el +++ b/emacs.el @@ -621,7 +621,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." 'executable-make-buffer-file-executable-if-script-p) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; mode関連 +;; mode (add-hook 'verilog-mode-hook (lambda () @@ -1971,14 +1971,6 @@ this is test, does not rename files" (modify-frame-parameters (selected-frame) default-frame-alist)))) t) - ;; (add-hook 'make-frame-hook - ;; (lambda () - ;; (run-with-timer 1 - ;; nil - ;; (lambda () - ;; (modify-frame-parameters (selected-frame) - ;; initial-frame-alist)))) - ;; t) (add-hook 'kill-emacs-hook 'my-window-size-save)) From 028432c35cd70587064803965997dfc5ab29ae56 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 30 Jan 2012 19:12:22 +0900 Subject: [PATCH 006/107] rm almost all buffer killing functions --- emacs.el | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/emacs.el b/emacs.el index 27e5b8e..b55000d 100644 --- a/emacs.el +++ b/emacs.el @@ -462,42 +462,6 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; buffer killing -(defun kill-buffer-by-major-mode (mode &optional exclude-current-buffer-p) ;mapcarとかつかって全部書き換える - "kill buffers. -if EXCLUDE-CURRENT-BUFFER-P is non-nil, never kill current buffer" - (interactive "xmajor mode of buffer to kill: ") - (save-excursion - (let ((bflist (buffer-list)) - (cbf (current-buffer)) - bf) - (while bflist - (setq bf (pop bflist)) - (set-buffer bf) - (if (and (eq mode major-mode) ;メジャーモードが一致し、かつ - (not (and exclude-current-buffer-p ;今のバッファを除外、今のバッファと一致 がともには満たされない - (eq bf cbf)))) - (kill-buffer bf)))))) - -(defun my-kill-this-buffer-when-hide (&optional buffer all-frames) - "" - (interactive) - (let ((bf (or buffer - (current-buffer)))) - (if (or (not buffer) (get-buffer-window bf all-frames)) - (run-with-timer 3 nil 'my-kill-this-buffer-when-hide bf all-frames) - (kill-buffer bf)))) -;; (add-hook 'dired-mode-hook -;; 'my-kill-this-buffer-when-hide) - -(defvar my-kill-previous-buffer nil) -(defun my-kill-previous-buffer () - "" - (when my-kill-previous-buffer - (kill-buffer my-kill-previous-buffer)) - (setq my-kill-previous-buffer (current-buffer))) -;; (add-hook 'dired-mode-hook -;; 'my-kill-previous-buffer) - (defun my-query-kill-this-buffer () "" (interactive) From 05cf8daae7a6950139a45538e4e93719ab54526a Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 31 Jan 2012 13:37:30 +0900 Subject: [PATCH 007/107] add comment --- emacs.el | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs.el b/emacs.el index b55000d..3fa4d48 100644 --- a/emacs.el +++ b/emacs.el @@ -72,6 +72,7 @@ (prefer-coding-system 'utf-8-unix) (setq system-time-locale "C") +;; my prefix map (defvar my-prefix-map (make-sparse-keymap)) (add-hook 'after-init-hook From 4634aa6ab4eb054b6a9f614e9946b1380a4cee48 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 31 Jan 2012 18:55:13 +0900 Subject: [PATCH 008/107] add jsm extension --- emacs.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/emacs.el b/emacs.el index b5642d8..351889c 100644 --- a/emacs.el +++ b/emacs.el @@ -685,7 +685,8 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." "https://github.com/mooz/js2-mode/raw/master/js2-mode.el" t) (autoload 'js2-mode "js2-mode" nil t) - (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode))) + (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) + (add-to-list 'auto-mode-alist '("\\.jsm$" . js2-mode))) ;; (add-hook 'js2-mode-hook ;; (lambda () ;; (add-hook 'before-save-hook From c89a964fa9adf6884231070522f669cca6b18161 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 1 Feb 2012 13:56:38 +0900 Subject: [PATCH 009/107] remove my func --- emacs.el | 8 -------- 1 file changed, 8 deletions(-) diff --git a/emacs.el b/emacs.el index 351889c..4063806 100644 --- a/emacs.el +++ b/emacs.el @@ -673,14 +673,6 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (c-toggle-hungry-state 1) )) -(defun my-compile-c-this-file () - "" - (interactive) - (compile (format "gcc -Wall -g -o %s %s" - (file-name-sans-extension buffer-file-name) - buffer-file-name))) -;; (when (require 'c nil t)(c-toggle-hungry-state t) - (when (dllib-if-unfound "js2-mode" "https://github.com/mooz/js2-mode/raw/master/js2-mode.el" t) From 3eb5e08dbcca3d2c85f685eca44e7254a9022ccf Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 1 Feb 2012 16:15:58 +0900 Subject: [PATCH 010/107] setPrefs to ext --- _keysnail.js | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/_keysnail.js b/_keysnail.js index 7ffd59f..1078bf1 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -27,25 +27,6 @@ function ignore(k, i) [k, null]; //// firefox // style.register("#bookmarksPanel > hbox,#history-panel > hbox {display: none !important;} //#urlbar-container{max-width: 500px !important;}"); -util.setPrefs( - { - "browser.tabs.loadDivertedInBackground": true, - "dom.disable_window_open_feature.location": false, - "dom.max_script_run_time": 30, - "browser.bookmarks.max_backups":0, - "browser.urlbar.autocomplete.enabled":false, - "browser.cache.memory.capacity":16384, - "browser.sessionhistory.max_total_viewers":8, - "browser.download.manager.closeWhenDone":true, - "browser.download.useDownloadDir":false, - "browser.tabs.closeWindowWithLastTab":false, - "network.dns.disableIPv6":true, - "browser.urlbar.trimURLs":false, - "browser.fullscreen.autohide":false, - "keyword.URL":"http://www.bing.com/search?q=", - } -); - /////////////////////////////////// //検索エンジン plugins.options["search-url-list"] = [ @@ -177,6 +158,27 @@ plugins.options["twitter_client.use_jmp"] = true; //////////////////////////////////////////// // エクステ +ext.add('my-setpref', function(){ + util.setPrefs( + { + "browser.tabs.loadDivertedInBackground": true, + "dom.disable_window_open_feature.location": false, + "dom.max_script_run_time": 30, + "browser.bookmarks.max_backups":0, + "browser.urlbar.autocomplete.enabled":false, + "browser.cache.memory.capacity":16384, + "browser.sessionhistory.max_total_viewers":8, + "browser.download.manager.closeWhenDone":true, + "browser.download.useDownloadDir":false, + "browser.tabs.closeWindowWithLastTab":false, + "network.dns.disableIPv6":true, + "browser.urlbar.trimURLs":false, + "browser.fullscreen.autohide":false, + "keyword.URL":"http://www.bing.com/search?q=", + } + ); +}, 'my setpref'); + ext.add('auto-install-plugins', function(ev, arg){ var urls = [ 'https://github.com/mooz/keysnail/raw/master/plugins/yet-another-twitter-client-keysnail.ks.js', From a5438bf367daee0ac543a552eb13f6367e196c74 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 1 Feb 2012 17:25:09 +0900 Subject: [PATCH 011/107] add eshell prefs --- emacs.el | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/emacs.el b/emacs.el index 4063806..4f4a6eb 100644 --- a/emacs.el +++ b/emacs.el @@ -805,6 +805,13 @@ 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-quit-or-send-raw () + "" + (interactive) + (if (get-buffer-process (current-buffer)) + (call-interactively 'term-send-raw) + (kill-buffer))) + ;; http://d.hatena.ne.jp/goinger/20100416/1271399150 ;; (setq term-ansi-default-program shell-file-name) (add-hook 'term-setup-hook (lambda () @@ -820,6 +827,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." ;; (define-key term-raw-map "\C-t" 'set-mark-command) (define-key term-raw-map "\C-x" (lookup-key (current-global-map) "\C-x")) (define-key term-raw-map "\C-z" (lookup-key (current-global-map) "\C-z"))) + (define-key term-raw-map "q" 'my-term-quit-or-send-raw) (define-key term-raw-map (kbd "ESC") 'term-send-raw) (define-key term-raw-map [delete] 'term-send-raw) (define-key term-raw-map "\C-h" 'term-send-backspace) @@ -1500,6 +1508,7 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." (eshell-send-input)))) (setq eshell-directory-name "~/.emacs.d/eshell/") +(setq eshell-term-name "eterm-color") (setq eshell-scroll-to-bottom-on-input t) (setq eshell-cmpl-ignore-case t) (setq eshell-cmpl-cycle-completions nil) @@ -1561,21 +1570,25 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." (mapcar (lambda (alias) (add-to-list 'eshell-command-aliases-list alias)) - '(("ll" "ls -l") - ("la" "ls -a") - ("lla" "ls -al") - ("ut" "slogin 03110414@un001.ecc.u-tokyo.ac.jp") - ("aptin" "sudo apt-get install") - ("u" "uname") + '( + ; ("ll" "ls -l $*") + ; ("la" "ls -a $*") + ; ("lla" "ls -al $*") + ("ut" "slogin 03110414@un001.ecc.u-tokyo.ac.jp $*") + ("aptin" "apt-get install $*") ("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"))) + ("g" "git $*") + )) + ; (eshell/alias "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) - (eshell/export "GIT_PAGER=") - (eshell/export "GIT_EDITOR=") + ;; (eshell/export "GIT_PAGER=") + ;; (eshell/export "GIT_EDITOR=") (eshell/export "LC_MESSAGES=C") - (eshell/export "TERM=xterm") + (add-to-list 'eshell-visual-commands "vim") + (add-to-list 'eshell-visual-commands "git") + (switch-to-buffer (current-buffer)) ; move buffer top of list )) ;; (eval-after-load "em-alias" From 105bb6ea0e976984f2808e3edfdd7037d28c129a Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 1 Feb 2012 18:08:43 +0900 Subject: [PATCH 012/107] rm eshell frame buffer func --- emacs.el | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/emacs.el b/emacs.el index 4f4a6eb..55b561d 100644 --- a/emacs.el +++ b/emacs.el @@ -1418,20 +1418,6 @@ Optional prefix ARG says how many lines to unflag; default is one line." (point)) (backward-delete-char 1))) -(defvar my-eshell-frame-buffer-alist nil) - -(defun my-eshell-frame-buffer (frame) - "get buffer associated with FRAME. if buffer doesnt exist or killed, return nil." - (let ((bf (cdr (assq frame my-eshell-frame-buffer-alist)))) - (and bf ;関連付けられたバッファが存在し - (buffer-name bf) ;かつkillされてない - bf))) - -(add-hook 'eshell-mode-hook - (lambda () - (add-to-list 'my-eshell-frame-buffer-alist - (cons (selected-frame) (current-buffer))))) - (defun my-file-owner-p (file) "t if FILE is owned by me." (eq (user-uid) (nth 2 (file-attributes file)))) @@ -1604,11 +1590,6 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." ;; ;; (eshell/alias "ut" "ssh g841105@un001.ecc.u-tokyo.ac.jp") ;; (add-to-list 'recentf-exclude (concat eshell-directory-name "alias")))) -;; (define-key my-prefix-map (kbd "C-s") (lambda () -;; (interactive) -;; (eshell-cd-default-directory (buffer-name (or (my-eshell-frame-buffer (selected-frame)) -;; (eshell t)))))) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; 最終更新日時を得る From 9b29ec372f73931a37c1dd0b4a3d4fe0e2495dd1 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 1 Feb 2012 21:32:39 +0900 Subject: [PATCH 013/107] rearrange code --- emacs.el | 140 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 74 insertions(+), 66 deletions(-) diff --git a/emacs.el b/emacs.el index 55b561d..fa08600 100644 --- a/emacs.el +++ b/emacs.el @@ -94,16 +94,6 @@ (lambda () (kill-buffer "*scratch*"))) -(defun my-delete-frame-or-kill-emacs () - "delete frame when opening multiple frame, kill emacs when only one." - (interactive) - (if (eq 1 - (length (frame-list))) - (save-buffers-kill-emacs) - (delete-frame))) -(global-set-key (kbd "C-x C-c") 'my-delete-frame-or-kill-emacs) -(define-key my-prefix-map (kbd "C-x C-c") 'save-buffers-kill-emacs) - ;; modifier keys (setq mac-option-modifier 'control) (setq w32-apps-modifier 'meta) @@ -480,9 +470,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; global keys -(define-key my-prefix-map (kbd "C-f") 'make-frame-command) (define-key my-prefix-map (kbd "C-o") 'occur) -(define-key my-prefix-map (kbd "C-s") 'my-execute-terminal) ;; (define-key my-prefix-map (kbd "C-h") help-map) (global-set-key (kbd "C-\\") help-map) @@ -743,9 +731,9 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; frame buffer -;; (add-hook 'after-make-frame-functions -;; (lambda (frame) -;; (recentf-open-files))) +(add-hook 'after-make-frame-functions + (lambda (frame) + (switch-to-buffer (recentf-open-files)))) ;; (defvar aaa nil) ;; (plist-get aaa 'abc) @@ -754,24 +742,29 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (defvar my-frame-buffer-plist nil) ;; (setplist my-frame-buffer-plist nil) -(defun my-frame-buffer-add () +(defun my-frame-buffer-add (&optional buf frame) "" (setq my-frame-buffer-plist (plist-put my-frame-buffer-plist - (selected-frame) - (let ((lst (my-frame-buffer-get))) + (or frame + (selected-frame)) + (let ((lst (my-frame-buffer-get frame))) (if lst (add-to-list 'lst - (current-buffer)) - (list (current-buffer))))))) + (or buf + (current-buffer))) + (list (or buf + (current-buffer)))))))) -(defun my-frame-buffer-remove () +(defun my-frame-buffer-remove (&optional buf frame) "" (setq my-frame-buffer-plist (plist-put my-frame-buffer-plist - (selected-frame) - (delq (current-buffer) - (my-frame-buffer-get))))) + (or frame + (selected-frame)) + (delq (or buf + (current-buffer)) + (my-frame-buffer-get frame))))) (defun my-frame-buffer-get (&optional frame) "" @@ -779,21 +772,73 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (or frame (selected-frame)))) -(defun my-frame-buffer-kill-all-buffer (frame) +(defun my-frame-buffer-kill-all-buffer (&optional frame) "" (mapcar 'kill-buffer (my-frame-buffer-get frame))) (add-hook 'find-file-hook 'my-frame-buffer-add) -;; (add-hook 'dired-mode-hook -;; 'my-frame-buffer-add) +(add-hook 'term-mode-hook + 'my-frame-buffer-add) +(add-hook 'eshell-mode-hook + 'my-frame-buffer-add) + (add-hook 'kill-buffer-hook 'my-frame-buffer-remove) (add-hook 'delete-frame-functions 'my-frame-buffer-kill-all-buffer) -(frame-parameters (selected-frame)) + +(defvar my-desktop-terminal "roxterm") +(defun my-execute-terminal () + "" + (interactive) + (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-term))) + +(defun my-term () + "open terminal buffer and return that buffer." + (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 (plist-get my-frame-term-plist (selected-frame)))) + (if (and buf + (buffer-name buf)) + (switch-to-buffer buf) + (setq my-frame-term-plist + (plist-put my-frame-term-plist + (selected-frame) + (my-term)))))) + +(defun my-delete-frame-or-kill-emacs () + "delete frame when opening multiple frame, kill emacs when only one." + (interactive) + (if (eq 1 + (length (frame-list))) + (save-buffers-kill-emacs) + (delete-frame))) + +(define-key my-prefix-map (kbd "C-s") 'my-execute-terminal) +(define-key my-prefix-map (kbd "C-f") 'make-frame-command) +(global-set-key (kbd "C-x C-c") 'my-delete-frame-or-kill-emacs) +(define-key my-prefix-map (kbd "C-x C-c") 'save-buffers-kill-emacs) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; term mode @@ -1438,7 +1483,7 @@ Optional prefix ARG says how many lines to unflag; default is one line." ;; (defun eshell/git (&rest args) ;; "" -;; (eshell-parse-arguments (point-at-bol) (point-at-eol))) +;; ) (defun eshell/o (&optional file) (my-x-open (or file "."))) @@ -1660,43 +1705,6 @@ when SEC is nil, stop auto save if enabled." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; misc funcs -(defvar my-desktop-terminal "roxterm") -(defun my-execute-terminal () - "" - (interactive) - (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 () - "open terminal buffer and return that buffer." - (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 (plist-get my-frame-term-plist (selected-frame)))) - (if (and buf - (buffer-name buf)) - (switch-to-buffer buf) - (setq my-frame-term-plist - (plist-put my-frame-term-plist - (selected-frame) - (my-term)))))) - (defun my-format-time-string (&optional time) "" (let ((system-time-locale "C")) From b04a0fc4062c3aa34ceb67257baefcabd0541a2c Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 1 Feb 2012 21:34:12 +0900 Subject: [PATCH 014/107] rm frame term func --- emacs.el | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/emacs.el b/emacs.el index fa08600..6936069 100644 --- a/emacs.el +++ b/emacs.el @@ -813,20 +813,6 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (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 (plist-get my-frame-term-plist (selected-frame)))) - (if (and buf - (buffer-name buf)) - (switch-to-buffer buf) - (setq my-frame-term-plist - (plist-put my-frame-term-plist - (selected-frame) - (my-term)))))) - (defun my-delete-frame-or-kill-emacs () "delete frame when opening multiple frame, kill emacs when only one." (interactive) From 4bffcce8be1f180ed2b491a620b19db9764c5de2 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 1 Feb 2012 21:53:45 +0900 Subject: [PATCH 015/107] fix bug --- emacs.el | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/emacs.el b/emacs.el index 6936069..bdf2416 100644 --- a/emacs.el +++ b/emacs.el @@ -731,16 +731,11 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; frame buffer -(add-hook 'after-make-frame-functions - (lambda (frame) - (switch-to-buffer (recentf-open-files)))) - -;; (defvar aaa nil) -;; (plist-get aaa 'abc) -;; (setq aaa (plist-put aaa 'abc 'efg)) +(add-hook 'before-make-frame-hook + (lambda () + (switch-to-buffer "*Messages*"))) (defvar my-frame-buffer-plist nil) -;; (setplist my-frame-buffer-plist nil) (defun my-frame-buffer-add (&optional buf frame) "" From e8e1f43b2b48c7b9af1525aefc8b3537fb04b9fe Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 2 Feb 2012 15:50:30 +0900 Subject: [PATCH 016/107] rm buffer cycle func --- emacs.el | 65 -------------------------------------------------------- 1 file changed, 65 deletions(-) diff --git a/emacs.el b/emacs.el index bdf2416..f5dacdd 100644 --- a/emacs.el +++ b/emacs.el @@ -705,10 +705,6 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (define-key view-mode-map "q" 'bury-buffer))) (global-set-key "\M-r" 'view-mode) (setq view-read-only t) -;; (add-hook 'find-file-hook -;; (lambda () -;; (when buffer-read-only -;; (view-mode 1)))) (add-hook 'Man-mode-hook (lambda () @@ -899,56 +895,6 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (with-current-buffer bf (equal (expand-file-name default-directory) cdir)))) -(defun echo-buffer-list (&optional blist) - "echo buffer list as string. BLIST is list with buffer objects as elements. -if arg is omitted use value of `buffer-list'." - (interactive) - (message (or (mapconcat (lambda (bf) - (concat (buffer-name bf) - "\t" - (with-current-buffer bf - (symbol-name major-mode)) - "\t" - (abbreviate-file-name (buffer-file-name bf)))) - (or blist - (buffer-list)) - "\n") - ""))) - -(defun my-buffer-list () - "return buffer list." - (delq nil - (mapcar (lambda (bf) - (with-current-buffer bf - (and buffer-file-name - bf))) - (buffer-list (selected-frame))))) - -(defvar buffer-switch-list-function 'my-buffer-list) - -(defun switch-to-previous-buffer-cycle (&optional silent-p) - "" - (interactive) - (let ((bl (funcall buffer-switch-list-function))) - (when bl - (bury-buffer (car bl)) - (switch-to-buffer (or (nth 1 bl) - (car bl))) - (or silent-p - (echo-buffer-list (funcall buffer-switch-list-function)))))) - -(defun switch-to-next-buffer-cycle (&optional silent-p) - "" - (interactive) - (let* ((bl (funcall buffer-switch-list-function)) - (bf (nth (- (length bl) - 1) - bl))) - (when bl - (switch-to-buffer bf) - (or silent-p - (echo-buffer-list (funcall buffer-switch-list-function)))))) - (iswitchb-mode 1) (defun iswitchb-buffer-display-other-window () @@ -957,17 +903,6 @@ if arg is omitted use value of `buffer-list'." (let ((iswitchb-default-method 'display)) (call-interactively 'iswitchb-buffer))) -(defun switch-to-other-buffer () - "" - (interactive) - (let ((buffer-switch-list-function 'buffer-list)) - (switch-to-previous-buffer-cycle t))) - -(global-set-key (kbd "C-.") 'switch-to-previous-buffer-cycle) -(global-set-key (kbd "C-,") 'switch-to-next-buffer-cycle) -;; (global-set-key (kbd "C-\\") 'switch-to-other-buffer) -;; (global-set-key (kbd "C-\\") 'bury-buffer) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sdic From 424fbfdcae4548b9fd1cc7f733356b477b50de5c Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 2 Feb 2012 21:36:34 +0900 Subject: [PATCH 017/107] add python-mode pref --- emacs.el | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/emacs.el b/emacs.el index f5dacdd..03d39d4 100644 --- a/emacs.el +++ b/emacs.el @@ -603,8 +603,18 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (shell-command (buffer-substring-no-properties (point-at-bol) (point)))) +(add-hook 'python-mode-hook + (lambda () + ())) + +(defun my-python-run-as-command () + "" + (interactive) + (shell-command (concat python-command " " buffer-file-name))) + (add-hook 'inferior-python-mode-hook (lambda () + (set-window-text-height (display-buffer (current-buffer) t) 7) (define-key inferior-python-mode-map (kbd "") 'comint-previous-input) (define-key inferior-python-mode-map (kbd "") 'comint-next-input))) From 1381e544a199976749659bcfd1572cc4c077fd35 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 3 Feb 2012 15:32:15 +0900 Subject: [PATCH 018/107] change diff face --- emacs.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/emacs.el b/emacs.el index 03d39d4..2d004e4 100644 --- a/emacs.el +++ b/emacs.el @@ -585,11 +585,14 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (add-hook 'diff-mode-hook (lambda () (view-mode 1) + (set-face-foreground 'diff-file-header-face nil) + (set-face-foreground 'diff-header-face nil) (set-face-foreground 'diff-index-face "blue") - (set-face-foreground 'diff-hunk-header-face "magenda") + (set-face-foreground 'diff-hunk-header-face "cyan") + (set-face-foreground 'diff-context-face nil) (set-face-foreground 'diff-removed-face "red") - (set-face-foreground 'diff-added-face "blue") - (set-face-foreground 'diff-changed-face "syan") + (set-face-foreground 'diff-added-face "green") + (set-face-foreground 'diff-changed-face "magenda") )) ;; (ffap-bindings) From c5c935122d48157da9afe52b4e343b0950727853 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 3 Feb 2012 15:33:11 +0900 Subject: [PATCH 019/107] add some python-mode prefs and funcs --- emacs.el | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/emacs.el b/emacs.el index 2d004e4..d59fc9f 100644 --- a/emacs.el +++ b/emacs.el @@ -600,24 +600,27 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (add-hook 'sh-mode-hook (lambda () (define-key sh-mode-map (kbd "C-x C-e") 'my-execute-shell-command-current-line))) + (defun my-execute-shell-command-current-line () "" (interactive) (shell-command (buffer-substring-no-properties (point-at-bol) (point)))) -(add-hook 'python-mode-hook - (lambda () - ())) - (defun my-python-run-as-command () "" (interactive) (shell-command (concat python-command " " buffer-file-name))) +(add-hook 'python-mode-hook + (lambda () + (define-key python-mode-map (kbd "C-c C-e") 'my-python-run-as-command))) + (add-hook 'inferior-python-mode-hook (lambda () - (set-window-text-height (display-buffer (current-buffer) t) 7) + (set-window-text-height (display-buffer (current-buffer) + t) + 7) (define-key inferior-python-mode-map (kbd "") 'comint-previous-input) (define-key inferior-python-mode-map (kbd "") 'comint-next-input))) @@ -630,7 +633,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (define-key apropos-mode-map "j" 'next-line) (define-key apropos-mode-map "k" 'previous-line))) -(define-key minibuffer-local-map (kbd "C-u") (lambda () (interactive) (delete-region (point-at-bol) (point-at-eol)))) +(define-key minibuffer-local-map (kbd "C-u") (lambda () (interactive) (delete-region (point-at-bol) (point)))) (add-hook 'isearch-mode-hook (lambda () @@ -657,11 +660,6 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (outline-minor-mode 1) (set (make-local-variable 'comment-start) ";")))) -;; (add-hook 'c-mode-hook -;; (lambda () -;; (set (make-local-variable 'comment-start) "//") -;; (set (make-local-variable 'comment-end) ""))) - ;; http://d.hatena.ne.jp/emergent/20070203/1170512717 ;; c-mode ;; (setq c-default-style "bsd") From 76b6a4953177ac3cfc21e01bb2c9cc539e653a91 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 4 Feb 2012 16:13:17 +0900 Subject: [PATCH 020/107] LC_MESSAGES=C when text login --- profile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profile b/profile index 702f319..77c84fe 100755 --- a/profile +++ b/profile @@ -17,7 +17,7 @@ if [ -n "${DESKTOP_SESSION}" ]; then type feh >/dev/null 2>&1 && sh "$HOME/.fehbg" else - export LANG=C + export LC_MESSAGES=C fi # export PS1="\$ " From 32e24f3075a80d6497ad2f94899aedbdbc08e18e Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 5 Feb 2012 03:19:38 +0900 Subject: [PATCH 021/107] change way to display frame initial buffer --- emacs.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/emacs.el b/emacs.el index d59fc9f..bed8add 100644 --- a/emacs.el +++ b/emacs.el @@ -738,9 +738,10 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; frame buffer -(add-hook 'before-make-frame-hook - (lambda () - (switch-to-buffer "*Messages*"))) +(add-hook 'after-make-frame-functions + (lambda (frame) + (set-window-buffer (frame-selected-window frame) + "*Messages*"))) (defvar my-frame-buffer-plist nil) From fe9b57975de034bb573d8777fc960ac04a57dc46 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 5 Feb 2012 04:25:15 +0900 Subject: [PATCH 022/107] fix bug of modeline color --- emacs.el | 92 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/emacs.el b/emacs.el index bed8add..a550c97 100644 --- a/emacs.el +++ b/emacs.el @@ -98,52 +98,6 @@ (setq mac-option-modifier 'control) (setq w32-apps-modifier 'meta) -;; http://www.emacswiki.org/emacs/ChangingCursorDynamically -;; why saving buffer? -;; Change cursor color according to mode -(defvar hcz-set-cursor-color-color "") -(defvar hcz-set-cursor-color-buffer "") -(defun hcz-set-cursor-color-according-to-mode () - "change cursor color according to some minor modes." - ;; set-cursor-color is somewhat costly, so we only call it when needed: - (let ((color - (if buffer-read-only "blue" - (if overwrite-mode "yellow" - "black")))) - (unless (and - (string= color hcz-set-cursor-color-color) - (string= (buffer-name) hcz-set-cursor-color-buffer)) - (set-cursor-color (setq hcz-set-cursor-color-color color)) - (setq hcz-set-cursor-color-buffer (buffer-name))))) -(and window-system - (add-hook 'post-command-hook 'hcz-set-cursor-color-according-to-mode)) - -(defun my-set-mode-line-color-read-only () - "" - (let ((state (if buffer-read-only - 'readonly - (if overwrite-mode - 'overwrite - 'insert)))) - (unless (eq state my-set-mode-line-color-state) - (set-face-foreground 'modeline - (nth 1 - (assq state - my-set-mode-line-color-color))) - (set-face-background 'modeline - (nth 2 - (assq state - my-set-mode-line-color-color))) - (setq my-set-mode-line-color-state state)))) -(defvar my-set-mode-line-color-color nil "") -(setq my-set-mode-line-color-color - '((readonly "blue" "white") - (overwrite "red" "white") - (insert nil nil))) -(defvar my-set-mode-line-color-state nil "") -(add-hook 'post-command-hook 'my-set-mode-line-color-read-only) -(add-hook 'after-init-hook 'my-set-mode-line-color-read-only) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mode-line @@ -344,6 +298,52 @@ ;; (my-set-ascii-and-jp-font-with-size '("ProggyCleanTTSZ" 120 "takaogothic" 11)) ;; あ a +;; http://www.emacswiki.org/emacs/ChangingCursorDynamically +;; why saving buffer? +;; Change cursor color according to mode +(defvar hcz-set-cursor-color-color "") +(defvar hcz-set-cursor-color-buffer "") +(defun hcz-set-cursor-color-according-to-mode () + "change cursor color according to some minor modes." + ;; set-cursor-color is somewhat costly, so we only call it when needed: + (let ((color + (if buffer-read-only "blue" + (if overwrite-mode "yellow" + "black")))) + (unless (and + (string= color hcz-set-cursor-color-color) + (string= (buffer-name) hcz-set-cursor-color-buffer)) + (set-cursor-color (setq hcz-set-cursor-color-color color)) + (setq hcz-set-cursor-color-buffer (buffer-name))))) +(and window-system + (add-hook 'post-command-hook 'hcz-set-cursor-color-according-to-mode)) + +(defun my-set-mode-line-color-read-only () + "" + (let ((state (if buffer-read-only + 'readonly + (if overwrite-mode + 'overwrite + 'insert)))) + (unless (eq state my-set-mode-line-color-state) + (set-face-foreground 'modeline + (nth 1 + (assq state + my-set-mode-line-color-color))) + (set-face-background 'modeline + (nth 2 + (assq state + my-set-mode-line-color-color))) + (setq my-set-mode-line-color-state state)))) +(defvar my-set-mode-line-color-color nil "") +(setq my-set-mode-line-color-color + `((readonly "blue" "white") + (overwrite "red" "white") + (insert ,(face-foreground 'modeline) ,(face-background 'modeline)))) +(defvar my-set-mode-line-color-state nil "") +(add-hook 'post-command-hook 'my-set-mode-line-color-read-only) +(add-hook 'after-init-hook 'my-set-mode-line-color-read-only) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; file handling From 9ba36aefec4c6fd792432f27f148da98ef1709f2 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 5 Feb 2012 09:18:41 +0900 Subject: [PATCH 023/107] update modeline color pref --- emacs.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/emacs.el b/emacs.el index a550c97..83ca86d 100644 --- a/emacs.el +++ b/emacs.el @@ -337,9 +337,13 @@ (setq my-set-mode-line-color-state state)))) (defvar my-set-mode-line-color-color nil "") (setq my-set-mode-line-color-color + (if window-system + `((readonly "white" "blue") + (overwrite "white" "red") + (insert ,(face-foreground 'modeline) ,(face-background 'modeline))) `((readonly "blue" "white") (overwrite "red" "white") - (insert ,(face-foreground 'modeline) ,(face-background 'modeline)))) + (insert ,(face-foreground 'modeline) ,(face-background 'modeline))))) (defvar my-set-mode-line-color-state nil "") (add-hook 'post-command-hook 'my-set-mode-line-color-read-only) (add-hook 'after-init-hook 'my-set-mode-line-color-read-only) From 544d5ff994a2a7d4b5c4ad552c481061f74bbb03 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 6 Feb 2012 08:36:53 +0900 Subject: [PATCH 024/107] fix prefs around gauche --- emacs.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/emacs.el b/emacs.el index 83ca86d..a4f0b52 100644 --- a/emacs.el +++ b/emacs.el @@ -975,6 +975,13 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (lambda () (define-key scheme-mode-map "\C-c\C-b" 'scheme-send-buffer))) +(add-hook 'inferior-scheme-mode-hook + (lambda () + (set-window-text-height (display-buffer (current-buffer) + t) + 7) + )) + ;; http://d.hatena.ne.jp/kobapan/20090305/1236261804 ;; http://www.katch.ne.jp/~leque/software/repos/gauche-mode/gauche-mode.el @@ -982,12 +989,12 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." "http://www.katch.ne.jp/~leque/software/repos/gauche-mode/gauche-mode.el" t) (setq auto-mode-alist - (cons '("\.scm$" . gauche-mode) auto-mode-alist)) + (cons '("\.gosh$" . gauche-mode) auto-mode-alist)) (autoload 'gauche-mode "gauche-mode" "Major mode for Scheme." t) (autoload 'run-scheme "gauche-mode" "Run an inferior Scheme process." t) (add-hook 'gauche-mode-hook (lambda () - (define-key scheme-mode-map "\C-c\C-z" 'run-gauche-other-window)))) + (define-key gauche-mode-map "\C-c\C-z" 'run-gauche-other-window)))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; recentf-mode From c0cb79ab1697ed1268afb7d1a2646d60852a14e0 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 6 Feb 2012 10:08:00 +0900 Subject: [PATCH 025/107] rm comment --- emacs.el | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/emacs.el b/emacs.el index a4f0b52..6b905fc 100644 --- a/emacs.el +++ b/emacs.el @@ -509,26 +509,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; download library from web -;; (require 'url) - -;; (defun dllib-if-needed (lib url &optional callback bite-compile-p force-download-p) ; dont use it -;; "if LIB does not exist, download it from URL and rename to \"~/emacs.d/lisp/LIB.el\". -;; after download LIB successfully call CALLBACK. if LIB already exist, call CALLBACK immediately." -;; (let* ((dir (expand-file-name "~/.emacs.d/lisp/")) -;; (lpath (concat dir lib ".el"))) -;; (and (if (or force-download-p (not (locate-library lib))) -;; (condition-case nil -;; (progn (url-copy-file url -;; lpath -;; t) -;; (and bite-compile-p -;; (byte-compile-file lpath) -;; t)) -;; (error (message "downloading %s...something wrong happened!" url) -;; nil)) -;; t) -;; callback -;; (funcall callback)))) +(require 'url) (defun dllib-if-unfound (lib url &optional bite-compile-p force-download-p) ; new version "if LIB does not exist, download it from URL and locate it to \"~/emacs.d/lisp/LIB.el\". @@ -868,7 +849,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (define-key term-raw-map "q" 'my-term-quit-or-send-raw) (define-key term-raw-map (kbd "ESC") 'term-send-raw) (define-key term-raw-map [delete] 'term-send-raw) - (define-key term-raw-map "\C-h" 'term-send-backspace) + (define-key term-raw-map (kbd "DEL") 'term-send-backspace) (define-key term-raw-map "\C-y" 'term-paste) (define-key term-raw-map "\C-c" 'term-send-raw) ;; 'term-interrupt-subjob) ;; (dolist (key '("" "" "" "")) @@ -973,7 +954,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (add-hook 'scheme-mode-hook (lambda () - (define-key scheme-mode-map "\C-c\C-b" 'scheme-send-buffer))) + (define-key scheme-mode-map "\C-c\C-c" 'scheme-send-buffer))) (add-hook 'inferior-scheme-mode-hook (lambda () @@ -990,6 +971,8 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." t) (setq auto-mode-alist (cons '("\.gosh$" . gauche-mode) auto-mode-alist)) + (setq auto-mode-alist + (cons '("\.gaucherc$" . gauche-mode) auto-mode-alist)) (autoload 'gauche-mode "gauche-mode" "Major mode for Scheme." t) (autoload 'run-scheme "gauche-mode" "Run an inferior Scheme process." t) (add-hook 'gauche-mode-hook From 8f0e52ed2b6aed86c0952d51831c8b68f74eb615 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 8 Feb 2012 00:10:53 +0900 Subject: [PATCH 026/107] modify mode-line color, fix gauche prefs --- emacs.el | 65 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/emacs.el b/emacs.el index 6b905fc..eb82fbc 100644 --- a/emacs.el +++ b/emacs.el @@ -57,9 +57,6 @@ (add-hook 'after-init-hook (lambda () - ;; (message "init time: %d msec" - ;; (+ (* (- (nth 1 after-init-time) (nth 1 before-init-time)) 1000) - ;; (/ (- (nth 2 after-init-time) (nth 2 before-init-time)) 1000))) (message (emacs-init-time)) (switch-to-buffer "*Messages*") )) @@ -205,8 +202,9 @@ Man-mode)) (standard-display-ascii ?\n "$\n") -(copy-face 'default 'my-eol-face) -(set-face-foreground 'my-eol-face "green") +(set-face-foreground (copy-face 'default + 'my-eol-face) + "green") ;; (defface my-eol-face ;; '((t (:foreground "green"))) ;; "eol.") @@ -318,7 +316,7 @@ (and window-system (add-hook 'post-command-hook 'hcz-set-cursor-color-according-to-mode)) -(defun my-set-mode-line-color-read-only () +(defun my-set-mode-line-color-according-to-readily-state () "" (let ((state (if buffer-read-only 'readonly @@ -326,11 +324,11 @@ 'overwrite 'insert)))) (unless (eq state my-set-mode-line-color-state) - (set-face-foreground 'modeline + (set-face-foreground 'mode-line (nth 1 (assq state my-set-mode-line-color-color))) - (set-face-background 'modeline + (set-face-background 'mode-line (nth 2 (assq state my-set-mode-line-color-color))) @@ -341,12 +339,12 @@ `((readonly "white" "blue") (overwrite "white" "red") (insert ,(face-foreground 'modeline) ,(face-background 'modeline))) - `((readonly "blue" "white") - (overwrite "red" "white") - (insert ,(face-foreground 'modeline) ,(face-background 'modeline))))) + `((readonly "blue" "white") + (overwrite "red" "white") + (insert ,(face-foreground 'modeline) ,(face-background 'modeline))))) (defvar my-set-mode-line-color-state nil "") -(add-hook 'post-command-hook 'my-set-mode-line-color-read-only) -(add-hook 'after-init-hook 'my-set-mode-line-color-read-only) +(add-hook 'post-command-hook 'my-set-mode-line-color-according-to-readily-state) +(add-hook 'after-init-hook 'my-set-mode-line-color-according-to-readily-state) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; file handling @@ -379,7 +377,7 @@ (setq kill-whole-line t) (setq scroll-conservatively 35 scroll-margin 2 - scroll-step 0) ;4行ずつスクロール? + scroll-step 0) (setq default-major-mode 'text-mode) (setq next-line-add-newlines nil) (setq kill-read-only-ok t) @@ -538,9 +536,9 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; share clipboard with x (when (and window-system - ;; (getenv "DESKTOP_SESSION") - (not (eq window-system 'mac)) - ) + ;; (getenv "DESKTOP_SESSION") + (not (eq window-system 'mac)) + ) (setq x-select-enable-clipboard t ; these settings seems to be useless when using emacs in terminal x-select-enable-primary nil) ;; (global-set-key "\C-y" 'x-clipboard-yank) @@ -934,7 +932,8 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; gauche-mode -(setq scheme-program-name "gosh") +(setq scheme-program-name + (setq gauche-program-name "gosh")) (defun run-gauche-other-window () "Run gauche on other window" @@ -945,21 +944,25 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (defun run-gauche () "run gauche" - (run-scheme "gosh")) + (run-scheme gauche-program-name) + ) (defun scheme-send-buffer () "" (interactive) - (scheme-send-region (point-min) (point-max))) + (scheme-send-region (point-min) (point-max)) + (set-window-text-height (display-buffer "*scheme*" + t) + 7) + ) (add-hook 'scheme-mode-hook (lambda () - (define-key scheme-mode-map "\C-c\C-c" 'scheme-send-buffer))) + nil)) (add-hook 'inferior-scheme-mode-hook (lambda () - (set-window-text-height (display-buffer (current-buffer) - t) + (set-window-text-height (display-buffer "*scheme*") 7) )) @@ -977,7 +980,9 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (autoload 'run-scheme "gauche-mode" "Run an inferior Scheme process." t) (add-hook 'gauche-mode-hook (lambda () - (define-key gauche-mode-map "\C-c\C-z" 'run-gauche-other-window)))) + (define-key gauche-mode-map "\C-c\C-z" 'run-gauche-other-window) + (define-key scheme-mode-map "\C-c\C-c" 'scheme-send-buffer) + ))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; recentf-mode @@ -1302,8 +1307,8 @@ otherwise, use `pack-default-extension' for pack." (setq ls-lisp-dirs-first t) (setq ls-lisp-use-localized-time-format t) (setq ls-lisp-format-time-list - '("%Y-%m-%d %H:%M" - "%Y-%m-%d ")) + '("%Y-%m-%d %H:%M" + "%Y-%m-%d ")) (setq dired-dwim-target t) @@ -1524,15 +1529,15 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." (add-to-list 'eshell-command-aliases-list alias)) '( - ; ("ll" "ls -l $*") - ; ("la" "ls -a $*") - ; ("lla" "ls -al $*") + ; ("ll" "ls -l $*") + ; ("la" "ls -a $*") + ; ("lla" "ls -al $*") ("ut" "slogin 03110414@un001.ecc.u-tokyo.ac.jp $*") ("aptin" "apt-get install $*") ("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 $*") )) - ; (eshell/alias "g" "git $*") + ; (eshell/alias "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) From afa1569f72cfe0ae89068a29345c0b29f4cb9c7b Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 8 Feb 2012 00:11:14 +0900 Subject: [PATCH 027/107] add sh prefs --- bashrc | 2 +- profile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bashrc b/bashrc index 461567e..3ea6c3d 100755 --- a/bashrc +++ b/bashrc @@ -89,7 +89,7 @@ alias reloadrc="test -f ~/.bashrc && source ~/.bashrc" alias sudo="sudo " # use aliases through sudo alias e3=e3em alias mytime="date +%Y%m%d-%H%M%S" -alias sh="ENV=$HOME/.shrc sh" +alias sh="ENV=$HOME/.shrc PS1=\$\ sh" if isdarwin then alias upgrade="port selfupdate && port sync && port upgrade installed" diff --git a/profile b/profile index 77c84fe..b62ac19 100755 --- a/profile +++ b/profile @@ -25,6 +25,7 @@ export LC_TIME=C export TERMCAP="${TERMCAP}:vb=" export HOSTNAME export BROWSER=firefox +export ENV=~/.shrc # export TMP=/tmp # export TEMP=/tmp From d16e0c2b2258e6c7c8465ad8eebcf2f10fb844fc Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 8 Feb 2012 00:12:08 +0900 Subject: [PATCH 028/107] rm cursor color change func --- emacs.el | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/emacs.el b/emacs.el index eb82fbc..1002291 100644 --- a/emacs.el +++ b/emacs.el @@ -296,26 +296,6 @@ ;; (my-set-ascii-and-jp-font-with-size '("ProggyCleanTTSZ" 120 "takaogothic" 11)) ;; あ a -;; http://www.emacswiki.org/emacs/ChangingCursorDynamically -;; why saving buffer? -;; Change cursor color according to mode -(defvar hcz-set-cursor-color-color "") -(defvar hcz-set-cursor-color-buffer "") -(defun hcz-set-cursor-color-according-to-mode () - "change cursor color according to some minor modes." - ;; set-cursor-color is somewhat costly, so we only call it when needed: - (let ((color - (if buffer-read-only "blue" - (if overwrite-mode "yellow" - "black")))) - (unless (and - (string= color hcz-set-cursor-color-color) - (string= (buffer-name) hcz-set-cursor-color-buffer)) - (set-cursor-color (setq hcz-set-cursor-color-color color)) - (setq hcz-set-cursor-color-buffer (buffer-name))))) -(and window-system - (add-hook 'post-command-hook 'hcz-set-cursor-color-according-to-mode)) - (defun my-set-mode-line-color-according-to-readily-state () "" (let ((state (if buffer-read-only From 49a57dc4e9024886bd2ab0b55fe58754fe93105d Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 8 Feb 2012 00:21:11 +0900 Subject: [PATCH 029/107] disable hl-mode in term-mode, fix bug --- emacs.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/emacs.el b/emacs.el index 1002291..94e4cc5 100644 --- a/emacs.el +++ b/emacs.el @@ -833,12 +833,15 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." ;; (dolist (key '("" "" "" "")) ;; (define-key term-raw-map (kbd key) 'term-send-raw)) ;; (define-key term-raw-map "\C-d" 'delete-char) - (set (make-variable-buffer-local 'scroll-margin) 0) - ;; (set (make-variable-buffer-local 'cua-enable-cua-keys) nil) + (set (make-local-variable 'scroll-margin) 0) + ;; (set (make-local-variable 'cua-enable-cua-keys) nil) ;; (cua-mode 0) ;; (and cua-mode ;; (local-unset-key (kbd "C-c"))) ;; (define-key cua--prefix-override-keymap "\C-c" 'term-interrupt-subjob) + (set (make-local-variable 'hl-line-range-function) + (lambda () + '(0 0))) )) ;; (add-hook 'term-exec-hook 'forward-char) @@ -861,7 +864,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (setq bs-default-configuration "this-frame") ;; (and bs--show-all ;; (call-interactively 'bs-toggle-show-all)) - (set (make-variable-buffer-local 'scroll-margin) 0) + (set (make-local-variable 'scroll-margin) 0) )) (defun buffer-same-dir-p (bf) @@ -1520,7 +1523,7 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." ; (eshell/alias "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) + (set (make-local-variable 'scroll-margin) 0) ;; (eshell/export "GIT_PAGER=") ;; (eshell/export "GIT_EDITOR=") (eshell/export "LC_MESSAGES=C") From 65f33038bd612ee74641a6d253079193b42c4ef6 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 8 Feb 2012 00:42:07 +0900 Subject: [PATCH 030/107] fix bug --- emacs.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/emacs.el b/emacs.el index 94e4cc5..94f680d 100644 --- a/emacs.el +++ b/emacs.el @@ -296,7 +296,7 @@ ;; (my-set-ascii-and-jp-font-with-size '("ProggyCleanTTSZ" 120 "takaogothic" 11)) ;; あ a -(defun my-set-mode-line-color-according-to-readily-state () +(defun my-set-mode-line-color-according-to-readonly-state () "" (let ((state (if buffer-read-only 'readonly @@ -304,11 +304,11 @@ 'overwrite 'insert)))) (unless (eq state my-set-mode-line-color-state) - (set-face-foreground 'mode-line + (set-face-foreground 'modeline (nth 1 (assq state my-set-mode-line-color-color))) - (set-face-background 'mode-line + (set-face-background 'modeline (nth 2 (assq state my-set-mode-line-color-color))) @@ -323,8 +323,11 @@ (overwrite "red" "white") (insert ,(face-foreground 'modeline) ,(face-background 'modeline))))) (defvar my-set-mode-line-color-state nil "") -(add-hook 'post-command-hook 'my-set-mode-line-color-according-to-readily-state) -(add-hook 'after-init-hook 'my-set-mode-line-color-according-to-readily-state) +(add-hook 'post-command-hook 'my-set-mode-line-color-according-to-readonly-state) +(add-hook 'after-init-hook 'my-set-mode-line-color-according-to-readonly-state) + +;; (set-face-foreground 'mode-line-inactive (if window-system "gray" "white")) +;; (set-face-background 'mode-line-inactive (if window-system "white" "gray")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; file handling From cc4b41efa931f6bf110b4208e4ff34b4f06d2d46 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 8 Feb 2012 00:46:21 +0900 Subject: [PATCH 031/107] fix bug --- emacs.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs.el b/emacs.el index 94f680d..f9ad918 100644 --- a/emacs.el +++ b/emacs.el @@ -844,7 +844,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." ;; (define-key cua--prefix-override-keymap "\C-c" 'term-interrupt-subjob) (set (make-local-variable 'hl-line-range-function) (lambda () - '(0 0))) + '(0 . 0))) )) ;; (add-hook 'term-exec-hook 'forward-char) From b6d7900e5e85395b443afd3a03aac433b1eb786d Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 8 Feb 2012 09:01:53 +0900 Subject: [PATCH 032/107] rename some command --- bashrc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/bashrc b/bashrc index 3ea6c3d..58cc4ca 100755 --- a/bashrc +++ b/bashrc @@ -33,7 +33,7 @@ fi null(){ "$@" >/dev/null 2>&1 } -safe-cmd(){ +__try_exec(){ type $1 >/dev/null 2>&1 && "$@" } replace-cmd(){ @@ -85,7 +85,7 @@ alias q=exit alias p="$PAGER" alias c=cat alias pcalc="python -i -c 'from math import *' " -alias reloadrc="test -f ~/.bashrc && source ~/.bashrc" +alias _reloadrc="test -f ~/.bashrc && source ~/.bashrc" alias sudo="sudo " # use aliases through sudo alias e3=e3em alias mytime="date +%Y%m%d-%H%M%S" @@ -221,7 +221,7 @@ convmv-sjis2utf8-test(){ convmv-sjis2utf8-notest(){ convmv -r -f sjis -t utf8 * --notest } -_my-dl-init-files(){ +_my_dl_init_files(){ for file in .bashrc .vimrc .emacs do local flag=0 @@ -314,10 +314,10 @@ __my_prompt_function(){ # used by PS1 local pwd=$(echo "${PWD}/" | sed -e "s#${HOME}#~#") local oldpwd=$(echo "${OLDPWD}/" | sed -e "s#${HOME}#~#") local jobnum=$(jobs | wc -l) - local git=$(safe-cmd __git_ps1 [GIT:%s]) - local date=$(LANG=C safe-cmd date +"%a, %d %b %Y %T %z") + local git=$(__try_exec __git_ps1 [GIT:%s]) + local date=$(LANG=C __try_exec date +"%a, %d %b %Y %T %z") fi - local svn=$(type svn >/dev/null 2>&1 && safe-cmd __my_svn_ps1 [SVN:%s]) + local svn=$(type svn >/dev/null 2>&1 && __try_exec __my_svn_ps1 [SVN:%s]) printf "${_MEMO}" printf "$(test -f ~/.prompt.sh && bash ~/.prompt.sh)\n" printf " [${c1}${pwd}${cdef}<${c3}${oldpwd}${cdef}]${git}${svn}\n" @@ -426,12 +426,12 @@ _testjp uname -a test -f /etc/issue.net && cat /etc/issue.net -safe-cmd diskinfo +__try_exec diskinfo ! isdarwin && test -n "${DESKTOP_SESSION}" && type xrandr >/dev/null 2>&1 && { xrandr | grep --color=never ^Screen } -iswindows || safe-cmd finger $USER -LANG=C safe-cmd id +iswindows || __try_exec finger $USER +LANG=C __try_exec id From b7833f912851db43a07d2b6fcc05330fbdc46bb1 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 8 Feb 2012 09:10:08 +0900 Subject: [PATCH 033/107] rm my_dl_init_files --- bashrc | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/bashrc b/bashrc index 58cc4ca..c56f106 100755 --- a/bashrc +++ b/bashrc @@ -4,7 +4,6 @@ test -r /etc/bashrc && . /etc/bashrc ########################## # system type -# $OSTYPEとか使えるのかな if uname | grep -E "^MINGW32" >/dev/null 2>&1 then @@ -63,7 +62,7 @@ export LESS="-iRMX" export GIT_PAGER="$PAGER" export GIT_EDITOR="$EDITOR" -alias ls="ls -hCFG $(test "$TERM" == dumb || echo --color=auto) --time-style=long-iso" +alias ls="ls -hCFG $(test "$TERM" == dumb || echo --color=auto\ )--time-style=long-iso" # alias ll="ls -l" # alias la="ls -A" # alias lla="ls -Al" @@ -85,6 +84,7 @@ alias q=exit alias p="$PAGER" alias c=cat alias pcalc="python -i -c 'from math import *' " +alias py3=python3 alias _reloadrc="test -f ~/.bashrc && source ~/.bashrc" alias sudo="sudo " # use aliases through sudo alias e3=e3em @@ -221,25 +221,6 @@ convmv-sjis2utf8-test(){ convmv-sjis2utf8-notest(){ convmv -r -f sjis -t utf8 * --notest } -_my_dl_init_files(){ - for file in .bashrc .vimrc .emacs - do - local flag=0 - if test -f ~/${file}.new - then - mv ~/${file}.new ~/${file}.old - echo "${file}.new already exist. Rename it to ${file}.old." - flag=1 - fi - wget https://dl.dropbox.com/u/1751156/${file} -O ~/${file}.new - local wgetreturn=$? - if test ${flag} -eq 1 -a ${wgetreturn} -eq 0 - then - rm ~/${file}.old - echo "${file}.old deleted." - fi - done -} _mygitconfig(){ git config --global user.name '10sr' git config --global user.email '8slashes+git@gmail.com' @@ -328,7 +309,7 @@ __my_prompt_function(){ # used by PS1 # type date >/dev/null 2>&1 || alias date=":" # "cmd /c echo %time%" if [ "${EMACS}" = "t" ]; then # emacs shell用 - : export PS1="\u@\H \d \t \w\nemacs shell\$ " + true export PS1="\u@\H \d \t \w\nemacs shell\$ " elif echo "$EMACS" | grep term >/dev/null 2>&1; then # emacs term用 echo "emacs term" fi From 67144d4a0df0b6264762db70b9d95aa2b45712d7 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 8 Feb 2012 12:14:51 +0900 Subject: [PATCH 034/107] fix python and gauche prefs for inferior process --- emacs.el | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/emacs.el b/emacs.el index f9ad918..380e9d5 100644 --- a/emacs.el +++ b/emacs.el @@ -573,20 +573,29 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (shell-command (buffer-substring-no-properties (point-at-bol) (point)))) +(setq python-python-command (executable-find "python3")) (defun my-python-run-as-command () "" (interactive) - (shell-command (concat python-command " " buffer-file-name))) + (shell-command (concat python-python-command " " buffer-file-name))) +(defun my-python-display-python-buffer () + "" + (interactive) + ;; (or python-buffer + ;; (save-excursion + ;; (run-python))) + (set-window-text-height (display-buffer python-buffer + t) + 7)) (add-hook 'python-mode-hook (lambda () - (define-key python-mode-map (kbd "C-c C-e") 'my-python-run-as-command))) + (define-key python-mode-map (kbd "C-c C-e") 'my-python-run-as-command) + (define-key python-mode-map (kbd "C-c C-b") 'my-python-display-python-buffer))) (add-hook 'inferior-python-mode-hook (lambda () - (set-window-text-height (display-buffer (current-buffer) - t) - 7) + (my-python-display-python-buffer) (define-key inferior-python-mode-map (kbd "") 'comint-previous-input) (define-key inferior-python-mode-map (kbd "") 'comint-next-input))) @@ -937,21 +946,24 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." "" (interactive) (scheme-send-region (point-min) (point-max)) - (set-window-text-height (display-buffer "*scheme*" - t) - 7) + (my-scheme-display-scheme-buffer) ) +(defun my-scheme-display-scheme-buffer () + "" + (interactive) + (set-window-text-height (display-buffer scheme-buffer + t) + 7)) + (add-hook 'scheme-mode-hook (lambda () nil)) (add-hook 'inferior-scheme-mode-hook (lambda () - (set-window-text-height (display-buffer "*scheme*") - 7) + ;; (my-scheme-display-scheme-buffer) )) - ;; http://d.hatena.ne.jp/kobapan/20090305/1236261804 ;; http://www.katch.ne.jp/~leque/software/repos/gauche-mode/gauche-mode.el @@ -966,8 +978,9 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (autoload 'run-scheme "gauche-mode" "Run an inferior Scheme process." t) (add-hook 'gauche-mode-hook (lambda () - (define-key gauche-mode-map "\C-c\C-z" 'run-gauche-other-window) - (define-key scheme-mode-map "\C-c\C-c" 'scheme-send-buffer) + (define-key gauche-mode-map (kbd "C-c C-z") 'run-gauche-other-window) + (define-key scheme-mode-map (kbd "C-c C-c") 'scheme-send-buffer) + (define-key scheme-mode-map (kbd "C-c C-b") 'my-scheme-display-scheme-buffer) ))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; From 716ea095fdc3192b4b8a916676de3652a02594ab Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 9 Feb 2012 12:58:44 +0900 Subject: [PATCH 035/107] fix indent --- emacs.el | 66 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 32 deletions(-) diff --git a/emacs.el b/emacs.el index 380e9d5..20de40a 100644 --- a/emacs.el +++ b/emacs.el @@ -823,38 +823,40 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." ;; 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 (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) - ;; (define-key term-raw-map "\C-s" 'term-send-raw) - ;; (define-key term-raw-map "\C-f" 'forward-char) - ;; (define-key term-raw-map "\C-b" 'backward-char) - ;; (define-key term-raw-map "\C-t" 'set-mark-command) - (define-key term-raw-map "\C-x" (lookup-key (current-global-map) "\C-x")) - (define-key term-raw-map "\C-z" (lookup-key (current-global-map) "\C-z"))) - (define-key term-raw-map "q" 'my-term-quit-or-send-raw) - (define-key term-raw-map (kbd "ESC") 'term-send-raw) - (define-key term-raw-map [delete] 'term-send-raw) - (define-key term-raw-map (kbd "DEL") 'term-send-backspace) - (define-key term-raw-map "\C-y" 'term-paste) - (define-key term-raw-map "\C-c" 'term-send-raw) ;; 'term-interrupt-subjob) - ;; (dolist (key '("" "" "" "")) - ;; (define-key term-raw-map (kbd key) 'term-send-raw)) - ;; (define-key term-raw-map "\C-d" 'delete-char) - (set (make-local-variable 'scroll-margin) 0) - ;; (set (make-local-variable 'cua-enable-cua-keys) nil) - ;; (cua-mode 0) - ;; (and cua-mode - ;; (local-unset-key (kbd "C-c"))) - ;; (define-key cua--prefix-override-keymap "\C-c" 'term-interrupt-subjob) - (set (make-local-variable 'hl-line-range-function) - (lambda () - '(0 . 0))) - )) +(add-hook 'term-setup-hook + (lambda () + (setq term-display-table (make-display-table)))) +(add-hook 'term-mode-hook + (lambda () + (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) + ;; (define-key term-raw-map "\C-s" 'term-send-raw) + ;; (define-key term-raw-map "\C-f" 'forward-char) + ;; (define-key term-raw-map "\C-b" 'backward-char) + ;; (define-key term-raw-map "\C-t" 'set-mark-command) + (define-key term-raw-map "\C-x" (lookup-key (current-global-map) "\C-x")) + (define-key term-raw-map "\C-z" (lookup-key (current-global-map) "\C-z"))) + (define-key term-raw-map "q" 'my-term-quit-or-send-raw) + (define-key term-raw-map (kbd "ESC") 'term-send-raw) + (define-key term-raw-map [delete] 'term-send-raw) + (define-key term-raw-map (kbd "DEL") 'term-send-backspace) + (define-key term-raw-map "\C-y" 'term-paste) + (define-key term-raw-map "\C-c" 'term-send-raw) ;; 'term-interrupt-subjob) + ;; (dolist (key '("" "" "" "")) + ;; (define-key term-raw-map (kbd key) 'term-send-raw)) + ;; (define-key term-raw-map "\C-d" 'delete-char) + (set (make-local-variable 'scroll-margin) 0) + ;; (set (make-local-variable 'cua-enable-cua-keys) nil) + ;; (cua-mode 0) + ;; (and cua-mode + ;; (local-unset-key (kbd "C-c"))) + ;; (define-key cua--prefix-override-keymap "\C-c" 'term-interrupt-subjob) + (set (make-local-variable 'hl-line-range-function) + (lambda () + '(0 . 0))) + )) ;; (add-hook 'term-exec-hook 'forward-char) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; From 31e10e39c0e37f2b679c0f93c2860cbf4b43da6f Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 9 Feb 2012 12:59:15 +0900 Subject: [PATCH 036/107] modify prompt function, rm memo func --- bashrc | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/bashrc b/bashrc index c56f106..5d0779b 100755 --- a/bashrc +++ b/bashrc @@ -35,9 +35,6 @@ null(){ __try_exec(){ type $1 >/dev/null 2>&1 && "$@" } -replace-cmd(){ - type $1 1>/dev/null || alias $1=true -} export PS1="\$(__my_prompt_function)\$ " # PROMPT_COMMAND=prompt_function @@ -77,7 +74,6 @@ alias ut="ssh t110414@un001.ecc.u-tokyo.ac.jp" alias rand="echo \$RANDOM" alias xunp="file-roller -h" alias pacome="sudo \paco -D" -alias destroy="rm -rf" alias psall="ps auxww" alias g=git alias q=exit @@ -155,12 +151,6 @@ di(){ fi ${diffcmd} -u "$@" | ${PAGER} } -memo(){ - __MYMEMO="# $*\n" -} -rmmemo(){ - __MYMEMO="" -} throw-away(){ mkdir -p ~/bu/tb for file in "$@" @@ -299,8 +289,7 @@ __my_prompt_function(){ # used by PS1 local date=$(LANG=C __try_exec date +"%a, %d %b %Y %T %z") fi local svn=$(type svn >/dev/null 2>&1 && __try_exec __my_svn_ps1 [SVN:%s]) - printf "${_MEMO}" - printf "$(test -f ~/.prompt.sh && bash ~/.prompt.sh)\n" + jobs printf " [${c1}${pwd}${cdef}<${c3}${oldpwd}${cdef}]${git}${svn}\n" printf "${c2}${USER}@${HOSTNAME}${cdef} ${date} ${BASH} ${BASH_VERSION}\n" printf "shlv:${SHLVL} jobs:${jobnum} last:${lastreturn} " From 3300e7678a3d269acb806e66ad355c1b57ff33f1 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 12 Feb 2012 14:24:28 +0900 Subject: [PATCH 037/107] eshell/git not works --- emacs.el | 48 +++++++++++++++++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 11 deletions(-) diff --git a/emacs.el b/emacs.el index 20de40a..cbb54b5 100644 --- a/emacs.el +++ b/emacs.el @@ -1439,6 +1439,18 @@ Optional prefix ARG says how many lines to unflag; default is one line." (defun eshell/v () (view-mode 1)) +(defun eshell/git (&rest args) + "" + (if (member (car args) + '("di" "diff" "log" "show")) + (apply 'eshell-exec-visual "git" args) + (shell-command (mapconcat 'shell-quote-argument + `("git" ,@args) + " ") + t) + ;; (eshell-external-command "git" args) + )) + (defalias 'eshell/: 'ignore) (defalias 'eshell/type 'eshell/which) ;; (defalias 'eshell/vim 'eshell/vi) @@ -1472,7 +1484,9 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." (setq eshell-cmpl-ignore-case t) (setq eshell-cmpl-cycle-completions nil) (setq eshell-highlight-prompt nil) -(setq eshell-ls-initial-args "-FG") ; "-hF") +(setq eshell-ls-initial-args '("-hCFG" + "--color=auto" + "--time-style=long-iso")) ; "-hF") (setq eshell-prompt-function (lambda () (with-temp-buffer @@ -1526,6 +1540,28 @@ if arg given, use that eshell buffer, otherwise make new eshell buffer." (define-key eshell-mode-map (kbd "DEL") 'my-eshell-backward-delete-char) (define-key eshell-mode-map (kbd "C-p") 'eshell-previous-matching-input-from-input) (define-key eshell-mode-map (kbd "C-n") 'eshell-next-matching-input-from-input) + (apply 'eshell/addpath exec-path) + (set (make-local-variable 'scroll-margin) 0) + ;; (eshell/export "GIT_PAGER=") + ;; (eshell/export "GIT_EDITOR=") + (eshell/export "LC_MESSAGES=C") + (switch-to-buffer (current-buffer)) ; move buffer top of list + (set (make-local-variable 'hl-line-range-function) + (lambda () + '(0 . 0))) + (add-to-list 'eshell-virtual-targets + '("/dev/less" + (lambda (str) + (if str + (with-current-buffer nil))) + nil)) + )) + +(add-hook 'eshell-mode-hook + (lambda () + (add-to-list 'eshell-visual-commands "vim") + ;; (add-to-list 'eshell-visual-commands "git") + (add-to-list 'eshell-output-filter-functions 'eshell-truncate-buffer) (mapcar (lambda (alias) (add-to-list 'eshell-command-aliases-list alias)) @@ -1538,16 +1574,6 @@ if arg given, use that eshell buffer, otherwise make new eshell 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 $*") )) - ; (eshell/alias "g" "git $*") - (add-to-list 'eshell-output-filter-functions 'eshell-truncate-buffer) - (apply 'eshell/addpath exec-path) - (set (make-local-variable 'scroll-margin) 0) - ;; (eshell/export "GIT_PAGER=") - ;; (eshell/export "GIT_EDITOR=") - (eshell/export "LC_MESSAGES=C") - (add-to-list 'eshell-visual-commands "vim") - (add-to-list 'eshell-visual-commands "git") - (switch-to-buffer (current-buffer)) ; move buffer top of list )) ;; (eval-after-load "em-alias" From fa8988fbbc30cbc839ac68ef5f28ba814cb42ccd Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 15 Feb 2012 00:38:06 +0900 Subject: [PATCH 038/107] update my-dired-next/previous-line --- emacs.el | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/emacs.el b/emacs.el index cbb54b5..9e85086 100644 --- a/emacs.el +++ b/emacs.el @@ -1069,7 +1069,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (require 'dired) -(defun my-dired-echo-file-head (&optional arg) +(defun my-dired-echo-file-head (arg) "" (interactive "P") (let ((f (dired-get-filename))) @@ -1217,11 +1217,11 @@ otherwise, use `pack-default-extension' for pack." (while (search-forward "なし" nil t) (replace-match "none"))))) -(defun dired-get-du () ;em-unix.el使えるかも +(defun dired-get-du () "dired get disk usage" (interactive) (message "calculating du...") - (dired-do-shell-command "du -hs * " nil (dired-get-marked-files))) + (dired-do-shell-command "du -hsD * " nil (dired-get-marked-files))) (defun my-dired-scroll-up () "" @@ -1233,17 +1233,33 @@ otherwise, use `pack-default-extension' for pack." (interactive) (my-dired-next-line (- (window-height) 1))) -(defun my-dired-previous-line (&optional arg) +(defun my-dired-previous-line (arg) "" - (interactive) - (dired-previous-line (or arg 1)) - (my-dired-print-current-dir-and-file)) + (interactive "p") + (when (> arg 0) + ;; (ignore 'my-dired-print-current-dir-and-file) + (dired-previous-line 1) + (when (eq (line-number-at-pos) + 2) + (goto-line (- (line-number-at-pos (point-max)) + 1)) + (dired-move-to-filename)) + (my-dired-next-line (- arg + 1)) + )) -(defun my-dired-next-line (&optional arg) +(defun my-dired-next-line (arg) "" - (interactive) - (dired-next-line (or arg 1)) - (my-dired-print-current-dir-and-file)) + (interactive "p") + (when (> arg 0) + ;; (ignore 'my-dired-print-current-dir-and-file) + (dired-next-line 1) + (when (eq (point) + (point-max)) + (goto-line 3) + (dired-move-to-filename)) + (my-dired-next-line (- arg 1)) + )) (defun my-dired-print-current-dir-and-file () (message "%s %s" From 03d62a75cd0966a572e026b06ee88ea8965421b2 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 15 Feb 2012 00:38:25 +0900 Subject: [PATCH 039/107] add radikox ext --- _keysnail.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/_keysnail.js b/_keysnail.js index 1078bf1..870bb38 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -158,6 +158,15 @@ plugins.options["twitter_client.use_jmp"] = true; //////////////////////////////////////////// // エクステ +ext.add('radikox-play-pause', function(){ + radikox.turn_power(); + radikox.power(); +}, 'radikox toggle play/pause'); + +ext.add('radikox-select-station', function(){ + var m = document.getElementById("radikox_menupopup"); +}, 'radikox station'); + ext.add('my-setpref', function(){ util.setPrefs( { From 10de91f14cec761494a148dea711f817f3c8afc8 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 15 Feb 2012 00:44:30 +0900 Subject: [PATCH 040/107] fix bug --- emacs.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs.el b/emacs.el index 9e85086..f798436 100644 --- a/emacs.el +++ b/emacs.el @@ -1244,7 +1244,7 @@ otherwise, use `pack-default-extension' for pack." (goto-line (- (line-number-at-pos (point-max)) 1)) (dired-move-to-filename)) - (my-dired-next-line (- arg + (my-dired-previous-line (- arg 1)) )) From b7e3d7c4213ff302b288e0e65b76b30e51b5bff2 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 18 Feb 2012 13:10:07 +0900 Subject: [PATCH 041/107] fix bug --- emacs.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/emacs.el b/emacs.el index f798436..f19c7bb 100644 --- a/emacs.el +++ b/emacs.el @@ -332,7 +332,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; file handling -(setq revert-without-query ".+") +(setq revert-without-query '(".+")) ;; カーソルの場所を保存する (when (require 'saveplace nil t) @@ -1244,8 +1244,7 @@ otherwise, use `pack-default-extension' for pack." (goto-line (- (line-number-at-pos (point-max)) 1)) (dired-move-to-filename)) - (my-dired-previous-line (- arg - 1)) + (my-dired-previous-line (- arg 1)) )) (defun my-dired-next-line (arg) From a983335a86cbdf0074c8ec11f594076273c21a1d Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 18 Feb 2012 13:11:35 +0900 Subject: [PATCH 042/107] rm radikox ext because they are used for plugin --- _keysnail.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/_keysnail.js b/_keysnail.js index 870bb38..1078bf1 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -158,15 +158,6 @@ plugins.options["twitter_client.use_jmp"] = true; //////////////////////////////////////////// // エクステ -ext.add('radikox-play-pause', function(){ - radikox.turn_power(); - radikox.power(); -}, 'radikox toggle play/pause'); - -ext.add('radikox-select-station', function(){ - var m = document.getElementById("radikox_menupopup"); -}, 'radikox station'); - ext.add('my-setpref', function(){ util.setPrefs( { From 5efa5a58d6b8df5c512a371c368f3dc3538a87a5 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 21 Feb 2012 17:21:20 +0900 Subject: [PATCH 043/107] make pack.el library --- emacs.el | 121 +++++-------------------------------------------------- 1 file changed, 11 insertions(+), 110 deletions(-) diff --git a/emacs.el b/emacs.el index f19c7bb..e8b4951 100644 --- a/emacs.el +++ b/emacs.el @@ -625,6 +625,8 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (add-to-list 'auto-mode-alist (cons "\\.ol$" 'outline-mode)) (add-to-list 'auto-mode-alist (cons "\\.md$" 'outline-mode)) +(setq markdown-command (or (executable-find "markdown") + (executable-find "markdown.pl"))) (when (dllib-if-unfound "markdown-mode" "http://jblevins.org/projects/markdown-mode/markdown-mode.el" t) @@ -1091,115 +1093,6 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (diff (cadr files) (dired-get-filename)) (message "One files must be marked!")))) -(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. - (length infiles)) - (car infiles)))) - (if (and onefile - (my-pack-file-name-association onefile)) - (when (y-or-n-p (format "unpack %s? " onefile)) - (my-unpack onefile)) - (let* ((dir-default (dired-dwim-target-directory)) - (archive-default (my-pack-file-extension (file-name-nondirectory (car infiles)))) - (archive ;; (if (interactive-p) - (read-file-name "Output file to pack : " - dir-default - nil - nil - archive-default) - ;; (concat dir-default archive-default) - )) - (apply 'my-pack - archive - infiles)))) - (revert-buffer) - ;; (dired-unmark-all-marks) - ) - -(defun my-file-name-extension-with-tar (filename) - "if FILENAME has extension with tar, like \"tar.gz\", return that. -otherwise, return extension normally." - (if (string-equal "tar" (file-name-extension (file-name-sans-extension filename))) - (concat "tar." - (file-name-extension filename)) - (file-name-extension filename))) - -(defun my-pack-file-extension (filename) - "if FILENAME has extension and it can be used for pack, return FILENAME. -otherwise, return FILENAME with `my-pack-default-extension'" - (if (my-pack-file-name-association filename) - filename - (concat filename "." my-pack-default-extension))) - -(defvar my-7z-program-name - (or (executable-find "7z") - (executable-find "7za") - (executable-find "7zr")) - "7z program.") - -(defvar my-pack-default-extension - "7z" - "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")) - ("\\.zip\\'" "zip -r" "unzip") - ("\\.tar\\'" "tar cf" "tar xf") - ("\\.tgz\\'" "tar czf" "tar xzf") - ("\\.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)) - (cmd (nth 1 - (my-pack-file-name-association earchive))) - ) - (if cmd - (shell-command (concat cmd - " " - (shell-quote-argument earchive))) - (message "this is not archive file defined in `pack-program-alist'!")))) - -(defun my-pack (archive &rest files) - "pack FILES into ARCHIVE. -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))) - (cmd (car (my-pack-file-name-association archive-ext))) - ) - (if cmd - (shell-command (concat cmd - " " - (shell-quote-argument archive-ext) - " " - (mapconcat 'shell-quote-argument - files - " "))) - (message "invalid extension for packing!")))) - (defun my-pop-to-buffer-erase-noselect (buffer-or-name) "pop up buffer using `display-buffer' and return that buffer." (let ((bf (get-buffer-create buffer-or-name))) @@ -1348,7 +1241,7 @@ otherwise, use `pack-default-extension' for pack." (define-key dired-mode-map "h" 'my-dired-echo-file-head) (define-key dired-mode-map "@" (lambda () (interactive) (my-x-open "."))) (define-key dired-mode-map (kbd "TAB") 'other-window) - (define-key dired-mode-map "P" 'my-dired-do-pack-or-unpack) + ;; (define-key dired-mode-map "P" 'my-dired-do-pack-or-unpack) (define-key dired-mode-map "a" 'my-dired-display-all-mode) (define-key dired-mode-map "/" 'dired-isearch-filenames) (define-key dired-mode-map (kbd "DEL") 'dired-up-directory) @@ -1360,6 +1253,14 @@ otherwise, use `pack-default-extension' for pack." (when (file-readable-p file) (delete-file file))))) +(and (dllib-if-unfound "pack" + "https://github.com/10sr/emacs-lisp/raw/master/pack.el" + t) + (require 'pack nil t) + (add-hook 'dired-mode-hook + (lambda () + (define-key dired-mode-map "P" 'dired-do-pack-or-unpack)))) + ;; http://blog.livedoor.jp/tek_nishi/archives/4693204.html (defun my-dired-toggle-mark() From 8aff948df7566202de981fd51359111022d3a4a4 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 21 Feb 2012 17:21:54 +0900 Subject: [PATCH 044/107] cleanse code --- bashrc | 55 +++++++++++++++++-------------------------------------- 1 file changed, 17 insertions(+), 38 deletions(-) diff --git a/bashrc b/bashrc index 5d0779b..3814e33 100755 --- a/bashrc +++ b/bashrc @@ -96,7 +96,7 @@ fi # type trash >/dev/null 2>&1 && alias rm=trash export __MYGITBAREREP="${HOME}/dbx/.git-bare" -git-make-bare-rep(){ +git-make-local-rep(){ test $# -eq 0 && { echo "specify repository name." 1>&2 return 1 @@ -108,38 +108,18 @@ git-make-bare-rep(){ then echo "dir $dir already exist!" 1>&2 else - mkdir -p "$dir" && - pushd "$dir" && - git init --bare --shared=all - popd - fi -} - -git-add-bare-rep(){ - test $# -ne 2 && { - echo "specify repository name and shortname." 1>&2 - return 1 - } - - dir="${__MYGITBAREREP}/$2.git" - - # git-make-bare-rep $2 && - # git remote add $1 "$dir" - # git remote -v - - if test -d "$dir" - then - git remote add $1 "$dir" - git remote -v - else - echo "dir $dir does not exist!" 1>&2 + mkdir -p "$dir" && { + pushd "$dir" && + git init --bare --shared=all + popd + } fi } bak(){ for file in "$@" do - cp ${file} ${file}.bak + mv -v ${file} ${file}.bak done } di(){ @@ -388,20 +368,19 @@ fi ####################### -_testjp(){ - echo "Japanese letters are 表示可能" -} -_testjp - uname -a test -f /etc/issue.net && cat /etc/issue.net -__try_exec diskinfo +showinfo(){ + echo "Japanese letters are 表示可能" -! isdarwin && test -n "${DESKTOP_SESSION}" && type xrandr >/dev/null 2>&1 && { - xrandr | grep --color=never ^Screen -} + __try_exec diskinfo + + ! isdarwin && test -n "${DESKTOP_SESSION}" && type xrandr >/dev/null 2>&1 && { + xrandr | grep --color=never ^Screen + } -iswindows || __try_exec finger $USER -LANG=C __try_exec id + iswindows || __try_exec finger $USER + LANG=C __try_exec id +} From f795709f35c1550e385b3d51c7697d8c2c764086 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 21 Feb 2012 18:24:47 +0900 Subject: [PATCH 045/107] add windate, waiting to be tested --- bashrc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bashrc b/bashrc index 3814e33..bba53d1 100755 --- a/bashrc +++ b/bashrc @@ -92,6 +92,7 @@ then else alias upgrade="sudo apt-get autoremove --yes && sudo apt-get update --yes && sudo apt-get upgrade --yes" fi +iswindows && ! type windate >/dev/null 2>&1 && alias windate="/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%'" # alias diff="$(type colordiff >/dev/null 2>&1 && test $TERM != dumb && echo color)diff -u" # type trash >/dev/null 2>&1 && alias rm=trash @@ -103,17 +104,19 @@ git-make-local-rep(){ } dir="${__MYGITBAREREP}/$1.git" + cdir=$PWD if test -d "$dir" then echo "dir $dir already exist!" 1>&2 else mkdir -p "$dir" && { - pushd "$dir" && + cd "$dir" && git init --bare --shared=all - popd } fi + + cd ${cdir} } bak(){ @@ -382,5 +385,4 @@ showinfo(){ iswindows || __try_exec finger $USER LANG=C __try_exec id - } From dd35e7661b5724e6a2b22fcbddc97d4c20723c64 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 22 Feb 2012 21:20:56 +0900 Subject: [PATCH 046/107] do not attempt to load /etc/bashrc --- bashrc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/bashrc b/bashrc index bba53d1..3433a5e 100755 --- a/bashrc +++ b/bashrc @@ -1,6 +1,6 @@ #!/bin/bash -test -r /etc/bashrc && . /etc/bashrc +# test -r /etc/bashrc && . /etc/bashrc ########################## # system type @@ -352,8 +352,6 @@ winln(){ fi } -######################## - if iscygwin; then alias cygsu="cygstart /cygwinsetup.exe" alias emacs="CYGWIN=tty emacs -nw" From 26dd276ca9419297a8da98ab6c52ef071838d355 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 22 Feb 2012 21:21:45 +0900 Subject: [PATCH 047/107] rm window-size-save --- emacs.el | 62 +------------------------------------------------------- 1 file changed, 1 insertion(+), 61 deletions(-) diff --git a/emacs.el b/emacs.el index e8b4951..bb0c201 100644 --- a/emacs.el +++ b/emacs.el @@ -1232,6 +1232,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (lambda () (define-key dired-mode-map "o" 'my-dired-x-open) (define-key dired-mode-map "i" 'dired-get-du) + (define-key dired-mode-map "f" 'find-file) (define-key dired-mode-map "!" 'shell-command) (define-key dired-mode-map "&" 'async-shell-command) (define-key dired-mode-map "X" 'dired-do-async-shell-command) @@ -1751,67 +1752,6 @@ this is test, does not rename files" (beep)))))))) ;; (aref (read-key-sequence-vector "aa") 0) -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; save and restore frame size -;;http://www.bookshelf.jp/soft/meadow_30.html#SEC416 -(defun my-window-size-save () - (let* ((rlist (frame-parameters (selected-frame))) - (ilist initial-frame-alist) - (nCHeight (frame-height)) - (nCWidth (frame-width)) - (tMargin (if (integerp (cdr (assoc 'top rlist))) - (cdr (assoc 'top rlist)) 0)) - (lMargin (if (integerp (cdr (assoc 'left rlist))) - (cdr (assoc 'left rlist)) 0)) - buf - (file "~/.emacs.d/.framesize.el") - (recentf-exclude '("\\.emacs\\.d/\\.framesize\\.el$"))) - (if (get-file-buffer (expand-file-name file)) - (setq buf (get-file-buffer (expand-file-name file))) - (setq buf (find-file-noselect file))) - (set-buffer buf) - (erase-buffer) - (insert (concat - ;; 初期値をいじるよりも modify-frame-parameters - ;; で変えるだけの方がいい? - "(delete 'width default-frame-alist)\n" - "(delete 'height default-frame-alist)\n" - "(delete 'top default-frame-alist)\n" - "(delete 'left default-frame-alist)\n" - "(setq default-frame-alist (append (list\n" - "'(width . " (int-to-string nCWidth) ")\n" - "'(height . " (int-to-string nCHeight) ")\n" - "'(top . " (int-to-string tMargin) ")\n" - "'(left . " (int-to-string lMargin) "))\n" - "default-frame-alist))\n" - ;;"(setq default-frame-alist default-frame-alist)" - )) - (save-buffer) - )) -(defun my-window-size-load () - (let* ((file "~/.emacs.d/.framesize.el")) - (if (file-exists-p file) - (load file)))) -(when window-system - (my-window-size-load) - (add-hook 'after-init-hook ;何かがframeの大きさ勝手に変えやがる - (lambda () - (run-with-timer 1 - nil - (lambda () - (modify-frame-parameters (selected-frame) - default-frame-alist)))) - t) - (add-hook 'kill-emacs-hook - 'my-window-size-save)) - -;; windowサイズを固定 -;; setq default-frame-alist -;; (append (list '(width . 80) -;; '(height . 35) -;; ) -;; default-frame-alist) -;; ) ;;デフォルトのフレーム設定 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ;; emacsを殺伐とさせる From 7615ca56f4db581a2e0fe5d5ab117ad1f9e6e668 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 23 Feb 2012 17:48:10 +0900 Subject: [PATCH 048/107] add memo of colortable16.sh url --- bashrc | 1 + 1 file changed, 1 insertion(+) diff --git a/bashrc b/bashrc index 3433a5e..2e65b14 100755 --- a/bashrc +++ b/bashrc @@ -329,6 +329,7 @@ _echocolors(){ "\e[37;1mBright White\n" \ "\e[0m" } +# http://myminios.googlecode.com/svn-history/r10/trunk/colortable16.sh null type stty && { stty stop undef # unbind C-s to stop displaying output From 7091182d10c68eb9ca76b932f618eaa94c4a3cf9 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 23 Feb 2012 17:48:24 +0900 Subject: [PATCH 049/107] update auto-revert --- emacs.el | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/emacs.el b/emacs.el index bb0c201..680ad38 100644 --- a/emacs.el +++ b/emacs.el @@ -1695,10 +1695,12 @@ this is test, does not rename files" (interactive) (unless (eq my-revert-buffer-if-needed-last-buffer (current-buffer)) (setq my-revert-buffer-if-needed-last-buffer (current-buffer)) - (when (or (eq major-mode 'dired-mode) + (when (or (and (eq major-mode 'dired-mode) + (dired-directory-changed-p default-directory)) (not (verify-visited-file-modtime (current-buffer)))) (revert-buffer t t) - (message "%s reverted." (buffer-name))))) + (message "%s reverted." (buffer-name)) + ))) (add-hook 'post-command-hook ; 'window-configuration-change-hook 'my-revert-buffer-if-needed) @@ -1766,7 +1768,7 @@ this is test, does not rename files" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; ubuntu +;; japanese input method (defun my-load-scim () "use scim-bridge.el as japanese im." From 8109a7847739387cd4539468cb3c0374c1e27d61 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 23 Feb 2012 22:38:57 +0900 Subject: [PATCH 050/107] add my-kill-buffers --- emacs.el | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/emacs.el b/emacs.el index 680ad38..c371b17 100644 --- a/emacs.el +++ b/emacs.el @@ -1208,11 +1208,11 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (add-hook 'dired-mode-hook 'my-dired-display-all-set) -(put 'dired-find-alternate-file 'disabled nil) +(put 'dired-find-alternate-file 'disabled nil) ; when using dired-find-alternate-file reuse current dired buffer for the file to open (setq dired-ls-F-marks-symlinks t) (require 'ls-lisp) -(setq ls-lisp-use-insert-directory-program nil) +(setq ls-lisp-use-insert-directory-program nil) ; always use ls-lisp (setq ls-lisp-dirs-first t) (setq ls-lisp-use-localized-time-format t) (setq ls-lisp-format-time-list @@ -1292,10 +1292,11 @@ Optional prefix ARG says how many lines to unflag; default is one line." (interactive "p") (my-dired-mark (- arg))) -(defun dired-mode-hooks() - (local-set-key (kbd "SPC") 'my-dired-mark) - (local-set-key (kbd "S-SPC") 'my-dired-mark-backward)) -(add-hook 'dired-mode-hook 'dired-mode-hooks) +(add-hook 'dired-mode-hook + (lambda () + (local-set-key (kbd "SPC") 'my-dired-mark) + (local-set-key (kbd "S-SPC") 'my-dired-mark-backward)) + ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; eshell @@ -1576,6 +1577,14 @@ when SEC is nil, stop auto save if enabled." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; misc funcs +(defun my-kill-buffers () + "" + (interactive) + (mapcar (lambda (buf) + (when (buffer-file-name buf) + (kill-buffer buf))) + (buffer-list))) + (defun my-format-time-string (&optional time) "" (let ((system-time-locale "C")) From e84cfc2a52334ceb8084ce32c04a9af2f23d8996 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 2 Mar 2012 23:41:46 +0900 Subject: [PATCH 051/107] add my-git-shell-command and make small changes --- emacs.el | 53 ++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 44 insertions(+), 9 deletions(-) diff --git a/emacs.el b/emacs.el index c371b17..711b1d2 100644 --- a/emacs.el +++ b/emacs.el @@ -70,11 +70,11 @@ (setq system-time-locale "C") ;; my prefix map -(defvar my-prefix-map - (make-sparse-keymap)) +(define-prefix-command 'my-prefix-map) (add-hook 'after-init-hook (lambda () - (define-key ctl-x-map (kbd "C-x") my-prefix-map))) + (define-key ctl-x-map (kbd "C-x") 'my-prefix-map) + )) (define-key my-prefix-map (kbd "C-q") 'quoted-insert) (define-key my-prefix-map (kbd "C-z") 'suspend-frame) @@ -381,8 +381,10 @@ ;; (global-set-key (kbd "M-h") 'backward-char) ;; (global-set-key (kbd "M-l") 'forward-char) ;;(keyboard-translate ?\M-j ?\C-j) -(global-set-key (kbd "M-p") 'backward-paragraph) -(global-set-key (kbd "M-n") 'forward-paragraph) +;; (global-set-key (kbd "M-p") 'backward-paragraph) +(define-key esc-map "p" 'backward-paragraph) +;; (global-set-key (kbd "M-n") 'forward-paragraph) +(define-key esc-map "n" 'forward-paragraph) (global-set-key (kbd "C-") (lambda () (interactive)(scroll-down 1))) (global-set-key (kbd "C-") (lambda () (interactive)(scroll-up 1))) (global-set-key (kbd "C-") 'scroll-down) @@ -511,6 +513,10 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (locate-library lib)) locate-p))) +'(setq package-archives '(("ELPA" . "http://tromey.com/elpa/") + ("gnu" . "http://elpa.gnu.org/packages/") + ("marmalade" . "http://marmalade-repo.org/packages/"))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;requireが必要なelispおよびhook @@ -1110,11 +1116,17 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (while (search-forward "なし" nil t) (replace-match "none"))))) -(defun dired-get-du () +(defun dired-get-file-info () "dired get disk usage" (interactive) - (message "calculating du...") - (dired-do-shell-command "du -hsD * " nil (dired-get-marked-files))) + (let ((f (dired-get-filename))) + (if (file-directory-p f) + (progn + (message "calculating du...") + (shell-command (concat "du -hsD " + f))) + (shell-command (concat "file " + f))))) (defun my-dired-scroll-up () "" @@ -1231,7 +1243,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (add-hook 'dired-mode-hook (lambda () (define-key dired-mode-map "o" 'my-dired-x-open) - (define-key dired-mode-map "i" 'dired-get-du) + (define-key dired-mode-map "i" 'dired-get-file-info) (define-key dired-mode-map "f" 'find-file) (define-key dired-mode-map "!" 'shell-command) (define-key dired-mode-map "&" 'async-shell-command) @@ -1577,6 +1589,29 @@ when SEC is nil, stop auto save if enabled." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; misc funcs +(when (require 'ansi-color nil t) + (ansi-color-for-comint-mode-on)) +(defvar git-command-history nil + "History list for git command.") +(defun my-git-shell-command (cmd) + "" + (interactive (list (read-shell-command "git: " + nil + 'git-command-history))) + (let ((bf (get-buffer-create "*Git Output*")) + ;; (process-environment `(,@process-environment)) + ;; (comint-preoutput-filter-functions '(ansi-color-apply . nil)) + ;; (comint-output-filter-functions (cons 'ansi-color-process-output + ;; comint-output-filter-functions)) + ) + (shell-command (concat "git " + cmd) + bf) + (with-current-buffer bf + (ansi-color-apply-on-region (point-min) + (point-max))))) +(define-key ctl-x-map "g" 'my-git-shell-command) + (defun my-kill-buffers () "" (interactive) From 83eda5263443329a9bf667c51e343cb2aae39b10 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 2 Mar 2012 23:46:11 +0900 Subject: [PATCH 052/107] misc changes --- bashrc | 2 +- emacs.el | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bashrc b/bashrc index 2e65b14..8f02e1a 100755 --- a/bashrc +++ b/bashrc @@ -207,7 +207,7 @@ _mygitconfig(){ git config --global alias.ci "commit --verbose" git config --global alias.co "checkout" git config --global alias.cim "commit --verbose -m" - git config --global alias.di "diff" + git config --global alias.di "diff --color" git config --global alias.me "merge --no-ff --stat -v" git config --global alias.ls "ls-files -v --full-name" git config --global alias.sl "!sl" diff --git a/emacs.el b/emacs.el index 711b1d2..3eaea86 100644 --- a/emacs.el +++ b/emacs.el @@ -1589,8 +1589,8 @@ when SEC is nil, stop auto save if enabled." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; misc funcs -(when (require 'ansi-color nil t) - (ansi-color-for-comint-mode-on)) +;; (when (require 'ansi-color nil t) +;; (ansi-color-for-comint-mode-on)) (defvar git-command-history nil "History list for git command.") (defun my-git-shell-command (cmd) From 9027b059faebbbe25d04d0f424c8f2cfd764084b Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 4 Mar 2012 19:13:38 +0900 Subject: [PATCH 053/107] use python as python-python-command when python3 is not found --- emacs.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/emacs.el b/emacs.el index 3eaea86..0c9a0a7 100644 --- a/emacs.el +++ b/emacs.el @@ -155,6 +155,7 @@ read-buffer-completion-ignore-case t) (setq resize-mini-window t) (temp-buffer-resize-mode 1) +(savehist-mode 1) (fset 'yes-or-no-p 'y-or-n-p) @@ -579,7 +580,8 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (shell-command (buffer-substring-no-properties (point-at-bol) (point)))) -(setq python-python-command (executable-find "python3")) +(setq python-python-command (or (executable-find "python3") + (executable-find "python"))) (defun my-python-run-as-command () "" (interactive) @@ -597,7 +599,8 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (add-hook 'python-mode-hook (lambda () (define-key python-mode-map (kbd "C-c C-e") 'my-python-run-as-command) - (define-key python-mode-map (kbd "C-c C-b") 'my-python-display-python-buffer))) + (define-key python-mode-map (kbd "C-c C-b") 'my-python-display-python-buffer) + (define-key python-mode-map (kbd "C-m") 'newline-and-indent))) (add-hook 'inferior-python-mode-hook (lambda () From 13cacbba769dbe1e8d0edd607e377d5ffbff889f Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 5 Mar 2012 13:35:11 +0900 Subject: [PATCH 054/107] modify --- emacs.el | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/emacs.el b/emacs.el index 0c9a0a7..e4e5b3f 100644 --- a/emacs.el +++ b/emacs.el @@ -589,13 +589,9 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (defun my-python-display-python-buffer () "" (interactive) - ;; (or python-buffer - ;; (save-excursion - ;; (run-python))) (set-window-text-height (display-buffer python-buffer t) 7)) - (add-hook 'python-mode-hook (lambda () (define-key python-mode-map (kbd "C-c C-e") 'my-python-run-as-command) @@ -935,13 +931,16 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." ;; vc ;; (require 'vc) -(setq vc-handled-backends nil) +(setq vc-handled-backends '()) +(and (executable-find "git") + (add-to-list 'vc-handled-backends 'GIT)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; gauche-mode -(setq scheme-program-name - (setq gauche-program-name "gosh")) +(let ((s (executable-find "gosh"))) + (setq scheme-program-name s + gauche-program-name s)) (defun run-gauche-other-window () "Run gauche on other window" @@ -1049,11 +1048,18 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (buffer-substring-no-properties (point-at-bol) (point-at-eol)))) -(setq recentf-save-file (expand-file-name "~/.emacs.d/.recentf") +(setq recentf-save-file (expand-file-name "~/.emacs.d/recentf") recentf-max-menu-items 20 recentf-max-saved-items 30 recentf-show-file-shortcuts-flag nil) +(defun my-recentf-pop-to-buffer () + "" + (interactive) + (let ((bf (save-excursion + (recentf-open-files)))) + (pop-to-buffer bf))) + (when (require 'recentf nil t) (global-set-key "\C-x\C-r" 'recentf-open-files) ;; (add-hook 'find-file-hook @@ -1061,7 +1067,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." ;; (recentf-add-file default-directory))) (recentf-mode 1) (add-to-list 'recentf-filename-handlers 'abbreviate-file-name) - (add-to-list 'recentf-exclude "\\.emacs\\.d/\\.recentf")) + (add-to-list 'recentf-exclude "\\.emacs\\.d/recentf")) (add-hook 'recentf-dialog-mode-hook (lambda () From 20488b2078a1e841b0ca741fe4f3f0ce8c6ab23c Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 7 Mar 2012 20:56:25 +0900 Subject: [PATCH 055/107] split profile into 2 files, for console and for x --- profile | 19 ------------------- xinitrc | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 19 deletions(-) create mode 100644 xinitrc diff --git a/profile b/profile index b62ac19..14cd0db 100755 --- a/profile +++ b/profile @@ -1,25 +1,6 @@ #!/bin/sh env > $HOME/.env.txt -if [ -n "${DESKTOP_SESSION}" ]; then - xmodmap -e 'keycode 135 = Alt_R Meta_R' # menu key as alt - xmodmap -e 'keycode 101 = Alt_R Meta_R' # hiragana key as alt - xmodmap -e 'remove Lock = Caps_Lock' - xmodmap -e 'add Control = Caps_Lock' - - synclient VertEdgeScroll=0 - synclient HorizEdgeScroll=0 - synclient MaxTapTime=0 - synclient MaxSpeed=0.4 - synclient MinSpeed=0.2 - - test -f "$HOME/.fehbg" && - type feh >/dev/null 2>&1 && - sh "$HOME/.fehbg" -else - export LC_MESSAGES=C -fi - # export PS1="\$ " export LC_TIME=C export TERMCAP="${TERMCAP}:vb=" diff --git a/xinitrc b/xinitrc new file mode 100644 index 0000000..9cc0520 --- /dev/null +++ b/xinitrc @@ -0,0 +1,18 @@ +xmodmap -e 'keycode 135 = Alt_R Meta_R' # menu key as alt +xmodmap -e 'keycode 101 = Alt_R Meta_R' # hiragana key as alt +#xmodmap -e 'remove Lock = Caps_Lock' +#xmodmap -e 'add Control = Caps_Lock' + +synclient VertEdgeScroll=0 +synclient HorizEdgeScroll=0 +synclient MaxTapTime=0 +synclient MaxSpeed=0.4 +synclient MinSpeed=0.2 + +test -f "$HOME/.fehbg" && +type feh >/dev/null 2>&1 && +sh "$HOME/.fehbg" + +#export LC_MESSAGES=C +LANG=ja_JP.utf8 + From 42dcd437d50ae50b9e87308267806c1874a6c818 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 7 Mar 2012 21:03:07 +0900 Subject: [PATCH 056/107] disable auto indent when text-mode --- emacs.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/emacs.el b/emacs.el index e4e5b3f..32499c8 100644 --- a/emacs.el +++ b/emacs.el @@ -604,6 +604,10 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (define-key inferior-python-mode-map (kbd "") 'comint-previous-input) (define-key inferior-python-mode-map (kbd "") 'comint-next-input))) +(add-hook 'text-mode-hook + (lambda () + (define-key text-mode-map (kbd "C-m") 'newline))) + (add-to-list 'Info-default-directory-list (expand-file-name "~/.info/emacs-ja")) (setq bookmark-default-file "~/.emacs.d/bmk") From 142850189ad69df53fb7bbfb6340c40c9c8dfdc6 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 7 Mar 2012 21:07:30 +0900 Subject: [PATCH 057/107] modify README --- README.txt | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/README.txt b/README.txt index 987c90a..5bca638 100644 --- a/README.txt +++ b/README.txt @@ -1,13 +1,12 @@ -~/.xsessionrc <= graphical login +~/.bash_profile <= console login | -`-- ~/.profile <= text login - | - |-- ~/.dotfiles/profile - | - * if shell is bash - | - `-- ~/.bashrc <= run bash - | - `-- ~/.dotfiles/bashrc - | - `-- /etc/bashrc +|--~/.dotfiles/profile +| +`--~/.bashrc + | + `--~/.dotfiles/bashrc + +~/.xinitrc <= startx (~/.config/openbox/autostart also executed) +| +`--~/.dotfiles/xinitrc + From 6f28af40c47db1c10e483a66743360d344ff1756 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 7 Mar 2012 21:10:54 +0900 Subject: [PATCH 058/107] modify xinitrc --- xinitrc | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/xinitrc b/xinitrc index 9cc0520..57aa27d 100644 --- a/xinitrc +++ b/xinitrc @@ -2,12 +2,15 @@ xmodmap -e 'keycode 135 = Alt_R Meta_R' # menu key as alt xmodmap -e 'keycode 101 = Alt_R Meta_R' # hiragana key as alt #xmodmap -e 'remove Lock = Caps_Lock' #xmodmap -e 'add Control = Caps_Lock' +setxkbmap -model "acer_laptop" -layout "jp" -option "ctrl:nocaps" -synclient VertEdgeScroll=0 -synclient HorizEdgeScroll=0 -synclient MaxTapTime=0 -synclient MaxSpeed=0.4 -synclient MinSpeed=0.2 +type synclient >/dev/null 2&>1 && { + synclient VertEdgeScroll=0 + synclient HorizEdgeScroll=0 + synclient MaxTapTime=0 + synclient MaxSpeed=0.4 + synclient MinSpeed=0.2 +} test -f "$HOME/.fehbg" && type feh >/dev/null 2>&1 && From f1a996ce2d9f11c82355a18ea4f67002e61b1dfc Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 7 Mar 2012 21:19:23 +0900 Subject: [PATCH 059/107] fix stupid bug --- xinitrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xinitrc b/xinitrc index 57aa27d..b7c5604 100644 --- a/xinitrc +++ b/xinitrc @@ -4,7 +4,7 @@ xmodmap -e 'keycode 101 = Alt_R Meta_R' # hiragana key as alt #xmodmap -e 'add Control = Caps_Lock' setxkbmap -model "acer_laptop" -layout "jp" -option "ctrl:nocaps" -type synclient >/dev/null 2&>1 && { +type synclient >/dev/null 2>&1 && { synclient VertEdgeScroll=0 synclient HorizEdgeScroll=0 synclient MaxTapTime=0 From d3dd1beafd25278a891024fe186b5e891018116d Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 8 Mar 2012 00:34:41 +0900 Subject: [PATCH 060/107] fix language environment --- bashrc | 2 +- xinitrc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bashrc b/bashrc index 8f02e1a..537426b 100755 --- a/bashrc +++ b/bashrc @@ -53,7 +53,7 @@ else fi export VISUAL="$EDITOR" export LESS="-iRMX" -# export LC_MESSAGES="C" +export LC_MESSAGES=C # export LANG=ja_JP.UTF-8 # export CDPATH=".:~" # 使い方がよく分からない export GIT_PAGER="$PAGER" diff --git a/xinitrc b/xinitrc index b7c5604..b505e65 100644 --- a/xinitrc +++ b/xinitrc @@ -8,7 +8,7 @@ type synclient >/dev/null 2>&1 && { synclient VertEdgeScroll=0 synclient HorizEdgeScroll=0 synclient MaxTapTime=0 - synclient MaxSpeed=0.4 + synclient MaxSpeed=2.0 synclient MinSpeed=0.2 } @@ -17,5 +17,5 @@ type feh >/dev/null 2>&1 && sh "$HOME/.fehbg" #export LC_MESSAGES=C -LANG=ja_JP.utf8 +export LANG=ja_JP.utf8 From 7a173ff7118009a8e68ca193b2d09809244330df Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 8 Mar 2012 14:59:21 +0900 Subject: [PATCH 061/107] split x files into two files, background program prefs and others --- xinitrc | 6 +----- xprograms | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 5 deletions(-) create mode 100755 xprograms diff --git a/xinitrc b/xinitrc index b505e65..cd24894 100644 --- a/xinitrc +++ b/xinitrc @@ -12,10 +12,6 @@ type synclient >/dev/null 2>&1 && { synclient MinSpeed=0.2 } -test -f "$HOME/.fehbg" && -type feh >/dev/null 2>&1 && -sh "$HOME/.fehbg" - -#export LC_MESSAGES=C +unset LC_MESSAGES export LANG=ja_JP.utf8 diff --git a/xprograms b/xprograms new file mode 100755 index 0000000..8559952 --- /dev/null +++ b/xprograms @@ -0,0 +1,22 @@ +#!/bin/sh +# Programs run in background when starting x. +# These programs are basically for Openbox Window Manager. +# Japanese IM settings are not included in this list. + +test -f "$HOME/.fehbg" && +type feh >/dev/null 2>&1 && +sh "$HOME/.fehbg" + +tint2 & + +#dropboxd & # done by ~/.config/autostart/dropbox.desktop + +volumeicon & +#wicd-client --tray & # done by /etc/xdg/autostart/wicd-client.desktop +# Detection of insertion of an optical disk +if ! pgrep -lf "udisks-daemon: polling /dev/sr0"; then + udisks --poll-for-media /dev/sr0 +fi + +udisksvm >/dev/null & + From 5481fd19c029616008087437f6c5006789ced339 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 8 Mar 2012 21:45:17 +0900 Subject: [PATCH 062/107] fix bug of keyboard prefs --- xinitrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xinitrc b/xinitrc index cd24894..9796e14 100644 --- a/xinitrc +++ b/xinitrc @@ -1,8 +1,8 @@ +setxkbmap -model "acer_laptop" -layout "jp" -option "ctrl:nocaps" # this line must comes first xmodmap -e 'keycode 135 = Alt_R Meta_R' # menu key as alt xmodmap -e 'keycode 101 = Alt_R Meta_R' # hiragana key as alt #xmodmap -e 'remove Lock = Caps_Lock' #xmodmap -e 'add Control = Caps_Lock' -setxkbmap -model "acer_laptop" -layout "jp" -option "ctrl:nocaps" type synclient >/dev/null 2>&1 && { synclient VertEdgeScroll=0 From c1cb4f6ca54d2c863923c0cb416738615724975b Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 8 Mar 2012 21:45:42 +0900 Subject: [PATCH 063/107] fix url of js2-mode --- emacs.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs.el b/emacs.el index 32499c8..fb0cdd4 100644 --- a/emacs.el +++ b/emacs.el @@ -659,7 +659,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." )) (when (dllib-if-unfound "js2-mode" - "https://github.com/mooz/js2-mode/raw/master/js2-mode.el" + "https://raw.github.com/mooz/js2-mode/master/js2-mode.el" t) (autoload 'js2-mode "js2-mode" nil t) (add-to-list 'auto-mode-alist '("\\.js$" . js2-mode)) From c94e8214449a5e864f4780111501b9908112fb87 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 8 Mar 2012 21:51:52 +0900 Subject: [PATCH 064/107] fix git-command bug --- emacs.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/emacs.el b/emacs.el index fb0cdd4..0df29c7 100644 --- a/emacs.el +++ b/emacs.el @@ -1621,8 +1621,9 @@ when SEC is nil, stop auto save if enabled." cmd) bf) (with-current-buffer bf - (ansi-color-apply-on-region (point-min) - (point-max))))) + (and (require 'ansi-color nil t) + (ansi-color-apply-on-region (point-min) + (point-max)))))) (define-key ctl-x-map "g" 'my-git-shell-command) (defun my-kill-buffers () From d5c97807e2fd474ef32b9b759fae52258e25c2d3 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 9 Mar 2012 00:53:43 +0900 Subject: [PATCH 065/107] update auto-install-plugins urls --- _keysnail.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/_keysnail.js b/_keysnail.js index 1078bf1..f397139 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -181,14 +181,15 @@ ext.add('my-setpref', function(){ ext.add('auto-install-plugins', function(ev, arg){ var urls = [ - 'https://github.com/mooz/keysnail/raw/master/plugins/yet-another-twitter-client-keysnail.ks.js', - 'https://github.com/mooz/keysnail/raw/master/plugins/site-local-keymap.ks.js', - 'https://github.com/azu/KeySnail-Plugins/raw/master/JSReference/js-referrence.ks.js', + 'https://raw.github.com/mooz/keysnail/master/plugins/yet-another-twitter-client-keysnail.ks.js', + 'https://raw.github.com/mooz/keysnail/master/plugins/site-local-keymap.ks.js', + 'https://raw.github.com/azu/KeySnail-Plugins/master/JSReference/js-referrence.ks.js', 'https://raw.github.com/gongo/keysnail_plugin/master/linksnail.ks.js', - 'https://github.com/tkosaka/keysnail-plugin/raw/master/nicontroller.ks.js', + 'https://raw.github.com/tkosaka/keysnail-plugin/master/nicontroller.ks.js', 'https://raw.github.com/10sr/keysnail-plugin/master/shiitake.ks.js', 'https://raw.github.com/10sr/keysnail-plugin/master/dig-url.ks.js', 'https://raw.github.com/10sr/keysnail-plugin/master/instapaper.ks.js', + 'https://raw.github.com/gist/1976942/firefox-addon-manager.ks.js' ]; function inst(a){ From 381771060b7985fb1d521ab629a741561498e96f Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 9 Mar 2012 00:58:41 +0900 Subject: [PATCH 066/107] update git-command --- emacs.el | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/emacs.el b/emacs.el index 0df29c7..3631fee 100644 --- a/emacs.el +++ b/emacs.el @@ -336,6 +336,8 @@ (setq revert-without-query '(".+")) ;; カーソルの場所を保存する +(setq save-place-file (concat user-emacs-directory + "places")) (when (require 'saveplace nil t) (setq-default save-place t)) @@ -711,11 +713,6 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." 'newframe 'pushy)) -;; (when (and (executable-find "git") -;; (require 'sgit-mode nil t)) -;; (add-hook 'find-file-hook -;; 'sgit-load)) - (require 'session nil t) (when (require 'gtkbm nil t) @@ -1352,10 +1349,6 @@ 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) -;; "" -;; ) - (defun eshell/o (&optional file) (my-x-open (or file "."))) @@ -1608,10 +1601,11 @@ when SEC is nil, stop auto save if enabled." "History list for git command.") (defun my-git-shell-command (cmd) "" - (interactive (list (read-shell-command "git: " + (interactive (list (read-shell-command (format "[%s] $ git : " + (abbreviate-file-name default-directory)) nil 'git-command-history))) - (let ((bf (get-buffer-create "*Git Output*")) + (let ((dir default-directory) (bf (get-buffer-create "*Git Output*")) ;; (process-environment `(,@process-environment)) ;; (comint-preoutput-filter-functions '(ansi-color-apply . nil)) ;; (comint-output-filter-functions (cons 'ansi-color-process-output @@ -1621,6 +1615,7 @@ when SEC is nil, stop auto save if enabled." cmd) bf) (with-current-buffer bf + (cd dir) (and (require 'ansi-color nil t) (ansi-color-apply-on-region (point-min) (point-max)))))) From 4e5a98df6c4cc19a90f61475e90e2ac987c04dea Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 9 Mar 2012 03:37:30 +0900 Subject: [PATCH 067/107] add pacman and yaourt prefs --- bashrc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/bashrc b/bashrc index 537426b..f4e4a38 100755 --- a/bashrc +++ b/bashrc @@ -67,9 +67,6 @@ alias ls="ls -hCFG $(test "$TERM" == dumb || echo --color=auto\ )--time-style=lo alias vl=/usr/share/vim/vimcurrent/macros/less.sh alias em="emacs -nw" # alias apt-get="sudo apt-get" -alias aptin="apt-get install" -alias aptsearch="apt-cache search" -alias aptshow="apt-cache show" alias ut="ssh t110414@un001.ecc.u-tokyo.ac.jp" alias rand="echo \$RANDOM" alias xunp="file-roller -h" @@ -86,6 +83,14 @@ alias sudo="sudo " # use aliases through sudo alias e3=e3em alias mytime="date +%Y%m%d-%H%M%S" alias sh="ENV=$HOME/.shrc PS1=\$\ sh" + +alias aptin="apt-get install" +alias aptsearch="apt-cache search" +alias aptshow="apt-cache show" + +alias yt=yaourt +export PACMAN=pacman-color + if isdarwin then alias upgrade="port selfupdate && port sync && port upgrade installed" From 5de6736e03d5260f47ca5d1b6ce9279172982169 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 9 Mar 2012 03:37:51 +0900 Subject: [PATCH 068/107] small change --- _keysnail.js | 1 + 1 file changed, 1 insertion(+) diff --git a/_keysnail.js b/_keysnail.js index f397139..94b87b0 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -177,6 +177,7 @@ ext.add('my-setpref', function(){ "keyword.URL":"http://www.bing.com/search?q=", } ); + display.showPopup("Keysnail", "My prefs done."); }, 'my setpref'); ext.add('auto-install-plugins', function(ev, arg){ From 4c6cfd4c2c724e2542acab6464785485dc7b5cf9 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 9 Mar 2012 03:38:42 +0900 Subject: [PATCH 069/107] add lang setting to profile --- bashrc | 1 - profile | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/bashrc b/bashrc index f4e4a38..13317e5 100755 --- a/bashrc +++ b/bashrc @@ -54,7 +54,6 @@ fi export VISUAL="$EDITOR" export LESS="-iRMX" export LC_MESSAGES=C -# export LANG=ja_JP.UTF-8 # export CDPATH=".:~" # 使い方がよく分からない export GIT_PAGER="$PAGER" export GIT_EDITOR="$EDITOR" diff --git a/profile b/profile index 14cd0db..9819fba 100755 --- a/profile +++ b/profile @@ -2,6 +2,7 @@ env > $HOME/.env.txt # export PS1="\$ " +export LANG=ja_JP.UTF-8 export LC_TIME=C export TERMCAP="${TERMCAP}:vb=" export HOSTNAME From 90c10f979450f1820b89480a009415920e4cdcda Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 9 Mar 2012 16:50:36 +0900 Subject: [PATCH 070/107] add some user prefs --- _keysnail.js | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/_keysnail.js b/_keysnail.js index 94b87b0..8ff0b77 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -161,20 +161,37 @@ plugins.options["twitter_client.use_jmp"] = true; ext.add('my-setpref', function(){ util.setPrefs( { - "browser.tabs.loadDivertedInBackground": true, - "dom.disable_window_open_feature.location": false, - "dom.max_script_run_time": 30, "browser.bookmarks.max_backups":0, - "browser.urlbar.autocomplete.enabled":false, "browser.cache.memory.capacity":16384, - "browser.sessionhistory.max_total_viewers":8, "browser.download.manager.closeWhenDone":true, "browser.download.useDownloadDir":false, + "browser.fullscreen.autohide":false, + "browser.search.openintab":true, + "browser.sessionhistory.max_total_viewers":8, "browser.tabs.closeWindowWithLastTab":false, - "network.dns.disableIPv6":true, + "browser.tabs.loadDivertedInBackground": true, + "browser.urlbar.autocomplete.enabled":false, "browser.urlbar.trimURLs":false, - "browser.fullscreen.autohide":false, + "dom.disable_window_open_feature.location": false, + "dom.max_script_run_time": 30, "keyword.URL":"http://www.bing.com/search?q=", + "network.dns.disableIPv6":true, + "extensions.chaika.bbsmenu.open_new_tab":true, + "extensions.chaika.bbsmenu.open_single_click":false, + "extensions.chaika.board.open_new_tab":true, + "extensions.chaika.board.open_single_click":false, + "extensions.foxage2ch.openThreadInTab":true, + "extensions.saveimageinfolder.general-fileprefixvalue":"%yyyy%%MM%%dd%-%hh%%mm%%ss%_", + "extensions.saveimageinfolder.general-duplicatefilenamevalue":1, + "extensions.saveimageinfolder.usecache":true, + "extensions.tabutils.openTabNext":1, + "extensions.tabutils.styles.current":"{\"bold\":true,\"italic\":false,\"underline\":true,\"strikethrough\":false,\"color\":true,\"colorCode\":\"#EEEEEE\",\"bgColor\":true,\"bgColorCode\":\"#000000\",\"outline\":true,\"outlineColorCode\":\"#000000\"}", + "extensions.yass.edgetype":0, + "extensions.yass.selectedpreset":"red", + "font.default.x-western":"sans-serif", + "general.warnOnAboutConfig":false, + "refcontrol.actions":"@DEFAULT=@FORGE", + "scrapbook.tabs.open":true } ); display.showPopup("Keysnail", "My prefs done."); From a65183179d847b2d68fd85ca9ee378dfb7f16a15 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 9 Mar 2012 18:58:14 +0900 Subject: [PATCH 071/107] update user prefs --- _keysnail.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/_keysnail.js b/_keysnail.js index 8ff0b77..94c3245 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -168,21 +168,20 @@ ext.add('my-setpref', function(){ "browser.fullscreen.autohide":false, "browser.search.openintab":true, "browser.sessionhistory.max_total_viewers":8, + "browser.sessionstore.restore_on_demand":true, "browser.tabs.closeWindowWithLastTab":false, "browser.tabs.loadDivertedInBackground": true, "browser.urlbar.autocomplete.enabled":false, "browser.urlbar.trimURLs":false, "dom.disable_window_open_feature.location": false, "dom.max_script_run_time": 30, - "keyword.URL":"http://www.bing.com/search?q=", - "network.dns.disableIPv6":true, "extensions.chaika.bbsmenu.open_new_tab":true, "extensions.chaika.bbsmenu.open_single_click":false, "extensions.chaika.board.open_new_tab":true, "extensions.chaika.board.open_single_click":false, "extensions.foxage2ch.openThreadInTab":true, - "extensions.saveimageinfolder.general-fileprefixvalue":"%yyyy%%MM%%dd%-%hh%%mm%%ss%_", "extensions.saveimageinfolder.general-duplicatefilenamevalue":1, + "extensions.saveimageinfolder.general-fileprefixvalue":"%yyyy%%MM%%dd%-%hh%%mm%%ss%_", "extensions.saveimageinfolder.usecache":true, "extensions.tabutils.openTabNext":1, "extensions.tabutils.styles.current":"{\"bold\":true,\"italic\":false,\"underline\":true,\"strikethrough\":false,\"color\":true,\"colorCode\":\"#EEEEEE\",\"bgColor\":true,\"bgColorCode\":\"#000000\",\"outline\":true,\"outlineColorCode\":\"#000000\"}", @@ -190,6 +189,8 @@ ext.add('my-setpref', function(){ "extensions.yass.selectedpreset":"red", "font.default.x-western":"sans-serif", "general.warnOnAboutConfig":false, + "keyword.URL":"http://www.bing.com/search?q=", + "network.dns.disableIPv6":true, "refcontrol.actions":"@DEFAULT=@FORGE", "scrapbook.tabs.open":true } From 7e049ab0e844e267d2f5d4cff06f79d371bde652 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 9 Mar 2012 18:58:26 +0900 Subject: [PATCH 072/107] add alias halt and reboot --- bashrc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bashrc b/bashrc index 13317e5..9d8c52f 100755 --- a/bashrc +++ b/bashrc @@ -82,6 +82,8 @@ alias sudo="sudo " # use aliases through sudo alias e3=e3em alias mytime="date +%Y%m%d-%H%M%S" alias sh="ENV=$HOME/.shrc PS1=\$\ sh" +alias halt="sudo halt" +alias reboot="sudo reboot" alias aptin="apt-get install" alias aptsearch="apt-cache search" From 61631c9d3699e6c52bae4fb3740b7ee3c2ddc825 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 10 Mar 2012 13:58:12 +0900 Subject: [PATCH 073/107] update git-command --- emacs.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/emacs.el b/emacs.el index 3631fee..5244b96 100644 --- a/emacs.el +++ b/emacs.el @@ -1605,12 +1605,14 @@ when SEC is nil, stop auto save if enabled." (abbreviate-file-name default-directory)) nil 'git-command-history))) - (let ((dir default-directory) (bf (get-buffer-create "*Git Output*")) + (let ((dir default-directory) + (bf (get-buffer-create "*Git Output*")) ;; (process-environment `(,@process-environment)) ;; (comint-preoutput-filter-functions '(ansi-color-apply . nil)) ;; (comint-output-filter-functions (cons 'ansi-color-process-output ;; comint-output-filter-functions)) ) + (delete-windows-on bf t) (shell-command (concat "git " cmd) bf) From a2895dad6c3b1a5499a769b7d38c105d72e2aa03 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 10 Mar 2012 13:58:29 +0900 Subject: [PATCH 074/107] update prefs --- _keysnail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_keysnail.js b/_keysnail.js index 94c3245..d55d783 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -184,7 +184,7 @@ ext.add('my-setpref', function(){ "extensions.saveimageinfolder.general-fileprefixvalue":"%yyyy%%MM%%dd%-%hh%%mm%%ss%_", "extensions.saveimageinfolder.usecache":true, "extensions.tabutils.openTabNext":1, - "extensions.tabutils.styles.current":"{\"bold\":true,\"italic\":false,\"underline\":true,\"strikethrough\":false,\"color\":true,\"colorCode\":\"#EEEEEE\",\"bgColor\":true,\"bgColorCode\":\"#000000\",\"outline\":true,\"outlineColorCode\":\"#000000\"}", + "extensions.tabutils.styles.current":"{\"bold\":true,\"italic\":false,\"underline\":true,\"strikethrough\":false,\"color\":true,\"colorCode\":\"#EEEEEE\",\"bgColor\":true,\"bgColorCode\":\"#000000\",\"outline\":false,\"outlineColorCode\":\"#000000\"}", "extensions.yass.edgetype":0, "extensions.yass.selectedpreset":"red", "font.default.x-western":"sans-serif", From 48de0226ef2564fcedb6892eed5b3015eef68127 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 10 Mar 2012 15:45:40 +0900 Subject: [PATCH 075/107] cleanse code --- bashrc | 143 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 74 insertions(+), 69 deletions(-) diff --git a/bashrc b/bashrc index 9d8c52f..5ceb928 100755 --- a/bashrc +++ b/bashrc @@ -1,10 +1,14 @@ #!/bin/bash -# test -r /etc/bashrc && . /etc/bashrc - ########################## # system type +alias ismsys=false +alias iscygwin=false +alias isdarwin=false +alias iswindows="iscygwin || ismsys" +alias islinux="! iswindows && ! isdarwin" # i havent used unix yet + if uname | grep -E "^MINGW32" >/dev/null 2>&1 then alias ismsys=true @@ -19,8 +23,6 @@ else alias iscygwin=false fi -alias iswindows="iscygwin || ismsys" - if uname | grep -E 'Darwin' >/dev/null 2>&1 then alias isdarwin=true @@ -45,7 +47,7 @@ else export PAGER="less" fi -if type vim >/dev/null 2>&1 +if null type vim then export EDITOR=vim else @@ -54,10 +56,39 @@ fi export VISUAL="$EDITOR" export LESS="-iRMX" export LC_MESSAGES=C -# export CDPATH=".:~" # 使い方がよく分からない +export CDPATH=".:~" export GIT_PAGER="$PAGER" export GIT_EDITOR="$EDITOR" +null type stty && { + stty stop undef # unbind C-s to stop displaying output + stty erase '^h' +} + +if iswindows; then + # export TMP=/tmp + # export TEMP=/tmp + # 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 USER=$USERNAME +fi + +####################### + +uname -a +if test -f /etc/issue.net +then + cat /etc/issue.net +else + if test -f /etc/issue + then + cat /etc/issue + fi +fi + +################################### +# some aliases and functions + alias ls="ls -hCFG $(test "$TERM" == dumb || echo --color=auto\ )--time-style=long-iso" # alias ll="ls -l" # alias la="ls -A" @@ -66,12 +97,11 @@ alias ls="ls -hCFG $(test "$TERM" == dumb || echo --color=auto\ )--time-style=lo alias vl=/usr/share/vim/vimcurrent/macros/less.sh alias em="emacs -nw" # alias apt-get="sudo apt-get" -alias ut="ssh t110414@un001.ecc.u-tokyo.ac.jp" +alias ut="ssh 6365454829@un001.ecc.u-tokyo.ac.jp" alias rand="echo \$RANDOM" alias xunp="file-roller -h" alias pacome="sudo \paco -D" alias psall="ps auxww" -alias g=git alias q=exit alias p="$PAGER" alias c=cat @@ -84,6 +114,7 @@ alias mytime="date +%Y%m%d-%H%M%S" alias sh="ENV=$HOME/.shrc PS1=\$\ sh" alias halt="sudo halt" alias reboot="sudo reboot" +# type trash >/dev/null 2>&1 && alias rm=trash alias aptin="apt-get install" alias aptsearch="apt-cache search" @@ -92,15 +123,36 @@ alias aptshow="apt-cache show" alias yt=yaourt export PACMAN=pacman-color -if isdarwin +alias ubuntu-upgrade="sudo apt-get autoremove --yes && sudo apt-get update --yes && sudo apt-get upgrade --yes" +alias arch-upgrade="yaourt -Syu" +alias port-upgrade="port selfupdate && port sync && port upgrade installed" + +if iscygwin; then + ! null type windate && alias windate="/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%'" + alias cygsu="cygstart /cygwinsetup.exe" + alias emacs="CYGWIN=tty emacs -nw" + alias ls="ls -CFG $(test "$TERM" == dumb || echo --color=auto)" +fi + +alias g=git +if null type _git # enable programmable completion for g then - alias upgrade="port selfupdate && port sync && port upgrade installed" -else - alias upgrade="sudo apt-get autoremove --yes && sudo apt-get update --yes && sudo apt-get upgrade --yes" + complete -o bashdefault -o default -o nospace -F _git g 2>/dev/null \ + || complete -o default -o nospace -F _git g fi -iswindows && ! type windate >/dev/null 2>&1 && alias windate="/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%'" -# alias diff="$(type colordiff >/dev/null 2>&1 && test $TERM != dumb && echo color)diff -u" -# type trash >/dev/null 2>&1 && alias rm=trash + +showinfo(){ + echo "Japanese letters are 表示可能" + + __try_exec diskinfo + + ! isdarwin && test -n "${DESKTOP_SESSION}" && type xrandr >/dev/null 2>&1 && { + xrandr | grep --color=never ^Screen + } + + iswindows || __try_exec finger $USER + LANG=C __try_exec id +} export __MYGITBAREREP="${HOME}/dbx/.git-bare" git-make-local-rep(){ @@ -132,7 +184,7 @@ bak(){ done } di(){ - if type colordiff >/dev/null 2>&1 && test $TERM != dumb + if null type colordiff && test $TERM != dumb then local diffcmd=colordiff else @@ -141,10 +193,10 @@ di(){ ${diffcmd} -u "$@" | ${PAGER} } throw-away(){ - mkdir -p ~/bu/tb + mkdir -p ~/.backup/tb for file in "$@" do - mv $file ~/bu/tb + mv $file ~/.backup/tb done } mkcd(){ @@ -225,12 +277,6 @@ _mygitconfig(){ fi } -if type _git >/dev/null 2>&1 # enable programmable completion of g -then - complete -o bashdefault -o default -o nospace -F _git g 2>/dev/null \ - || complete -o default -o nospace -F _git g -fi - __my_parse_svn_branch() { local LANG=C local svn_url=$(svn info 2>/dev/null | sed -ne 's#^URL: ##p') @@ -278,17 +324,15 @@ __my_prompt_function(){ # used by PS1 local date=$(LANG=C __try_exec date +"%a, %d %b %Y %T %z") fi local svn=$(type svn >/dev/null 2>&1 && __try_exec __my_svn_ps1 [SVN:%s]) - jobs printf " [${c1}${pwd}${cdef}<${c3}${oldpwd}${cdef}]${git}${svn}\n" + jobs printf "${c2}${USER}@${HOSTNAME}${cdef} ${date} ${BASH} ${BASH_VERSION}\n" printf "shlv:${SHLVL} jobs:${jobnum} last:${lastreturn} " } -# type date >/dev/null 2>&1 || alias date=":" # "cmd /c echo %time%" - -if [ "${EMACS}" = "t" ]; then # emacs shell用 +if [ "${EMACS}" = "t" ]; then # for emacs shell true export PS1="\u@\H \d \t \w\nemacs shell\$ " -elif echo "$EMACS" | grep term >/dev/null 2>&1; then # emacs term用 +elif echo "$EMACS" | grep term >/dev/null 2>&1; then # for emacs term echo "emacs term" fi @@ -337,15 +381,8 @@ _echocolors(){ } # http://myminios.googlecode.com/svn-history/r10/trunk/colortable16.sh -null type stty && { - stty stop undef # unbind C-s to stop displaying output - stty erase '^h' -} - -######################### -# for windose - winln(){ + # for windose make link (actually junction) if test $# -eq 0 then { @@ -359,35 +396,3 @@ winln(){ fi } -if iscygwin; then - alias cygsu="cygstart /cygwinsetup.exe" - alias emacs="CYGWIN=tty emacs -nw" - echo "cygwin bash" -fi - -if iswindows; then - # export TMP=/tmp - # export TEMP=/tmp - # 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 \$ " - alias ls="ls -CFG $(test "$TERM" == dumb || echo --color=auto)" - export USER=$USERNAME -fi - -####################### - -uname -a -test -f /etc/issue.net && cat /etc/issue.net - -showinfo(){ - echo "Japanese letters are 表示可能" - - __try_exec diskinfo - - ! isdarwin && test -n "${DESKTOP_SESSION}" && type xrandr >/dev/null 2>&1 && { - xrandr | grep --color=never ^Screen - } - - iswindows || __try_exec finger $USER - LANG=C __try_exec id -} From f33fd535a5374b1899e7787cb9cae0c1275d8020 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 10 Mar 2012 15:46:04 +0900 Subject: [PATCH 076/107] modify tabutil style --- _keysnail.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_keysnail.js b/_keysnail.js index d55d783..cda0ff2 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -184,7 +184,7 @@ ext.add('my-setpref', function(){ "extensions.saveimageinfolder.general-fileprefixvalue":"%yyyy%%MM%%dd%-%hh%%mm%%ss%_", "extensions.saveimageinfolder.usecache":true, "extensions.tabutils.openTabNext":1, - "extensions.tabutils.styles.current":"{\"bold\":true,\"italic\":false,\"underline\":true,\"strikethrough\":false,\"color\":true,\"colorCode\":\"#EEEEEE\",\"bgColor\":true,\"bgColorCode\":\"#000000\",\"outline\":false,\"outlineColorCode\":\"#000000\"}", + "extensions.tabutils.styles.current":"{\"bold\":false,\"italic\":false,\"underline\":true,\"strikethrough\":false,\"color\":true,\"colorCode\":\"#EEEEEE\",\"bgColor\":true,\"bgColorCode\":\"#000000\",\"outline\":false,\"outlineColorCode\":\"#000000\"}", "extensions.yass.edgetype":0, "extensions.yass.selectedpreset":"red", "font.default.x-western":"sans-serif", From 77f823e7d5744ade53e4ba65f19a3c11c33afcd8 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 10 Mar 2012 15:58:54 +0900 Subject: [PATCH 077/107] fix --- bashrc | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/bashrc b/bashrc index 5ceb928..4c863ea 100755 --- a/bashrc +++ b/bashrc @@ -76,14 +76,16 @@ fi ####################### uname -a -if test -f /etc/issue.net + +if [ "${EMACS}" = "t" ]; then # for emacs shell + true export PS1="\u@\H \d \t \w\nemacs shell\$ " +elif echo "$EMACS" | grep term >/dev/null 2>&1; then # for emacs term + echo "Emacs Term" +fi + +if test -f /etc/issue then - cat /etc/issue.net -else - if test -f /etc/issue - then - cat /etc/issue - fi + cat /etc/issue fi ################################### @@ -128,7 +130,7 @@ alias arch-upgrade="yaourt -Syu" alias port-upgrade="port selfupdate && port sync && port upgrade installed" if iscygwin; then - ! null type windate && alias windate="/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%'" + null type windate || alias windate="/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%'" alias cygsu="cygstart /cygwinsetup.exe" alias emacs="CYGWIN=tty emacs -nw" alias ls="ls -CFG $(test "$TERM" == dumb || echo --color=auto)" @@ -330,12 +332,6 @@ __my_prompt_function(){ # used by PS1 printf "shlv:${SHLVL} jobs:${jobnum} last:${lastreturn} " } -if [ "${EMACS}" = "t" ]; then # for emacs shell - true export PS1="\u@\H \d \t \w\nemacs shell\$ " -elif echo "$EMACS" | grep term >/dev/null 2>&1; then # for emacs term - echo "emacs term" -fi - #Change ANSI Colors _chengecolors(){ echo -e \ From 331e67ff2e2b75276d57b08672df1d2ec1a4c5be Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sat, 10 Mar 2012 16:31:23 +0900 Subject: [PATCH 078/107] refactoring system type command --- bashrc | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/bashrc b/bashrc index 4c863ea..615bd2f 100755 --- a/bashrc +++ b/bashrc @@ -9,26 +9,11 @@ alias isdarwin=false alias iswindows="iscygwin || ismsys" alias islinux="! iswindows && ! isdarwin" # i havent used unix yet -if uname | grep -E "^MINGW32" >/dev/null 2>&1 -then - alias ismsys=true -else - alias ismsys=false -fi - -if uname | grep -E "^CYGWIN" >/dev/null 2>&1 -then - alias iscygwin=true -else - alias iscygwin=false -fi - -if uname | grep -E 'Darwin' >/dev/null 2>&1 -then - alias isdarwin=true -else - alias isdarwin=false -fi +case `uname` in + (MINGW32*) alias ismsys=true ;; + (CYGWIN*) alias iscygwin=true ;; + (Darwin*) alias isdarwin=true ;; +esac ########################################## null(){ @@ -327,7 +312,6 @@ __my_prompt_function(){ # used by PS1 fi local svn=$(type svn >/dev/null 2>&1 && __try_exec __my_svn_ps1 [SVN:%s]) printf " [${c1}${pwd}${cdef}<${c3}${oldpwd}${cdef}]${git}${svn}\n" - jobs printf "${c2}${USER}@${HOSTNAME}${cdef} ${date} ${BASH} ${BASH_VERSION}\n" printf "shlv:${SHLVL} jobs:${jobnum} last:${lastreturn} " } From 6ee19f82f82076ee8271a357375cc0b3d08ff062 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 11 Mar 2012 00:06:03 +0900 Subject: [PATCH 079/107] add battery-status, runs very very slow --- bashrc | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/bashrc b/bashrc index 615bd2f..f8e86e0 100755 --- a/bashrc +++ b/bashrc @@ -376,3 +376,14 @@ winln(){ fi } +battery-status(){ + local dir=/sys/class/power_supply/BAT0 + st=$(cat $dir/status) + full=$(cat $dir/charge_full) + now=$(cat $dir/charge_now) + # . $dir/uevent + # rate=$(expr $POWER_SUPPLY_CHARGE_NOW \* 100 / $POWER_SUPPLY_CHARGE_FULL) + rate=$(expr $now \* 100 / $full) + echo ${st}:${rate}\% +} + From f2d32d2a164d9fe8b850aa26405a251757a518dd Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 11 Mar 2012 00:59:51 +0900 Subject: [PATCH 080/107] modify battery function --- bashrc | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/bashrc b/bashrc index f8e86e0..3105387 100755 --- a/bashrc +++ b/bashrc @@ -311,7 +311,8 @@ __my_prompt_function(){ # used by PS1 local date=$(LANG=C __try_exec date +"%a, %d %b %Y %T %z") fi local svn=$(type svn >/dev/null 2>&1 && __try_exec __my_svn_ps1 [SVN:%s]) - printf " [${c1}${pwd}${cdef}<${c3}${oldpwd}${cdef}]${git}${svn}\n" + # local battery=$(battery-status "[%s]" | sed -e 's"%"%%"g') # very slow + printf " [${c1}${pwd}${cdef}<${c3}${oldpwd}${cdef}]${git}${svn}${battery}\n" printf "${c2}${USER}@${HOSTNAME}${cdef} ${date} ${BASH} ${BASH_VERSION}\n" printf "shlv:${SHLVL} jobs:${jobnum} last:${lastreturn} " } @@ -378,12 +379,21 @@ winln(){ battery-status(){ local dir=/sys/class/power_supply/BAT0 - st=$(cat $dir/status) - full=$(cat $dir/charge_full) - now=$(cat $dir/charge_now) - # . $dir/uevent - # rate=$(expr $POWER_SUPPLY_CHARGE_NOW \* 100 / $POWER_SUPPLY_CHARGE_FULL) - rate=$(expr $now \* 100 / $full) - echo ${st}:${rate}\% + if test -d $dir + then + local st=$(cat $dir/status) + local full=$(cat $dir/charge_full) + local now=$(cat $dir/charge_now) + local rate=$(expr $now \* 100 / $full) + printf $1 "${st}:${rate}%" + fi +} +alias bat='battery-status %s\\n' + +battery-status2(){ + local dir=/sys/class/power_supply/BAT0 + . $dir/uevent + local rate=$(expr $POWER_SUPPLY_CHARGE_NOW \* 100 / $POWER_SUPPLY_CHARGE_FULL) + echo ${POWER_SUPPLY_STATUS}:${rate}% } From a69a8b2ffad2c4686c8d488882771d1b3c77c05f Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 11 Mar 2012 02:11:49 +0900 Subject: [PATCH 081/107] change to use ~/.batterystatus --- bashrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bashrc b/bashrc index 3105387..4ac39fc 100755 --- a/bashrc +++ b/bashrc @@ -302,7 +302,6 @@ __my_prompt_function(){ # used by PS1 local git= fi local date=$(/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%') - : else local pwd=$(echo "${PWD}/" | sed -e "s#${HOME}#~#") local oldpwd=$(echo "${OLDPWD}/" | sed -e "s#${HOME}#~#") @@ -311,7 +310,8 @@ __my_prompt_function(){ # used by PS1 local date=$(LANG=C __try_exec date +"%a, %d %b %Y %T %z") fi local svn=$(type svn >/dev/null 2>&1 && __try_exec __my_svn_ps1 [SVN:%s]) - # local battery=$(battery-status "[%s]" | sed -e 's"%"%%"g') # very slow + test -f ~/.batterystatus && local battery="[Battery:$(cat ~/.batterystatus | sed -e 's`%`%%`g')]" + # local battery=$(battery-state [%s] | sed -e 's`%`%%`g') # very slow printf " [${c1}${pwd}${cdef}<${c3}${oldpwd}${cdef}]${git}${svn}${battery}\n" printf "${c2}${USER}@${HOSTNAME}${cdef} ${date} ${BASH} ${BASH_VERSION}\n" printf "shlv:${SHLVL} jobs:${jobnum} last:${lastreturn} " From 286b89366097e85961a3b3c1a790233e0f926f04 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 11 Mar 2012 03:09:43 +0900 Subject: [PATCH 082/107] add function ip-address --- bashrc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bashrc b/bashrc index 4ac39fc..cb28d21 100755 --- a/bashrc +++ b/bashrc @@ -311,8 +311,9 @@ __my_prompt_function(){ # used by PS1 fi local svn=$(type svn >/dev/null 2>&1 && __try_exec __my_svn_ps1 [SVN:%s]) test -f ~/.batterystatus && local battery="[Battery:$(cat ~/.batterystatus | sed -e 's`%`%%`g')]" + local ip=$(ip-address [Addr:%s]) # local battery=$(battery-state [%s] | sed -e 's`%`%%`g') # very slow - printf " [${c1}${pwd}${cdef}<${c3}${oldpwd}${cdef}]${git}${svn}${battery}\n" + printf " [${c1}${pwd}${cdef}<${c3}${oldpwd}${cdef}]${git}${svn}${battery}${ip}\n" printf "${c2}${USER}@${HOSTNAME}${cdef} ${date} ${BASH} ${BASH_VERSION}\n" printf "shlv:${SHLVL} jobs:${jobnum} last:${lastreturn} " } @@ -397,3 +398,7 @@ battery-status2(){ echo ${POWER_SUPPLY_STATUS}:${rate}% } +ip-address(){ + local ip=$(LANG=C ifconfig | grep "inet " | grep -v "127.0.0.1" | awk '{print $2}') + test -n $ip && printf $1 $ip +} From 0579015031bd5d2f94555600db43f1a2f507f1e6 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 11 Mar 2012 16:50:46 +0900 Subject: [PATCH 083/107] screen go blank after 30 min --- bashrc | 7 ++++--- xinitrc | 2 ++ xprograms | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bashrc b/bashrc index cb28d21..350f5e9 100755 --- a/bashrc +++ b/bashrc @@ -133,12 +133,13 @@ showinfo(){ __try_exec diskinfo - ! isdarwin && test -n "${DESKTOP_SESSION}" && type xrandr >/dev/null 2>&1 && { - xrandr | grep --color=never ^Screen + ! isdarwin && test -n "${DISPLAY}" && { + __try_exec xrandr | grep --color=never ^Screen } iswindows || __try_exec finger $USER LANG=C __try_exec id + __try_exec xset q } export __MYGITBAREREP="${HOME}/dbx/.git-bare" @@ -400,5 +401,5 @@ battery-status2(){ ip-address(){ local ip=$(LANG=C ifconfig | grep "inet " | grep -v "127.0.0.1" | awk '{print $2}') - test -n $ip && printf $1 $ip + test -n "$ip" && printf $1 $ip } diff --git a/xinitrc b/xinitrc index 9796e14..ec48f75 100644 --- a/xinitrc +++ b/xinitrc @@ -12,6 +12,8 @@ type synclient >/dev/null 2>&1 && { synclient MinSpeed=0.2 } +xset s 1800 # go blank after 30 min + unset LC_MESSAGES export LANG=ja_JP.utf8 diff --git a/xprograms b/xprograms index 8559952..454be90 100755 --- a/xprograms +++ b/xprograms @@ -12,11 +12,12 @@ tint2 & #dropboxd & # done by ~/.config/autostart/dropbox.desktop volumeicon & + #wicd-client --tray & # done by /etc/xdg/autostart/wicd-client.desktop + # Detection of insertion of an optical disk if ! pgrep -lf "udisks-daemon: polling /dev/sr0"; then udisks --poll-for-media /dev/sr0 fi - udisksvm >/dev/null & From dcfc9f8f534f144f597e8716aa7a8998cb54acf6 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 11 Mar 2012 17:19:30 +0900 Subject: [PATCH 084/107] terminal go blank when 3 min passes --- profile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/profile b/profile index 9819fba..86c953c 100755 --- a/profile +++ b/profile @@ -1,5 +1,4 @@ #!/bin/sh -env > $HOME/.env.txt # export PS1="\$ " export LANG=ja_JP.UTF-8 @@ -23,3 +22,7 @@ addtopath ${HOME}/bin test -f "${HOME}/.pythonrc" && export PYTHONSTARTUP="${HOME}/.pythonrc" export PYTHONPATH=~/.py +type setterm >/dev/null 2>&1 && setterm -blank 3 -powersave on # -powerdown 10 +# in my environment powerdown does not work + +env > $HOME/.env.txt From 2673f0e939a3fe4c6d40b5ee1dd15a5a08167fbf Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 11 Mar 2012 20:30:20 +0900 Subject: [PATCH 085/107] disable displaying svn status in PS1 --- bashrc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bashrc b/bashrc index 350f5e9..f95b3c8 100755 --- a/bashrc +++ b/bashrc @@ -273,8 +273,11 @@ __my_parse_svn_branch() { } __my_svn_ps1(){ - local svn_branch=$(__my_parse_svn_branch) - test -n "${svn_branch}" && printf "$1" "{$svn_branch}" + if svn status >/dev/null 2>&1 + then + local svn_branch=$(__my_parse_svn_branch) + test -n "${svn_branch}" && printf "$1" "{$svn_branch}" + fi } __my_prompt_function(){ # used by PS1 @@ -310,7 +313,7 @@ __my_prompt_function(){ # used by PS1 local git=$(__try_exec __git_ps1 [GIT:%s]) local date=$(LANG=C __try_exec date +"%a, %d %b %Y %T %z") fi - local svn=$(type svn >/dev/null 2>&1 && __try_exec __my_svn_ps1 [SVN:%s]) + # local svn=$(type svn >/dev/null 2>&1 && __try_exec __my_svn_ps1 [SVN:%s]) test -f ~/.batterystatus && local battery="[Battery:$(cat ~/.batterystatus | sed -e 's`%`%%`g')]" local ip=$(ip-address [Addr:%s]) # local battery=$(battery-state [%s] | sed -e 's`%`%%`g') # very slow From c5f8f7343d0e55be8c3c886c5ec2fd2b07638c57 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 12 Mar 2012 11:37:15 +0900 Subject: [PATCH 086/107] misc changes --- bashrc | 9 +++++---- profile | 9 ++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/bashrc b/bashrc index f95b3c8..721509d 100755 --- a/bashrc +++ b/bashrc @@ -68,10 +68,10 @@ elif echo "$EMACS" | grep term >/dev/null 2>&1; then # for emacs term echo "Emacs Term" fi -if test -f /etc/issue -then - cat /etc/issue -fi +# if test -f /etc/issue +# then +# cat /etc/issue +# fi ################################### # some aliases and functions @@ -108,6 +108,7 @@ alias aptsearch="apt-cache search" alias aptshow="apt-cache show" alias yt=yaourt +null type pacman-color && alias pacman=pacman-color export PACMAN=pacman-color alias ubuntu-upgrade="sudo apt-get autoremove --yes && sudo apt-get update --yes && sudo apt-get upgrade --yes" diff --git a/profile b/profile index 86c953c..e7c860a 100755 --- a/profile +++ b/profile @@ -1,7 +1,7 @@ #!/bin/sh # export PS1="\$ " -export LANG=ja_JP.UTF-8 +export LANG=C # ja_JP.UTF-8 export LC_TIME=C export TERMCAP="${TERMCAP}:vb=" export HOSTNAME @@ -9,6 +9,8 @@ export BROWSER=firefox export ENV=~/.shrc # export TMP=/tmp # export TEMP=/tmp +test -f "${HOME}/.pythonrc" && export PYTHONSTARTUP="${HOME}/.pythonrc" +export PYTHONPATH=~/.py addtopath(){ for p in "$@" @@ -19,10 +21,7 @@ addtopath(){ # export PATH="${PATH}:${HOME}/bin" addtopath ${HOME}/bin -test -f "${HOME}/.pythonrc" && export PYTHONSTARTUP="${HOME}/.pythonrc" -export PYTHONPATH=~/.py - -type setterm >/dev/null 2>&1 && setterm -blank 3 -powersave on # -powerdown 10 +type setterm >/dev/null 2>&1 && setterm -blank 30 -powersave on # -powerdown 10 # in my environment powerdown does not work env > $HOME/.env.txt From c07a646e9b5706404226d8f4b017c5d2da094dec Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 13 Mar 2012 00:16:59 +0900 Subject: [PATCH 087/107] add tty display in prompt --- bashrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bashrc b/bashrc index 721509d..4547478 100755 --- a/bashrc +++ b/bashrc @@ -317,9 +317,10 @@ __my_prompt_function(){ # used by PS1 # local svn=$(type svn >/dev/null 2>&1 && __try_exec __my_svn_ps1 [SVN:%s]) test -f ~/.batterystatus && local battery="[Battery:$(cat ~/.batterystatus | sed -e 's`%`%%`g')]" local ip=$(ip-address [Addr:%s]) + local tty=$(__try_exec tty | sed -e 's:/dev/::') # local battery=$(battery-state [%s] | sed -e 's`%`%%`g') # very slow printf " [${c1}${pwd}${cdef}<${c3}${oldpwd}${cdef}]${git}${svn}${battery}${ip}\n" - printf "${c2}${USER}@${HOSTNAME}${cdef} ${date} ${BASH} ${BASH_VERSION}\n" + printf "${c2}${USER}@${HOSTNAME}${cdef} ${tty} ${date} ${BASH} ${BASH_VERSION}\n" printf "shlv:${SHLVL} jobs:${jobnum} last:${lastreturn} " } From 22ee46031b64ef9244f5a8de76cf156ba88ab572 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 13 Mar 2012 01:22:22 +0900 Subject: [PATCH 088/107] add function x, modify document --- README.txt | 6 +++++- bashrc | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.txt b/README.txt index 5bca638..678cf35 100644 --- a/README.txt +++ b/README.txt @@ -8,5 +8,9 @@ ~/.xinitrc <= startx (~/.config/openbox/autostart also executed) | -`--~/.dotfiles/xinitrc +`--openbox-session + | + |--~/.dotfiles/xprofile + | + `--~/.dotfiles/xprograms diff --git a/bashrc b/bashrc index 4547478..d49b570 100755 --- a/bashrc +++ b/bashrc @@ -143,6 +143,14 @@ showinfo(){ __try_exec xset q } +x(){ + if [[ -z $DISPLAY ]] && ! [[ -e /tmp/.X11-unix/X0 ]] && (( EUID )); then + nohup startx >~/.xorg.log 2>&1 & + else + echo "X cant be started! Maybe another X is already started!" 1>&2 + fi +} + export __MYGITBAREREP="${HOME}/dbx/.git-bare" git-make-local-rep(){ test $# -eq 0 && { From e33a0f74d11eb89c4cf02106e82833344a3886e9 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 13 Mar 2012 01:26:58 +0900 Subject: [PATCH 089/107] fix some ENVs --- README.txt | 2 +- bashrc | 1 + profile | 3 +-- xinitrc | 1 + 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.txt b/README.txt index 678cf35..afbcd80 100644 --- a/README.txt +++ b/README.txt @@ -6,7 +6,7 @@ | `--~/.dotfiles/bashrc -~/.xinitrc <= startx (~/.config/openbox/autostart also executed) +~/.xinitrc <= startx | `--openbox-session | diff --git a/bashrc b/bashrc index d49b570..c4fe1cb 100755 --- a/bashrc +++ b/bashrc @@ -83,6 +83,7 @@ alias ls="ls -hCFG $(test "$TERM" == dumb || echo --color=auto\ )--time-style=lo # alias less="" alias vl=/usr/share/vim/vimcurrent/macros/less.sh alias em="emacs -nw" +alias pstree="LANG=C pstree" # alias apt-get="sudo apt-get" alias ut="ssh 6365454829@un001.ecc.u-tokyo.ac.jp" alias rand="echo \$RANDOM" diff --git a/profile b/profile index e7c860a..e49d88c 100755 --- a/profile +++ b/profile @@ -1,11 +1,10 @@ #!/bin/sh # export PS1="\$ " -export LANG=C # ja_JP.UTF-8 +# export LANG=ja_JP.UTF-8 export LC_TIME=C export TERMCAP="${TERMCAP}:vb=" export HOSTNAME -export BROWSER=firefox export ENV=~/.shrc # export TMP=/tmp # export TEMP=/tmp diff --git a/xinitrc b/xinitrc index ec48f75..ffede58 100644 --- a/xinitrc +++ b/xinitrc @@ -16,4 +16,5 @@ xset s 1800 # go blank after 30 min unset LC_MESSAGES export LANG=ja_JP.utf8 +export BROWSER=firefox From e7bdd6c128fd6f5008445a4f22f6da42d9868dd1 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 13 Mar 2012 16:24:54 +0900 Subject: [PATCH 090/107] use mstranslator --- _keysnail.js | 39 ++++++++++++++------------------------- bashrc | 2 +- 2 files changed, 15 insertions(+), 26 deletions(-) diff --git a/_keysnail.js b/_keysnail.js index cda0ff2..7588e92 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -208,7 +208,8 @@ ext.add('auto-install-plugins', function(ev, arg){ 'https://raw.github.com/10sr/keysnail-plugin/master/shiitake.ks.js', 'https://raw.github.com/10sr/keysnail-plugin/master/dig-url.ks.js', 'https://raw.github.com/10sr/keysnail-plugin/master/instapaper.ks.js', - 'https://raw.github.com/gist/1976942/firefox-addon-manager.ks.js' + 'https://raw.github.com/gist/1976942/firefox-addon-manager.ks.js', + 'https://raw.github.com/gist/1450594/mstranslator.ks.js' ]; function inst(a){ @@ -271,6 +272,7 @@ ext.add("close-and-next-tab", function (ev, arg) { ///////////////////////////////////// // google itranslate +// use mstranslator instead (function(){ let targetLang = "ja"; // target lang to translate into let alternativeLang = "en"; // if given word is in targetLang, use this instead as a target lang @@ -532,11 +534,11 @@ key.suspendKey = "Not defined"; // ================================= Hooks ================================= // -hook.addToHook('KeySnailInitialized', function () { +hook.setHook('KeySnailInitialized', function () { ext.exec("shiitake-enable-style"); }); -hook.addToHook('KeyBoardQuit', function (aEvent) { +hook.setHook('KeyBoardQuit', function (aEvent) { ext.exec("hide-sidebar"); let(elem = document.commandDispatcher.focusedElement) elem && elem.blur(); gBrowser.focus(); @@ -562,16 +564,6 @@ hook.setHook('Unload', function () { }); }); -// hook.addToHook('LocationChange', function (aNsURI) { -// if(window.content.document.body){ -// display.prettyPrint(window.content.document.title); -// }else{ -// window.addEventListener("load", function(){ -// disp = display; -// disp.prettyPrint(window.content.document.title); -// }, false); -// } -// }); // ============================= Key bindings ============================== // @@ -673,10 +665,6 @@ key.setViewKey('z', function (ev, arg) { ext.exec("keysnail-setting-menu", arg, ev); }, 'open keysnail setting menu', true); -key.setViewKey('T', function (ev, arg) { - ext.exec("google-itranslate", arg, ev); -}, 'google itranslate', true); - key.setViewKey('C-SPC', function (ev, arg) { MultipleTabService.toggleSelection(gBrowser.selectedTab); }, 'タブの選択をトグル'); @@ -744,7 +732,8 @@ key.setViewKey([[''], ['']], function (ev, arg) { }, 'ignore'); key.setViewKey(':', function (ev, arg) { - return !document.getElementById("keysnail-prompt").hidden && document.getElementById("keysnail-prompt-textbox").focus(); + return !document.getElementById("keysnail-prompt").hidden && + document.getElementById("keysnail-prompt-textbox").focus(); }, 'KeySnail のプロンプトへフォーカス', true); key.setViewKey('H', function (ev, arg) { @@ -767,14 +756,14 @@ key.setViewKey('C-', function (ev, arg) { ext.exec("list-tab-history", arg, ev); }, 'List tab history', true); +key.setViewKey('I', function (ev, arg) { + ext.exec("instapaper-post-page-with-comment", arg, ev); +}, 'post page and comment', true); + key.setEditKey('C-', function (ev) { command.walkInputElement(command.elementsRetrieverTextarea, true, true); }, '次のテキストエリアへフォーカス'); -key.setViewKey('I', function (ev, arg) { - ext.exec('instapaper-post-page-with-comment', arg, ev); -}, 'post page and comment', true); - -key.setViewKey('C-', function (ev, arg) { - ext.exec('list-tab-history', arg, ev); -}, 'List tab history', true); +key.setViewKey('T', function (ev, arg) { + ext.exec('mstranslator-open-prompt', arg, ev); +}, 'MSTranslator - Open prompt', true); diff --git a/bashrc b/bashrc index c4fe1cb..f250bbc 100755 --- a/bashrc +++ b/bashrc @@ -148,7 +148,7 @@ x(){ if [[ -z $DISPLAY ]] && ! [[ -e /tmp/.X11-unix/X0 ]] && (( EUID )); then nohup startx >~/.xorg.log 2>&1 & else - echo "X cant be started! Maybe another X is already started!" 1>&2 + echo "X cant be started! Maybe another X is already running!" 1>&2 fi } From e0b84e94fecb4a2f03ffdcc7a26b7a20e191c3dd Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 14 Mar 2012 02:56:58 +0900 Subject: [PATCH 091/107] add conky config file --- bashrc | 2 +- conkyrc | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ conkyrc.2 | 39 +++++++++++++++++++++++++++++++++++++ profile | 2 +- xprograms | 3 +++ 5 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 conkyrc create mode 100644 conkyrc.2 diff --git a/bashrc b/bashrc index f250bbc..5138167 100755 --- a/bashrc +++ b/bashrc @@ -146,7 +146,7 @@ showinfo(){ x(){ if [[ -z $DISPLAY ]] && ! [[ -e /tmp/.X11-unix/X0 ]] && (( EUID )); then - nohup startx >~/.xorg.log 2>&1 & + nohup startx >~/.backup/log/xorg.log 2>&1 & else echo "X cant be started! Maybe another X is already running!" 1>&2 fi diff --git a/conkyrc b/conkyrc new file mode 100644 index 0000000..9c7e812 --- /dev/null +++ b/conkyrc @@ -0,0 +1,58 @@ +# ~/.conkyrc +# +double_buffer yes +background no + +use_xft yes +xftfont DejaVu Sans Mono:size=10 +xftalpha 0.8 + +update_interval 1.0 + +total_run_times 0 + +own_window yes +own_window_type override +own_window_transparent yes +own_window_colour hotpink +own_window_hints undecorated,below,skip_taskbar,sticky,skip_pager + +minimum_size 200 +draw_shades no +draw_outline no +draw_borders no +stippled_borders 0 +border_width 1 +default_color green # slategrey +default_shade_color lightgrey +default_outline_color black +alignment top_right +gap_x 20 +gap_y 50 +no_buffers yes +uppercase no +format_human_readable yes + +TEXT +${color white}${alignr}Arch Linux +${color white}${hr} +${color}host ${color black}:${color white} ${nodename} +${color}os ${color black}:${color white} ${sysname} ${kernel} +${color}freq ${color black}:${color white} ${freq 1}Mhz | ${freq 2}Mhz +${color}upt ${color black}:${color white} ${uptime} +#${color}btry ${color black}:${color white} ${battery} +#${color}btime${color black}:${color white} ${battery_time} +${color white}${hr} +${color}cpu ${color black}:${color white} ${cpu cpu0}% ${cpubar cpu0} +${color}ram ${color black}:${color white} ${memperc}% ${membar} +${color white}${stippled_hr} +${color}root ${color black}:${color white} ${fs_free /} ${fs_bar /} +${color}/tmp ${color black}:${color white} ${fs_free /tmp} ${fs_bar /tmp} +${color white}${stippled_hr} +${color}addr ${color black}:${color white} ${addr} +${color}down ${color black}:${color white} ${downspeed}/s +${color #888888}${downspeedgraph ff0000 0000ff} +${color}up ${color black}:${color white} ${upspeed}/s +${color #888888}${upspeedgraph 0000ff ff0000} +${color white}${hr} +#${color white}${alignr}${execi 900 cal -1} diff --git a/conkyrc.2 b/conkyrc.2 new file mode 100644 index 0000000..679691b --- /dev/null +++ b/conkyrc.2 @@ -0,0 +1,39 @@ +# ~/.conkyrc +# +double_buffer yes +background no + +use_xft yes +xftfont DejaVu Sans Mono:size=10 +xftalpha 0.8 + +update_interval 1.0 + +total_run_times 0 + +own_window yes +own_window_type override +own_window_transparent yes +own_window_colour hotpink +own_window_hints undecorated,below,skip_taskbar,sticky,skip_pager + +minimum_size 200 +draw_shades no +draw_outline no +draw_borders no +stippled_borders 0 +border_width 1 +default_color green # slategrey +default_shade_color lightgrey +default_outline_color black +alignment bottom_left +gap_x 20 +gap_y 20 +no_buffers yes +uppercase no +format_human_readable yes + +TEXT + +${color yellow}/var/log/dmesg.log: +${color white}${tail /var/log/dmesg.log 15} diff --git a/profile b/profile index e49d88c..251e76d 100755 --- a/profile +++ b/profile @@ -23,4 +23,4 @@ addtopath ${HOME}/bin type setterm >/dev/null 2>&1 && setterm -blank 30 -powersave on # -powerdown 10 # in my environment powerdown does not work -env > $HOME/.env.txt +mkdir -p ~/.backup/log diff --git a/xprograms b/xprograms index 454be90..8dc6556 100755 --- a/xprograms +++ b/xprograms @@ -13,6 +13,9 @@ tint2 & volumeicon & +conky -c ~/.dotfiles/conkyrc >~/.backup/log/conky.log 2>&1 & +conky -c ~/.dotfiles/conkyrc.2 >~/.backup/log/conky.2.log 2>&1 & + #wicd-client --tray & # done by /etc/xdg/autostart/wicd-client.desktop # Detection of insertion of an optical disk From e0a391551c3b11b2d54c1968a13f00afc735140c Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 14 Mar 2012 15:33:04 +0900 Subject: [PATCH 092/107] update conkyrc --- conkyrc | 60 ++++++++++++++++++++++++++++++++----------------------- conkyrc.2 | 5 +++-- emacs.el | 2 ++ 3 files changed, 40 insertions(+), 27 deletions(-) diff --git a/conkyrc b/conkyrc index 9c7e812..6334786 100644 --- a/conkyrc +++ b/conkyrc @@ -23,36 +23,46 @@ draw_outline no draw_borders no stippled_borders 0 border_width 1 -default_color green # slategrey -default_shade_color lightgrey -default_outline_color black alignment top_right gap_x 20 gap_y 50 + +default_color green # slategrey +default_shade_color lightgrey +default_outline_color black +color0 white +color1 black +color2 green + no_buffers yes uppercase no format_human_readable yes TEXT -${color white}${alignr}Arch Linux -${color white}${hr} -${color}host ${color black}:${color white} ${nodename} -${color}os ${color black}:${color white} ${sysname} ${kernel} -${color}freq ${color black}:${color white} ${freq 1}Mhz | ${freq 2}Mhz -${color}upt ${color black}:${color white} ${uptime} -#${color}btry ${color black}:${color white} ${battery} -#${color}btime${color black}:${color white} ${battery_time} -${color white}${hr} -${color}cpu ${color black}:${color white} ${cpu cpu0}% ${cpubar cpu0} -${color}ram ${color black}:${color white} ${memperc}% ${membar} -${color white}${stippled_hr} -${color}root ${color black}:${color white} ${fs_free /} ${fs_bar /} -${color}/tmp ${color black}:${color white} ${fs_free /tmp} ${fs_bar /tmp} -${color white}${stippled_hr} -${color}addr ${color black}:${color white} ${addr} -${color}down ${color black}:${color white} ${downspeed}/s -${color #888888}${downspeedgraph ff0000 0000ff} -${color}up ${color black}:${color white} ${upspeed}/s -${color #888888}${upspeedgraph 0000ff ff0000} -${color white}${hr} -#${color white}${alignr}${execi 900 cal -1} +${color0}${alignr}${conky_build_arch} +${color0}${alignr}${execi 30000 whoami}@${nodename} +${color0}${hr} +#${color2}host ${color1}:${color0} ${nodename} +${color2}uptm ${color1}:${color0} ${uptime} +${color2}lgin ${color1}:${color0} ${uptime} +#${color2}os ${color1}:${color0} ${sysname} ${kernel} +${color0}${stippled_hr} +${color2}freq ${color1}:${color0} ${freq 1}Mhz | ${freq 2}Mhz +${color2}cpu ${color1}:${color0} ${cpu cpu0}% ${cpubar cpu0} +#${color2}btry ${color1}:${color0} ${battery} +#${color2}btime${color1}:${color0} ${battery_time} +${color0}${hr} +${color2}ram ${color1}:${color0} ${memperc}% ${membar} +${color2}swap ${color1}:${color0} None +${color0}${stippled_hr} +${color2}root ${color1}:${color0} ${fs_free /} ${fs_bar /} +${color2}/tmp ${color1}:${color0} ${fs_free /tmp} ${fs_bar /tmp} +${color0}${hr} +${color2}addr ${color1}:${color0} ${addr} +${color0}${stippled_hr} +${color2}down ${color1}:${color0} ${downspeed eth0}/s +${color #888888}${downspeedgraph eth0 ff0000 0000ff} +${color2}up ${color1}:${color0} ${upspeed eth0}/s +${color #888888}${upspeedgraph eth0 0000ff ff0000} +${color0}${hr} +#${color0}${alignr}${execi 900 cal -1} diff --git a/conkyrc.2 b/conkyrc.2 index 679691b..c0d4251 100644 --- a/conkyrc.2 +++ b/conkyrc.2 @@ -35,5 +35,6 @@ format_human_readable yes TEXT -${color yellow}/var/log/dmesg.log: -${color white}${tail /var/log/dmesg.log 15} +${color yellow}$$ tail -f /var/log/everything.log +${color white}${tail /var/log/everything.log 30} +${time %b %d %T} diff --git a/emacs.el b/emacs.el index 5244b96..85ceb86 100644 --- a/emacs.el +++ b/emacs.el @@ -769,6 +769,8 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." 'my-frame-buffer-add) (add-hook 'eshell-mode-hook 'my-frame-buffer-add) +(add-hook 'Man-mode-hook + 'my-frame-buffer-add) (add-hook 'kill-buffer-hook 'my-frame-buffer-remove) From 3510a3f30b13ddc1ebf11632cdcae6c600d40622 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 15 Mar 2012 11:43:30 +0900 Subject: [PATCH 093/107] small fix --- conkyrc.2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conkyrc.2 b/conkyrc.2 index c0d4251..f88b945 100644 --- a/conkyrc.2 +++ b/conkyrc.2 @@ -18,6 +18,7 @@ own_window_colour hotpink own_window_hints undecorated,below,skip_taskbar,sticky,skip_pager minimum_size 200 +#maximum_width 1000 draw_shades no draw_outline no draw_borders no @@ -36,5 +37,5 @@ format_human_readable yes TEXT ${color yellow}$$ tail -f /var/log/everything.log -${color white}${tail /var/log/everything.log 30} +${color white}${tail /var/log/everything.log 15} ${time %b %d %T} From b9c7c50811f04af177e8e7930cc08488e357cab6 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Thu, 15 Mar 2012 19:07:06 +0900 Subject: [PATCH 094/107] misc tweaks --- bashrc | 117 +++++++++++++++++++++++++++++++------------------------ emacs.el | 6 +-- 2 files changed, 68 insertions(+), 55 deletions(-) diff --git a/bashrc b/bashrc index 5138167..e08381d 100755 --- a/bashrc +++ b/bashrc @@ -5,14 +5,15 @@ alias ismsys=false alias iscygwin=false -alias isdarwin=false alias iswindows="iscygwin || ismsys" -alias islinux="! iswindows && ! isdarwin" # i havent used unix yet +alias isdarwin=false +alias islinux=false case `uname` in (MINGW32*) alias ismsys=true ;; (CYGWIN*) alias iscygwin=true ;; (Darwin*) alias isdarwin=true ;; + (Linux*) alias islinux=true ;; esac ########################################## @@ -25,14 +26,14 @@ __try_exec(){ export PS1="\$(__my_prompt_function)\$ " # PROMPT_COMMAND=prompt_function -if false # iswindows +if false iswindows then export PAGER='tr -d \\r | less' else export PAGER="less" fi -if null type vim +if false null type vim then export EDITOR=vim else @@ -76,7 +77,7 @@ fi ################################### # some aliases and functions -alias ls="ls -hCFG $(test "$TERM" == dumb || echo --color=auto\ )--time-style=long-iso" +alias ls="ls -hCF $(test "$TERM" == dumb || echo --color=auto\ )--time-style=long-iso" # alias ll="ls -l" # alias la="ls -A" # alias lla="ls -Al" @@ -109,8 +110,15 @@ alias aptsearch="apt-cache search" alias aptshow="apt-cache show" alias yt=yaourt -null type pacman-color && alias pacman=pacman-color -export PACMAN=pacman-color +null type pacman-color && { + alias pacman=pacman-color + export pacman_program=pacman-color # used by pacmatic + export PACMAN=pacman-color # used by yaourt +} +null type pacmatic && { + alias pacman=pacmatic + export PACMAN=pacmatic +} alias ubuntu-upgrade="sudo apt-get autoremove --yes && sudo apt-get update --yes && sudo apt-get upgrade --yes" alias arch-upgrade="yaourt -Syu" @@ -182,7 +190,7 @@ bak(){ done } di(){ - if null type colordiff && test $TERM != dumb + if type colordiff >/dev/null 2>&1 && test $TERM != dumb then local diffcmd=colordiff else @@ -240,6 +248,9 @@ o(){ elif isdarwin then open "$f" + elif type pcmanfm >/dev/null 2>&1 + then + pcmanfm "$f" else xdg-open "$f" fi @@ -290,49 +301,6 @@ __my_svn_ps1(){ fi } -__my_prompt_function(){ # used by PS1 - local lastreturn=$? - if test "${TERM}" == dumb - then - local c1= - local c2= - local c3= - local cdef= - else - local c1="\e[33m" - local c2="\e[36m" - local c3="\e[37m" - local cdef="\e[0m" - fi - if iswindows - then - local pwd=$PWD - local oldpwd=$OLDPWD - local jobnum= - if git branch >/dev/null 2>&1 - then - local git="[GIT]" - else - local git= - fi - local date=$(/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%') - else - local pwd=$(echo "${PWD}/" | sed -e "s#${HOME}#~#") - local oldpwd=$(echo "${OLDPWD}/" | sed -e "s#${HOME}#~#") - local jobnum=$(jobs | wc -l) - local git=$(__try_exec __git_ps1 [GIT:%s]) - local date=$(LANG=C __try_exec date +"%a, %d %b %Y %T %z") - fi - # local svn=$(type svn >/dev/null 2>&1 && __try_exec __my_svn_ps1 [SVN:%s]) - test -f ~/.batterystatus && local battery="[Battery:$(cat ~/.batterystatus | sed -e 's`%`%%`g')]" - local ip=$(ip-address [Addr:%s]) - local tty=$(__try_exec tty | sed -e 's:/dev/::') - # local battery=$(battery-state [%s] | sed -e 's`%`%%`g') # very slow - printf " [${c1}${pwd}${cdef}<${c3}${oldpwd}${cdef}]${git}${svn}${battery}${ip}\n" - printf "${c2}${USER}@${HOSTNAME}${cdef} ${tty} ${date} ${BASH} ${BASH_VERSION}\n" - printf "shlv:${SHLVL} jobs:${jobnum} last:${lastreturn} " -} - #Change ANSI Colors _chengecolors(){ echo -e \ @@ -417,3 +385,50 @@ ip-address(){ local ip=$(LANG=C ifconfig | grep "inet " | grep -v "127.0.0.1" | awk '{print $2}') test -n "$ip" && printf $1 $ip } + +__my_prompt_function(){ # used by PS1 + local lastreturn=$? + if test "${TERM}" == dumb + then + local c1= + local c2= + local c3= + local cdef= + else + local c1="\e[33m" + local c2="\e[36m" + local c3="\e[37m" + local cdef="\e[0m" + fi + if iswindows + then + local pwd=$PWD + local oldpwd=$OLDPWD + local jobnum= + if git branch >/dev/null 2>&1 + then + local git="[GIT]" + else + local git= + fi + local date=$(/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%') + else + local pwd=$(echo "${PWD}/" | sed -e "s#${HOME}#~#") + local oldpwd=$(echo "${OLDPWD}/" | sed -e "s#${HOME}#~#") + local jobnum=$(jobs | wc -l) + local git=$(__try_exec __git_ps1 [GIT:%s]) + local date=$(LANG=C __try_exec date +"%a, %d %b %Y %T %z") + fi + # local svn=$(type svn >/dev/null 2>&1 && __try_exec __my_svn_ps1 [SVN:%s]) + if test -z "$DISPLAY" + then + local ip=$(ip-address [Addr:%s]) + test -f ~/.batterystatus && local battery="[Battery:$(cat ~/.batterystatus | sed -e 's`%`%%`g')]" + fi + local tty=$(__try_exec tty | sed -e 's:/dev/::') + # local battery=$(battery-state [%s] | sed -e 's`%`%%`g') # very slow + printf " [${c1}${pwd}${cdef}<${c3}${oldpwd}${cdef}]${git}${svn}${battery}${ip}\n" + printf "${c2}${USER}@${HOSTNAME}${cdef} ${tty} ${date} ${BASH} ${BASH_VERSION}\n" + printf "shlv:${SHLVL} jobs:${jobnum} last:${lastreturn} " +} + diff --git a/emacs.el b/emacs.el index 85ceb86..f4bde22 100644 --- a/emacs.el +++ b/emacs.el @@ -1650,12 +1650,10 @@ when SEC is nil, stop auto save if enabled." (call-process "cmd.exe" nil 0 nil "/c" "start" "" (convert-standard-filename file))) ((eq system-type 'darwin) (call-process "open" nil 0 nil file)) - ((not (getenv "DESKTOP_SESSION")) + ((not (getenv "DISPLAY")) (find-file file)) (t - (if (file-directory-p file) - (call-process my-filer nil 0 nil file) - (call-process "xdg-open" nil 0 nil file)))) + (call-process (or my-filer "xdg-open") nil 0 nil file))) (recentf-add-file file) (message "Opening %s...done" file)) From 0f2d121a27cd98c5b677e2e92f7ce2afd3de3dea Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 16 Mar 2012 16:48:31 +0900 Subject: [PATCH 095/107] add xset dpms settings --- xinitrc | 1 + 1 file changed, 1 insertion(+) diff --git a/xinitrc b/xinitrc index ffede58..6d91ea3 100644 --- a/xinitrc +++ b/xinitrc @@ -13,6 +13,7 @@ type synclient >/dev/null 2>&1 && { } xset s 1800 # go blank after 30 min +xset dpms 1810 1820 1830 # standby, suspend and off seem to be not different for my environment unset LC_MESSAGES export LANG=ja_JP.utf8 From dc1d85c32093c46c34003efded43e19438b5ab66 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 16 Mar 2012 17:59:29 +0900 Subject: [PATCH 096/107] update battery display --- bashrc | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/bashrc b/bashrc index e08381d..4195a8d 100755 --- a/bashrc +++ b/bashrc @@ -369,7 +369,7 @@ battery-status(){ local full=$(cat $dir/charge_full) local now=$(cat $dir/charge_now) local rate=$(expr $now \* 100 / $full) - printf $1 "${st}:${rate}%" + printf "$1" "${st}:${rate}%" fi } alias bat='battery-status %s\\n' @@ -404,13 +404,7 @@ __my_prompt_function(){ # used by PS1 then local pwd=$PWD local oldpwd=$OLDPWD - local jobnum= - if git branch >/dev/null 2>&1 - then - local git="[GIT]" - else - local git= - fi + git branch >/dev/null 2>&1 && local git="[GIT]" local date=$(/c/Windows/System32/cmd.exe //c 'echo %DATE%-%TIME%') else local pwd=$(echo "${PWD}/" | sed -e "s#${HOME}#~#") @@ -423,12 +417,14 @@ __my_prompt_function(){ # used by PS1 if test -z "$DISPLAY" then local ip=$(ip-address [Addr:%s]) - test -f ~/.batterystatus && local battery="[Battery:$(cat ~/.batterystatus | sed -e 's`%`%%`g')]" + test -f /tmp/batterystatus && local battery="[Battery:$(sed -e 's`%`%%`g' /tmp/batterystatus)]" + battery-status %s >/tmp/batterystatus & fi local tty=$(__try_exec tty | sed -e 's:/dev/::') # local battery=$(battery-state [%s] | sed -e 's`%`%%`g') # very slow printf " [${c1}${pwd}${cdef}<${c3}${oldpwd}${cdef}]${git}${svn}${battery}${ip}\n" printf "${c2}${USER}@${HOSTNAME}${cdef} ${tty} ${date} ${BASH} ${BASH_VERSION}\n" printf "shlv:${SHLVL} jobs:${jobnum} last:${lastreturn} " + } From f1d8fb869ee1d0e18162583399199298d9815b26 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 18 Mar 2012 00:22:47 +0900 Subject: [PATCH 097/107] misc changes --- emacs.el | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/emacs.el b/emacs.el index f4bde22..10a2824 100644 --- a/emacs.el +++ b/emacs.el @@ -500,7 +500,7 @@ (defun dllib-if-unfound (lib url &optional bite-compile-p force-download-p) ; new version "if LIB does not exist, download it from URL and locate it to \"~/emacs.d/lisp/LIB.el\". return nil if LIB unfound and downloading failed, otherwise the path of LIB." - (let* ((dir (expand-file-name "~/.emacs.d/lisp/")) + (let* ((dir (expand-file-name (concat user-emacs-directory "lisp/"))) (lpath (concat dir lib ".el")) (locate-p (locate-library lib))) (if (or force-download-p (not locate-p)) @@ -511,7 +511,9 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." t) (when bite-compile-p (byte-compile-file lpath))) - (error (message "downloading %s...something wrong happened!" url) + (error (and (file-readable-p lpath) + (delete-file lpath)) + (message "downloading %s...something wrong happened!" url) nil)) (locate-library lib)) locate-p))) @@ -525,6 +527,10 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." (require 'simple nil t) +(and window-system + (dllib-if-unfound "save-window-size" "https://raw.github.com/10sr/emacs-lisp/master/save-window-size.el" t) + (require 'save-window-size nil t)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; share clipboard with x (when (and window-system @@ -1845,6 +1851,11 @@ this is test, does not rename files" (when (>= emacs-major-version 23) (setq anthy-accept-timeout 1))) +;; quail +;; aproposs input-method for some information +(setq default-input-method "japanese") + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; windows用設定 From 506c19148723201fa30debbdc0fdec2602191e5d Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 18 Mar 2012 00:23:40 +0900 Subject: [PATCH 098/107] modify conkyrc --- conkyrc | 23 ++++++++++++++--------- conkyrc.2 | 5 ++--- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/conkyrc b/conkyrc index 6334786..3b641a7 100644 --- a/conkyrc +++ b/conkyrc @@ -48,21 +48,26 @@ ${color2}lgin ${color1}:${color0} ${uptime} #${color2}os ${color1}:${color0} ${sysname} ${kernel} ${color0}${stippled_hr} ${color2}freq ${color1}:${color0} ${freq 1}Mhz | ${freq 2}Mhz -${color2}cpu ${color1}:${color0} ${cpu cpu0}% ${cpubar cpu0} +${color2}cpu ${color1}:${color0} ${cpu}% ${cpubar} #${color2}btry ${color1}:${color0} ${battery} #${color2}btime${color1}:${color0} ${battery_time} ${color0}${hr} ${color2}ram ${color1}:${color0} ${memperc}% ${membar} -${color2}swap ${color1}:${color0} None +${color2}swap ${color1}:${color0} ${if_match ${swapmax} == 0}None${else}${swapperc} ${swapbar}${endif} ${color0}${stippled_hr} -${color2}root ${color1}:${color0} ${fs_free /} ${fs_bar /} -${color2}/tmp ${color1}:${color0} ${fs_free /tmp} ${fs_bar /tmp} +${color2}root ${color1}:${color0} ${fs_used /} #/${fs_size /} +${fs_bar /} +${color2}/tmp ${color1}:${color0} ${fs_used /tmp} #/${fs_size /tmp} +${fs_bar /tmp} +${color2}dio ${color1}:${color0} ${diskio} ${color0}${hr} -${color2}addr ${color1}:${color0} ${addr} +${color2}${gw_iface} ${color1}:${color0} ${addr} +${color2}ssid ${color1}:${color0} ${wireless_essid} ${color0}${stippled_hr} -${color2}down ${color1}:${color0} ${downspeed eth0}/s -${color #888888}${downspeedgraph eth0 ff0000 0000ff} -${color2}up ${color1}:${color0} ${upspeed eth0}/s -${color #888888}${upspeedgraph eth0 0000ff ff0000} +${color2}down ${color1}:${color0} ${downspeed}/s +${color #888888}${downspeedgraph ff0000 0000ff} +${color2}up ${color1}:${color0} ${upspeed}/s +${color #888888}${upspeedgraph 0000ff ff0000} ${color0}${hr} +${alignr}conky ${conky_version} on ${desktop_name} #${color0}${alignr}${execi 900 cal -1} diff --git a/conkyrc.2 b/conkyrc.2 index f88b945..ad04bef 100644 --- a/conkyrc.2 +++ b/conkyrc.2 @@ -35,7 +35,6 @@ uppercase no format_human_readable yes TEXT - -${color yellow}$$ tail -f /var/log/everything.log -${color white}${tail /var/log/everything.log 15} +${color yellow}$$ tail -f -n 12 /var/log/everything.log +${color white}${tail /var/log/everything.log 12} ${time %b %d %T} From e726d79109c422c07bf2a0c2619bafa27e6d2809 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 18 Mar 2012 17:40:44 +0900 Subject: [PATCH 099/107] add func _install_script --- bashrc | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/bashrc b/bashrc index 4195a8d..3634652 100755 --- a/bashrc +++ b/bashrc @@ -324,27 +324,38 @@ _chengecolors(){ # printf "\e]P7353535" \ -_echocolors(){ +_colors(){ echo -e \ - "\e[30mBlack\n" \ - "\e[31mRed\n" \ - "\e[32mGreen\n" \ - "\e[33mYellow\n" \ - "\e[34mBlue\n" \ - "\e[35mMagenta\n" \ - "\e[36mCyan\n" \ - "\e[37mWhite\n" \ - "\e[30;1mBright Black\n" \ - "\e[31;1mBright Red\n" \ - "\e[32;1mBright Green\n" \ - "\e[33;1mBright Yellow\n" \ - "\e[34;1mBright Blue\n" \ - "\e[35;1mBright Magenta\n" \ - "\e[36;1mBright Cyan\n" \ + "\e[30mBlack" \ + "\e[31mRed" \ + "\e[32mGreen" \ + "\e[33mYellow" \ + "\e[34mBlue" \ + "\e[35mMagenta" \ + "\e[36mCyan" \ + "\e[37mWhite" + echo -e \ + "\e[30;1mBright Black" \ + "\e[31;1mBright Red" \ + "\e[32;1mBright Green" \ + "\e[33;1mBright Yellow" \ + "\e[34;1mBright Blue" \ + "\e[35;1mBright Magenta" \ + "\e[36;1mBright Cyan" \ "\e[37;1mBright White\n" \ "\e[0m" } -# http://myminios.googlecode.com/svn-history/r10/trunk/colortable16.sh +# http://www.frexx.de/xterm-256-notes/data/colortable16.sh + +_install_script(){ + mkdir -p $HOMO/bin/ + for f in "$@" + do + bn=$(basename "$f") + type ${bn} >/dev/null 2>&1 || wget "$f" -P "$HOME/bin/" + chmod u+x "$HOME/bin/${bn}" + done +} winln(){ # for windose make link (actually junction) From 0c35817e51af4f51f3681a4f70568b9e3bec4104 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 18 Mar 2012 17:40:58 +0900 Subject: [PATCH 100/107] add cache dir pref --- _keysnail.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/_keysnail.js b/_keysnail.js index 7588e92..808642b 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -158,6 +158,14 @@ plugins.options["twitter_client.use_jmp"] = true; //////////////////////////////////////////// // エクステ +ext.add("my-setpref2", function(){ + util.setPrefs( + { + "browser.cache.disk.parent_directory":"/tmp" + } + ); +}, "my setpref2"); + ext.add('my-setpref', function(){ util.setPrefs( { From 6f37c8640dea2fbb9d3e9a1301df493028f41e1d Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 18 Mar 2012 17:41:08 +0900 Subject: [PATCH 101/107] modify conkyrc --- conkyrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conkyrc b/conkyrc index 3b641a7..82f12f5 100644 --- a/conkyrc +++ b/conkyrc @@ -25,7 +25,7 @@ stippled_borders 0 border_width 1 alignment top_right gap_x 20 -gap_y 50 +gap_y 40 default_color green # slategrey default_shade_color lightgrey @@ -47,8 +47,8 @@ ${color2}uptm ${color1}:${color0} ${uptime} ${color2}lgin ${color1}:${color0} ${uptime} #${color2}os ${color1}:${color0} ${sysname} ${kernel} ${color0}${stippled_hr} -${color2}freq ${color1}:${color0} ${freq 1}Mhz | ${freq 2}Mhz ${color2}cpu ${color1}:${color0} ${cpu}% ${cpubar} +${color2}freq ${color1}:${color0} ${freq 1}Mhz | ${freq 2}Mhz #${color2}btry ${color1}:${color0} ${battery} #${color2}btime${color1}:${color0} ${battery_time} ${color0}${hr} @@ -69,5 +69,5 @@ ${color #888888}${downspeedgraph ff0000 0000ff} ${color2}up ${color1}:${color0} ${upspeed}/s ${color #888888}${upspeedgraph 0000ff ff0000} ${color0}${hr} -${alignr}conky ${conky_version} on ${desktop_name} +${alignr}conky ${conky_version} on Page${desktop} #${color0}${alignr}${execi 900 cal -1} From 2332f2b50a386b01ecf68c2f3bd13d161f829705 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 18 Mar 2012 21:35:57 +0900 Subject: [PATCH 102/107] fix swap display --- conkyrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conkyrc b/conkyrc index 82f12f5..42f0695 100644 --- a/conkyrc +++ b/conkyrc @@ -53,7 +53,7 @@ ${color2}freq ${color1}:${color0} ${freq 1}Mhz | ${freq 2}Mhz #${color2}btime${color1}:${color0} ${battery_time} ${color0}${hr} ${color2}ram ${color1}:${color0} ${memperc}% ${membar} -${color2}swap ${color1}:${color0} ${if_match ${swapmax} == 0}None${else}${swapperc} ${swapbar}${endif} +${color2}swap ${color1}:${color0} ${if_match "${swapperc}" == "No swap"}None${else}${swapperc} ${swapbar}${endif} ${color0}${stippled_hr} ${color2}root ${color1}:${color0} ${fs_used /} #/${fs_size /} ${fs_bar /} From 3ee0e58067c749413b99efb1a46d8ba10225d1e3 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 18 Mar 2012 22:11:45 +0900 Subject: [PATCH 103/107] fix some settings --- bashrc | 49 ++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/bashrc b/bashrc index 3634652..115e327 100755 --- a/bashrc +++ b/bashrc @@ -39,10 +39,9 @@ then else export EDITOR=vi fi -export VISUAL="$EDITOR" -export LESS="-iRMX" export LC_MESSAGES=C export CDPATH=".:~" +export VISUAL="$EDITOR" export GIT_PAGER="$PAGER" export GIT_EDITOR="$EDITOR" @@ -77,7 +76,11 @@ fi ################################### # some aliases and functions -alias ls="ls -hCF $(test "$TERM" == dumb || echo --color=auto\ )--time-style=long-iso" +test "$TERM" == dumb || _ENABLECOLOR="--color=always " + +export LESS="-iRMX" +export GREP_OPTIONS="${_ENABLECOLOR}" +alias ls="ls -hCF ${_ENABLECOLOR}--time-style=long-iso" # alias ll="ls -l" # alias la="ls -A" # alias lla="ls -Al" @@ -439,3 +442,43 @@ __my_prompt_function(){ # used by PS1 } +# from https://wiki.archlinux.org/index.php/X_resources +invader(){ + # ANSI color scheme script featuring Space Invaders + # + # Original: http://crunchbanglinux.org/forums/post/126921/#p126921 + # Modified by lolilolicon + # + + f=3 b=4 + for j in f b; do + for i in {0..7}; do + printf -v $j$i %b "\e[${!j}${i}m" + done + done + bld=$'\e[1m' + rst=$'\e[0m' + + cat << EOF + + $f1 ▀▄ ▄▀ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4 ▀▄ ▄▀ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst + $f1 ▄█▀███▀█▄ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4 ▄█▀███▀█▄ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst + $f1█▀███████▀█ $f2▀▀███▀▀███▀▀ $f3▀█▀██▀█▀ $f4█▀███████▀█ $f5▀▀███▀▀███▀▀ $f6▀█▀██▀█▀$rst + $f1▀ ▀▄▄ ▄▄▀ ▀ $f2 ▀█▄ ▀▀ ▄█▀ $f3▀▄ ▄▀ $f4▀ ▀▄▄ ▄▄▀ ▀ $f5 ▀█▄ ▀▀ ▄█▀ $f6▀▄ ▄▀$rst + + $bld$f1▄ ▀▄ ▄▀ ▄ $f2 ▄▄▄████▄▄▄ $f3 ▄██▄ $f4▄ ▀▄ ▄▀ ▄ $f5 ▄▄▄████▄▄▄ $f6 ▄██▄ $rst + $bld$f1█▄█▀███▀█▄█ $f2███▀▀██▀▀███ $f3▄█▀██▀█▄ $f4█▄█▀███▀█▄█ $f5███▀▀██▀▀███ $f6▄█▀██▀█▄$rst + $bld$f1▀█████████▀ $f2▀▀▀██▀▀██▀▀▀ $f3▀▀█▀▀█▀▀ $f4▀█████████▀ $f5▀▀▀██▀▀██▀▀▀ $f6▀▀█▀▀█▀▀$rst + $bld$f1 ▄▀ ▀▄ $f2▄▄▀▀ ▀▀ ▀▀▄▄ $f3▄▀▄▀▀▄▀▄ $f4 ▄▀ ▀▄ $f5▄▄▀▀ ▀▀ ▀▀▄▄ $f6▄▀▄▀▀▄▀▄$rst + + + $f7▌$rst + + $f7▌$rst + + $f7 ▄█▄ $rst + $f7▄█████████▄$rst + $f7▀▀▀▀▀▀▀▀▀▀▀$rst + +EOF +} From 21c2337ae749086e49e829bda16987b606bb0568 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Sun, 18 Mar 2012 22:11:58 +0900 Subject: [PATCH 104/107] fix xclip prefs --- emacs.el | 1 + 1 file changed, 1 insertion(+) diff --git a/emacs.el b/emacs.el index 10a2824..baabd13 100644 --- a/emacs.el +++ b/emacs.el @@ -546,6 +546,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB." ;; http://garin.jp/doc/Linux/xwindow_clipboard (and (not x-select-enable-clipboard) + (getenv "DISPLAY") (executable-find "xclip") (dllib-if-unfound "xclip" "http://www.emacswiki.org/emacs/download/xclip.el" t) (require 'xclip nil t) From dd62e21913a71c2221e562439781e5aec665779d Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 19 Mar 2012 17:39:24 +0900 Subject: [PATCH 105/107] update conkyrc --- conkyrc | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/conkyrc b/conkyrc index 42f0695..42cb041 100644 --- a/conkyrc +++ b/conkyrc @@ -31,7 +31,7 @@ default_color green # slategrey default_shade_color lightgrey default_outline_color black color0 white -color1 black +color1 white color2 green no_buffers yes @@ -42,31 +42,31 @@ TEXT ${color0}${alignr}${conky_build_arch} ${color0}${alignr}${execi 30000 whoami}@${nodename} ${color0}${hr} -#${color2}host ${color1}:${color0} ${nodename} -${color2}uptm ${color1}:${color0} ${uptime} -${color2}lgin ${color1}:${color0} ${uptime} -#${color2}os ${color1}:${color0} ${sysname} ${kernel} +#${color2}host ${color1}|${color0} ${nodename} +${color2}uptm ${color1}|${color0} ${uptime} +${color2}lgin ${color1}|${color0} ${uptime} +#${color2}os ${color1}|${color0} ${sysname} ${kernel} ${color0}${stippled_hr} -${color2}cpu ${color1}:${color0} ${cpu}% ${cpubar} -${color2}freq ${color1}:${color0} ${freq 1}Mhz | ${freq 2}Mhz -#${color2}btry ${color1}:${color0} ${battery} -#${color2}btime${color1}:${color0} ${battery_time} +${color2}cpu ${color1}|${color0} ${cpu}% ${cpubar} +${color2}freq ${color1}|${color0} ${freq 1}Mhz | ${freq 2}Mhz +#${color2}btry ${color1}|${color0} ${battery} +#${color2}btime${color1}|${color0} ${battery_time} ${color0}${hr} -${color2}ram ${color1}:${color0} ${memperc}% ${membar} -${color2}swap ${color1}:${color0} ${if_match "${swapperc}" == "No swap"}None${else}${swapperc} ${swapbar}${endif} +${color2}ram ${color1}|${color0} ${memperc}% ${membar} +${color2}swap ${color1}|${color0} ${if_match "${swapperc}" == "No swap"}None${else}${swapperc} ${swapbar}${endif} ${color0}${stippled_hr} -${color2}root ${color1}:${color0} ${fs_used /} #/${fs_size /} +${color2}root ${color1}|${color0} ${fs_used /} #/${fs_size /} ${fs_bar /} -${color2}/tmp ${color1}:${color0} ${fs_used /tmp} #/${fs_size /tmp} +${color2}/tmp ${color1}|${color0} ${fs_used /tmp} #/${fs_size /tmp} ${fs_bar /tmp} -${color2}dio ${color1}:${color0} ${diskio} +${color2}dio ${color1}|${color0} ${diskio} ${color0}${hr} -${color2}${gw_iface} ${color1}:${color0} ${addr} -${color2}ssid ${color1}:${color0} ${wireless_essid} +${color2}${gw_iface} ${color1}|${color0} ${addr} +${color2}ssid ${color1}|${color0} ${wireless_essid} ${color0}${stippled_hr} -${color2}down ${color1}:${color0} ${downspeed}/s +${color2}down ${color1}|${color0} ${downspeed}/s ${color #888888}${downspeedgraph ff0000 0000ff} -${color2}up ${color1}:${color0} ${upspeed}/s +${color2}up ${color1}|${color0} ${upspeed}/s ${color #888888}${upspeedgraph 0000ff ff0000} ${color0}${hr} ${alignr}conky ${conky_version} on Page${desktop} From d64acfb11e34dd1b9ec4512156f6fe095859f138 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 19 Mar 2012 17:39:39 +0900 Subject: [PATCH 106/107] update o function --- bashrc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bashrc b/bashrc index 115e327..7d0803d 100755 --- a/bashrc +++ b/bashrc @@ -253,9 +253,9 @@ o(){ open "$f" elif type pcmanfm >/dev/null 2>&1 then - pcmanfm "$f" + LC_MESSAGES= pcmanfm "$f" else - xdg-open "$f" + LC_MESSAGES= xdg-open "$f" fi } convmv-sjis2utf8-test(){ From 8da6c5fd1d41ad919752ed62ea94e657066951d6 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Mon, 19 Mar 2012 17:39:47 +0900 Subject: [PATCH 107/107] misc changes --- _keysnail.js | 1 + emacs.el | 2 ++ 2 files changed, 3 insertions(+) diff --git a/_keysnail.js b/_keysnail.js index 808642b..542fb3d 100644 --- a/_keysnail.js +++ b/_keysnail.js @@ -159,6 +159,7 @@ plugins.options["twitter_client.use_jmp"] = true; // エクステ ext.add("my-setpref2", function(){ + // navigator.platform util.setPrefs( { "browser.cache.disk.parent_directory":"/tmp" diff --git a/emacs.el b/emacs.el index baabd13..af9515e 100644 --- a/emacs.el +++ b/emacs.el @@ -1604,6 +1604,8 @@ when SEC is nil, stop auto save if enabled." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; misc funcs +(defalias 'qcalc 'quick-calc) + ;; (when (require 'ansi-color nil t) ;; (ansi-color-for-comint-mode-on)) (defvar git-command-history nil