[Homeros] Emacspeak glitches

Дмитрий Падучих dpaduch на k66.ru
Пн Май 16 16:31:46 UTC 2011


Я писал:

ДП> Проще сделать озвучивание для dired-do-shell-command, чем погружаться в
ДП> dired-aux.el.

На пробу:

(defun emacspeak-speak-shell-command-output (&optional output)
  (emacspeak-auditory-icon 'task-done)
  (cond
   ((or (stringp output) (bufferp output)) nil)
   ((not output)
    (let ((buffer (get-buffer "*Shell Command Output*")))
      (when buffer
	(with-current-buffer buffer
	  (if (= (point-min) (point-max))
	      (dtk-speak emacspeak-last-message)
	    (emacspeak-speak-region (point-min) (min (point-max) 8192))
	    (when (> (point-max) 8192)
	      (emacspeak-queue-auditory-icon 'ellipses)))))))
   (:else
    (if (= (point) (mark 'force))
	(dtk-speak "Empty output")
      (emacspeak-speak-region (point) (min (mark 'force) (+ (point) 8192)))
      (when (> (mark 'force) (+ (point) 8192))
	(emacspeak-queue-auditory-icon 'ellipses))))))

(defadvice shell-command (around emacspeak activate)
  (let ((emacspeak-speak-messages nil))
    ad-do-it)
  (when (called-interactively-p 'interactive)
    (emacspeak-speak-shell-command-output (ad-get-arg 1))))

(defadvice dired-do-shell-command (around emacspeak activate)
  (let ((emacspeak-speak-messages nil))
    ad-do-it)
  (when (called-interactively-p 'interactive)
    (emacspeak-speak-shell-command-output)))


-- 
Дмитрий Падучих


Подробная информация о списке рассылки Homeros