Pārlūkot izejas kodu

add ms translater, not works

pull/1/head
10sr pirms 10 gadiem
vecāks
revīzija
2a6b19e59d
1 mainītis faili ar 18 papildinājumiem un 1 dzēšanām
  1. +18
    -1
      emacs.el

+ 18
- 1
emacs.el Parādīt failu

@@ -2430,8 +2430,25 @@ result for that word.")
(shell-command-to-string
(format "dict_app '%s'"
word))))
("ms" .
(lambda (word)
(let ((url (concat "http://api.microsofttranslator.com/V2/Ajax.svc/"
"Translate?appId=%s&text=%s&to=%s"))
(apikey "3C9778666C5BA4B406FFCBEE64EF478963039C51")
(target "ja")
(eword (url-hexify-string word)))
(with-current-buffer (url-retrieve-synchronously
(format url
apikey
eword
target))
;; (search-forward-regexp "^$")
(buffer-substring-no-properties (point)
(point-max))))))
))

;; (switch-to-buffer (url-retrieve-synchronously "http://google.com"))

(setq ilookup-default "ja")

(defun ilookup--timer-add ()
@@ -2500,10 +2517,10 @@ This function insert newline if required."
inputl)
(car inputl))))
(save-excursion
(setq ilookup--last-input input)
(goto-char outpoint)
(delete-region (point)
(point-max))
(setq ilookup--last-input input)
(insert (if func
(funcall func
word)


Notiek ielāde…
Atcelt
Saglabāt