Browse Source

misc changes

pull/1/head
10sr 12 years ago
parent
commit
0c4449d46f
1 changed files with 13 additions and 12 deletions
  1. +13
    -12
      .emacs.el

+ 13
- 12
.emacs.el View File

@@ -586,7 +586,7 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB."
(and x-select-enable-clipboard (and x-select-enable-clipboard
(executable-find "xclip") (executable-find "xclip")
(dllib-if-unfound "xclip" "http://www.emacswiki.org/emacs/download/xclip.el" t) (dllib-if-unfound "xclip" "http://www.emacswiki.org/emacs/download/xclip.el" t)
(require 'xclip nil t)
nil (require 'xclip nil t) ;; strange behavior: clipboard change unexpecdtedly; after copy on emacs, when copying on firefox soon clipboard content change back
(turn-on-xclip)) (turn-on-xclip))


;; その他のhook ;; その他のhook
@@ -615,6 +615,12 @@ return nil if LIB unfound and downloading failed, otherwise the path of LIB."
(add-hook 'sh-mode-hook (add-hook 'sh-mode-hook
(lambda () (lambda ()
(define-key sh-mode-map (kbd "C-x C-e") 'my-execute-shell-command-current-line))) (define-key sh-mode-map (kbd "C-x C-e") 'my-execute-shell-command-current-line)))
(defun my-execute-shell-command-curre
nt-line ()
""
(interactive)
(shell-command (buffer-substring-no-properties (point-at-bol)
(point))))


(add-hook 'inferior-python-mode-hook (add-hook 'inferior-python-mode-hook
(lambda () (lambda ()
@@ -1094,7 +1100,7 @@ otherwise, return FILENAME with `my-pack-default-extension'"


(defvar my-pack-program-alist (defvar my-pack-program-alist
`(("7z" ,my-7z-program "a" ,my-7z-program "x") `(("7z" ,my-7z-program "a" ,my-7z-program "x")
("tar" "tar" "cvf" "tar" "xvf")
("tar" "tar" "cf" "tar" "xf")
("tgz" "tar" "czf" "tar" "xzf") ("tgz" "tar" "czf" "tar" "xzf")
("txz" "tar" "cJf" "tar" "xJf") ("txz" "tar" "cJf" "tar" "xJf")
("zip" "zip" "-r" "unzip" nil))) ("zip" "zip" "-r" "unzip" nil)))
@@ -1618,12 +1624,6 @@ when SEC is nil, stop auto save if enabled."
(multi-term) (multi-term)
(ansi-term)))) (ansi-term))))


(defun my-execute-shell-command-current-line ()
""
(interactive)
(shell-command (buffer-substring-no-properties (point-at-bol)
(point-at-eol))))

(defun my-format-time-string (&optional time) (defun my-format-time-string (&optional time)
"" ""
(let ((system-time-locale "C")) (let ((system-time-locale "C"))
@@ -1650,7 +1650,7 @@ when SEC is nil, stop auto save if enabled."
(recentf-add-file file) (recentf-add-file file)
(message "Opening %s...done" file)) (message "Opening %s...done" file))


(defvar my-indent-buffer-mode-list
(defvar my-auto-indent-buffer-mode-list
'(emacs-lisp-mode '(emacs-lisp-mode
sh-mode sh-mode
js-mode js-mode
@@ -1664,7 +1664,7 @@ when SEC is nil, stop auto save if enabled."
(point-max))) (point-max)))
(defun my-auto-indent-buffer () (defun my-auto-indent-buffer ()
"" ""
(when (memq major-mode my-indent-buffer-mode-list)
(when (memq major-mode my-auto-indent-buffer-mode-list)
(my-indent-buffer))) (my-indent-buffer)))
(add-hook 'before-save-hook (add-hook 'before-save-hook
'my-auto-indent-buffer) 'my-auto-indent-buffer)
@@ -1673,8 +1673,9 @@ when SEC is nil, stop auto save if enabled."
"" ""
(interactive) (interactive)
(run-hooks 'before-keyboard-quit-hook) (run-hooks 'before-keyboard-quit-hook)
(redisplay)
(keyboard-quit)
(call-interactively 'keyboard-quit)
;; (redisplay t)
(redraw-display)
(run-hooks 'after-keyboard-quit-hook)) (run-hooks 'after-keyboard-quit-hook))
(substitute-key-definition 'keyboard-quit 'my-keyboard-quit global-map) (substitute-key-definition 'keyboard-quit 'my-keyboard-quit global-map)
;; (global-set-key (kbd "C-g") 'my-keyboard-quit) ;; (global-set-key (kbd "C-g") 'my-keyboard-quit)


Loading…
Cancel
Save