Преглед изворни кода

do not query same word twice

pull/1/head
10sr пре 10 година
родитељ
комит
c800851662
1 измењених фајлова са 8 додато и 0 уклоњено
  1. +8
    -0
      emacs.el

+ 8
- 0
emacs.el Прегледај датотеку

@@ -2388,6 +2388,7 @@ Freeze current input and show next prompt."

(defvar isdcv-sdcv-command "sdcv -n '%s'"
"Command of sdcv.")
(setq isdcv-sdcv-command "sdcv -n -u jmdict-en-ja '%s'")

(defvar isdcv-buffer nil
"Pointer to incremental sdcv buffer.")
@@ -2395,6 +2396,9 @@ Freeze current input and show next prompt."
(defvar isdcv--timer nil
"Idle timer object for isdcv.")

(defvar isdcv--last-input nil
"Last input queryed.")

(defun isdcv--timer-add ()
"Entry idle timer for isdcv."
(and (eq isdcv-buffer
@@ -2440,12 +2444,16 @@ This function insert newline if required."
(let ((input (isdcv--get-input))
(outpoint (isdcv--get-output-start)))
(and input
;; do not query same word twice
(not (eq isdcv--last-input
input))
outpoint
isdcv-sdcv-command
(save-excursion
(goto-char outpoint)
(delete-region (point)
(point-max))
(setq isdcv--last-input input)
(call-process-shell-command (format isdcv-sdcv-command
input)
nil


Loading…
Откажи
Сачувај