From 7036339d84108b8f4207193b35f5b6cc2fd0f09c Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Tue, 9 Feb 2016 16:07:42 +0900 Subject: [PATCH 1/9] Add experimental adoc-simple-mode --- emacs.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/emacs.el b/emacs.el index 4ff2dc8..177ef83 100644 --- a/emacs.el +++ b/emacs.el @@ -1846,4 +1846,16 @@ Commands are searched from ALIST." (defalias 'make 'compile) (define-key ctl-x-map "c" 'compile) + +;;;;;;;;;;;;;;;;;;;;;;; +;; adoc-simple-mode + +(when (safe-require-or-eval 'adoc-mode) + (define-derived-mode adoc-simple-mode adoc-mode + "Adoc-Simple" + "Major mode for editing AsciiDoc text files. +This mode is a simplified version of `adoc-mode'.") + (add-to-list 'auto-mode-alist + '("\\.adoc\\'" . adoc-simple-mode))) + ;;; emacs.el ends here From 13204f6a0840541471ad050936fc979fb02ece47 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 10 Feb 2016 19:11:30 +0900 Subject: [PATCH 2/9] Experimental implement of translate-popup-at-point --- emacs.el | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/emacs.el b/emacs.el index 177ef83..121d788 100644 --- a/emacs.el +++ b/emacs.el @@ -1858,4 +1858,13 @@ This mode is a simplified version of `adoc-mode'.") (add-to-list 'auto-mode-alist '("\\.adoc\\'" . adoc-simple-mode))) +(when (safe-require-or-eval 'google-translate) + (add-to-list 'google-translate-translation-directions-alist + '("en" . "ja")) + (defun translate-popup-at-point () + "Translate popup at point." + (interactive) + (let ((google-translate-output-destination 'popup)) + (google-translate-translate "en" "ja" (current-word t t))))) + ;;; emacs.el ends here From 9728656837bbdb67aa2e05db46c45fc65214b1ea Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 12 Feb 2016 12:27:59 +0900 Subject: [PATCH 3/9] Experimental update of adoc-simple-mode --- emacs.el | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/emacs.el b/emacs.el index 121d788..8942122 100644 --- a/emacs.el +++ b/emacs.el @@ -1851,10 +1851,17 @@ Commands are searched from ALIST." ;; adoc-simple-mode (when (safe-require-or-eval 'adoc-mode) + (defvar adoc-simple-font-lock-keywords + nil) (define-derived-mode adoc-simple-mode adoc-mode "Adoc-Simple" "Major mode for editing AsciiDoc text files. -This mode is a simplified version of `adoc-mode'.") +This mode is a simplified version of `adoc-mode'." + '(set (make-local-variable 'font-lock-defaults) + '(adoc-simple-font-lock-keywords + nil nil nil nil + (font-lock-multiline . t) + (font-lock-mark-block-function . adoc-font-lock-mark-block-function)))) (add-to-list 'auto-mode-alist '("\\.adoc\\'" . adoc-simple-mode))) From e40a721af0b86b450e4827e67e3407b8b1d66a6c Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 12 Feb 2016 12:41:10 +0900 Subject: [PATCH 4/9] emacs.el: Fix importing --- emacs.el | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/emacs.el b/emacs.el index 8942122..56e066e 100644 --- a/emacs.el +++ b/emacs.el @@ -699,8 +699,8 @@ IF OK-IF-ALREADY-EXISTS is true force download." (when (safe-require-or-eval 'whitespace) (add-to-list 'whitespace-display-mappings ; not work `(tab-mark ?\t ,(vconcat "^I\t"))) - (add-to-list 'whitespace-display-mappings - `(newline-mark ?\n ,(vconcat "$\n"))) + ;; (add-to-list 'whitespace-display-mappings + ;; `(newline-mark ?\n ,(vconcat "$\n"))) (setq whitespace-style '(face trailing ; trailing blanks newline ; newlines @@ -1865,7 +1865,8 @@ This mode is a simplified version of `adoc-mode'." (add-to-list 'auto-mode-alist '("\\.adoc\\'" . adoc-simple-mode))) -(when (safe-require-or-eval 'google-translate) +(when (and (safe-require-or-eval 'google-translate) + (safe-require-or-eval 'google-translate-smooth-ui)) (add-to-list 'google-translate-translation-directions-alist '("en" . "ja")) (defun translate-popup-at-point () From 024921c72279ee47163624865256a60c600ecd1b Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 12 Feb 2016 12:47:08 +0900 Subject: [PATCH 5/9] Update translate function --- emacs.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/emacs.el b/emacs.el index 56e066e..1b6cf5f 100644 --- a/emacs.el +++ b/emacs.el @@ -1869,10 +1869,10 @@ This mode is a simplified version of `adoc-mode'." (safe-require-or-eval 'google-translate-smooth-ui)) (add-to-list 'google-translate-translation-directions-alist '("en" . "ja")) - (defun translate-popup-at-point () + (defun translate-echo-at-point () "Translate popup at point." (interactive) - (let ((google-translate-output-destination 'popup)) + (let ((google-translate-output-destination 'echo-area)) (google-translate-translate "en" "ja" (current-word t t))))) ;;; emacs.el ends here From 7b671d9d3234e8c87fe8cf89c87d9ad2b4407dbf Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 12 Feb 2016 12:56:07 +0900 Subject: [PATCH 6/9] Add stub auto-translate-mode --- emacs.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/emacs.el b/emacs.el index 1b6cf5f..afe156a 100644 --- a/emacs.el +++ b/emacs.el @@ -1873,6 +1873,10 @@ This mode is a simplified version of `adoc-mode'." "Translate popup at point." (interactive) (let ((google-translate-output-destination 'echo-area)) - (google-translate-translate "en" "ja" (current-word t t))))) + (google-translate-translate "en" "ja" (current-word t t)))) + (define-minor-mode auto-translate-mode + "Translate word at point automatically." + :global nil + :lighter "ATranslate")) ;;; emacs.el ends here From 9800415cf6bde4d348158d12c4b7f82313564966 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 12 Feb 2016 17:11:57 +0900 Subject: [PATCH 7/9] Add condition for company invocation --- emacs.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/emacs.el b/emacs.el index afe156a..b79beb1 100644 --- a/emacs.el +++ b/emacs.el @@ -861,10 +861,11 @@ IF OK-IF-ALREADY-EXISTS is true force download." ;; some modes and hooks ;; http://qiita.com/sune2/items/b73037f9e85962f5afb7 -(global-company-mode) -(set-variable 'company-idle-delay 0.5) -(set-variable 'company-minimum-prefix-length 2) -(set-variable 'company-selection-wrap-around t) +(when (safe-require-or-eval 'company) + (global-company-mode) + (set-variable 'company-idle-delay 0.5) + (set-variable 'company-minimum-prefix-length 2) + (set-variable 'company-selection-wrap-around t)) ;; https://github.com/lunaryorn/flycheck From 2e326920f85af7c822b6510ca3b680ae429e024b Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 12 Feb 2016 17:17:15 +0900 Subject: [PATCH 8/9] Add sane line number display for jdee-mode --- emacs.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/emacs.el b/emacs.el index b79beb1..0cd707e 100644 --- a/emacs.el +++ b/emacs.el @@ -911,6 +911,13 @@ IF OK-IF-ALREADY-EXISTS is true force download." t) (autoload-eval-lazily 'sl)) +(with-eval-after-load 'jdee + (add-hook 'jdee-mode-hook + (lambda () + (make-local-variable 'global-mode-string) + (add-to-list 'global-mode-string + mode-line-position)))) + (with-eval-after-load 'make-mode (defvar makefile-mode-map (make-sparse-keymap)) (define-key makefile-mode-map (kbd "C-m") 'newline-and-indent) From 3881f026b01ebf907f905a4e63bdb027c3b1320b Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Fri, 12 Feb 2016 18:11:40 +0900 Subject: [PATCH 9/9] Makefile: Add git make alias --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index dbd813c..d356925 100644 --- a/Makefile +++ b/Makefile @@ -357,6 +357,7 @@ endif $(git_conf) alias.snap '! gitdir="`git rev-parse --git-dir`" && export GIT_INDEX_FILE="$$gitdir"/snapshot.index && cp "$$gitdir"/index "$$GIT_INDEX_FILE" && git add -A && : >>"$$gitdir"/logs/refs/snapshot && git update-ref refs/snapshot $$(git commit-tree $$(git write-tree) -m Snapshot -p HEAD) && git show --stat snapshot' $(git_conf) alias.setcmd '! f(){ git config alias.$$1 "! $$2"; }; f' + $(git_conf) alias.make '!make' #$(git_conf) alias.wc "!git ls-files -z | xargs -0 wc" # $(git_conf) push.default "simple"