emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Info: Console Vs GUI difference?


From: T.V. Raman
Subject: Info: Console Vs GUI difference?
Date: Thu, 31 Oct 2013 15:14:30 -0700

Hi Stefan:

At this point for the error/signal/user-error feedback -- i
believe command-error-funciton should meet my needs except for
backward compatibility -- some help in knowing how to use it
correctly would help.

Re your suggestion re calling backtrace within the advice, tried
that -- and though I'm hearing the spurious feedback under X  in
Info -- but not at the terminal -- the backtrace is not
invoked. This leads me to suspect a subtle bug in advice itself
-- Here are the advice fragments I have for error, user-error and
signal.

(defcustom emacspeak-speak-errors t
  "Specifies if error messages are cued."
  :type 'boolean
  :group 'emacspeak-speak)

(defadvice error (before emacspeak pre act comp)
  "Speak the error message.
 Also produces an auditory icon if possible."
  (when emacspeak-speak-errors
    (let ((emacspeak-speak-signals nil)
          (emacspeak-speak-errors nil)
          (dtk-stop-immediately  nil))
      (emacspeak-auditory-icon 'warn-user)
      (tts-with-punctuations 'all
                             (dtk-speak
                              (apply #'format (ad-get-arg 0)(ad-get-args 1))))))
  t)

(defadvice user-error (before emacspeak pre act comp)
  "Speak the error message."
  (when emacspeak-speak-errors
    (let ((emacspeak-speak-signals nil)
          (emacspeak-speak-errors nil)
          (dtk-stop-immediately  nil))
      (tts-with-punctuations 'all
                             (dtk-speak
                              (apply #'format (ad-get-arg 0)(ad-get-args 1))))))
  t)



;;;###autoload
(defcustom emacspeak-speak-signals t
  "Specifies if signalled   messages are cued."
  :type 'boolean
  :group 'emacspeak-speak)

(defadvice signal (before emacspeak pre act compile)
  "Speak the signalled  message."
  (when emacspeak-speak-signals
    (let ((msg (first (ad-get-arg 1))))
      (when (and msg (> (length msg) 0))
        (tts-with-punctuations 'all (dtk-speak msg))))))

-- 

-- 


On 10/31/13, Stefan Monnier <address@hidden> wrote:
>> And speaking of aditional emacs hooks that would help emacspeak:
>
>> 1. A hook that I can use to catch read-only    errors for  typing
>> commands  -- a hook here would be a clean solution because
>> independent of context, I mostly want to speak the same thing
>
>> 2. Less need to advice error/ and hopefully never to advice signal --
>> This one is harder because many emacs packages use signal and
>> error to signal conditions that should be communicated to the
>> average user.
>
> It seems from where I stand that both should be covered by
> command-error-function.  So, maybe you should explain in more detail
> which part of command-error-function doesn't suit your need.
>
>
>         Stefan
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]