Browse Source

Added Japanese dictionary lookup

* Remove mark when doing clang-format regardless of whether anything
was formatted
* Remove pattern (unused)
master
Macoy Madson 2 years ago
parent
commit
6e82a7eb69
3 changed files with 25 additions and 5 deletions
  1. +3
    -2
      Emacs/code-formatting.el
  2. +20
    -0
      Emacs/language.el
  3. +2
    -3
      Emacs/search.el

+ 3
- 2
Emacs/code-formatting.el View File

@ -42,11 +42,12 @@
(defun macoy-clang-format-paragraph ()
"Format the block/paragraph"
(interactive)
(save-excursion
(save-mark-and-excursion
(unless (use-region-p)
(mark-paragraph))
(when (use-region-p)
(call-interactively 'clang-format-region))))
(call-interactively 'clang-format-region)))
(deactivate-mark))
(defun macoy-clang-format-function ()
"Format the function"


+ 20
- 0
Emacs/language.el View File

@ -0,0 +1,20 @@
(setq macoy-edict-location "C:/Users/mmadson/MacoyPrograms/Emacs27_Win64_WithDeps/dependencies/edict/edict")
(setq macoy-kanjidict-location nil)
(add-to-list 'auto-coding-alist '("edict\\'" . euc-jp))
(add-to-list 'auto-coding-alist '("kanjidic\\'" . euc-jp))
;; From https://www.emacswiki.org/emacs/UsingEdict
(defun macoy-find-region-translation-japanese (start end)
"Find the region in the EDICT file."
(interactive "r")
(let ((str (buffer-substring-no-properties start end))
(conf (current-window-configuration)))
(if (and macoy-kanjidict-location (= (length str) 1))
(find-file macoy-kanjidict-location)
(find-file macoy-edict-location))
(goto-char (point-min))
(when (occur str)
(set-window-configuration conf)
(switch-to-buffer "*Occur*")
(local-set-key (kbd "q") 'bury-buffer))))

+ 2
- 3
Emacs/search.el View File

@ -160,7 +160,7 @@ If there's a string at point, offer that as a default."
(setq codesearch-dir-to-index "f:/CJUNCTIONS/src")
(setq codesearch-index-file "~/.csearchindex")
(setq codesearch-temp-file "c:/.temp-codesearch.txt")
(setq macoy-codesearch-search-data-dir "D:/Magic/data")
;; (setq macoy-codesearch-search-data-dir "D:/Magic/data")
)
(when (string-equal (user-login-name) "macoy")
@ -248,8 +248,7 @@ If there's a string at point, offer that as a default."
(compilation-start (format "%s -n -i \"%s\""
codesearch-csearch-exe
;; (regexp-quote pattern) ;; This doesn't work because more escape(\) chars are added
pattern
codesearch-temp-file)
pattern)
#'macoy-codesearch-mode
`(lambda (mode-name) , "*Codesearch*")
)


Loading…
Cancel
Save