[Homeros] Emacspeak glitches

Michael Pozhidaev msp на altlinux.ru
Вт Май 17 20:53:50 UTC 2011


Привет, Дима!

> Именно туда результат и выводится за исключением C-u M-! и C-u M-|. Патч
> в конце письма, включая и shell-command-on-region. Мне, правда, звук
> task-done не очень нравится в данном случае - слишком он шумный - но
> ничего больше подходящего по _смыслу_ вроде бы нет. Поэтому я у себя

Да, звук, действительно, странноватый. Правильно я понимаю, что патч
внизу - это суть тот же фикс, что был в предыдущем письме, только с
другим звуком и в виде патча, который можно просто приложить?

> В смысле сочинение с художественным описанием пирогов и блинов? Давай,
> мне будет интересно.)

Это требует собраться с мыслями... :))

>
> diff --git a/lisp/emacspeak-advice.el b/lisp/emacspeak-advice.el
> index 7fcb653..c0c2f0d 100644
> --- a/lisp/emacspeak-advice.el
> +++ b/lisp/emacspeak-advice.el
> @@ -874,6 +874,47 @@ Produce an auditory icon if possible."
>    (emacspeak-auditory-icon 'button))
>  
>  ;;}}}
> +;;{{{ shell-command:
> +
> +(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 shell-command-on-region (around emacspeak activate)
> +  (let ((emacspeak-speak-messages nil))
> +    ad-do-it)
> +  (when (called-interactively-p 'interactive)
> +    (emacspeak-speak-shell-command-output (ad-get-arg 3))))
> +
> +(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)))
> +
> +;;}}}
>  ;;{{{  Advice comint:
>  
>  (defadvice comint-magic-space (around emacspeak pre act)
> @@ -927,7 +968,7 @@ Produce an auditory icon if possible."
>  (add-hook 'shell-mode-hook 'emacspeak-pronounce-refresh-pronunciations)
>  
>  (loop for f in
> -      '(shell-command shell-dirstack-message)
> +      '(shell-dirstack-message)
>        do
>        (eval
>         `(defadvice ,f (around emacspeak pre act comp)

-- 
Michael Pozhidaev. Tomsk, Russia.
Russian info page: http://www.marigostra.ru/


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