emacs-devel
[Top][All Lists]
Advanced

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

Re: Reducing mouse-dependency In Emacs.


From: Luc Teirlinck
Subject: Re: Reducing mouse-dependency In Emacs.
Date: Mon, 11 Aug 2003 10:52:10 -0500 (CDT)

Eli Zaretskii wrote:

   Why is this distracting?  A user who turns such a feature on must be
   knowing what they are doing.  For example, I assume a blind person
   _wants_ this info to be spelled by the speech synthesizer; otherwise,
   how would she know about these properties sitting around the text?

   (I assume that your implementation waits for some amount of time
   before it displays the text in the echo area, so the text is shown
   only if one dwells long enough on the text covered by the property.)

I only used a rudimentary implementation to experiment.  It is
provided below.  If we would go for a "real" implementation, the
variable `delay' would be replaced by a real defcustom for a variable
with a longer name and there would be a user option to enable or
cancel the timer.  In the meantime, one can experiment with 
(setq delay some_number)

Do: `M-x cancel-echo' when you are fed up with it.  (Which may happen
rather quickly.)  Again, this command is only provided for
experimentation convenience.

Some of the really rough edges could be improved by a more
sophisticated implementation.

However, I do not know what to do about the fact that the vast
majority of things popping up are of the:
"mouse-2: do something you do not want to do" type.

(In the most often used buffers, dired, *info* and the like.)

I find that stuff popping up in the echo area all the time annoying,
let alone have it spoken to me.  (And a blind person can not use the
mouse anyway.)

   otherwise,
   how would she know about these properties sitting around the text?

That is a problem.  That is one of the reasons I provided
`next-help-echo-region' and `previous-help-echo-region'.  They allow
to scan the buffer and check what kind of features are provided.  This
can be done while the user is focused on this subject, without
distracting her while she is working on something else and should be
focusing on that.  For the seeing non mouse oriented user, my
highlighting functions, which I will send somewhat later could be used
as a complement to these motion functions.  They too are meant more to
get some idea of "what is in the buffer" than as permanent
highlighting.  I do not know how highlighting works in emacspeak.

===File ~/help-timer.el=====================================
(defun print-local-help (&optional timer)
  "Display help related text or overlay properties.
This displays a short help message in the echo area, namely the
value of the `short-help' text or overlay property at point.  If
there is no `short-help' property at point, but there is a
`help-echo' property whose value is a string, then that is
printed instead.

The timer argument is meant fro use in `run-with-idle-timer' and
prevents displey of a message in case there is no help."
  (interactive)
  (let ((short (get-char-property (point) 'short-help))
        (echo (get-char-property (point) 'help-echo)))
    (cond (short (message short))
          ((stringp echo) (message echo))
          ((not timer) (message "No local help at point")))))

(defvar delay 1)

(defvar local-help-timer nil)

(unless local-help-timer
  (setq local-help-timer (run-with-idle-timer delay t #'print-local-help t)))
   
(defun cancel-echo ()
  (interactive)
  (cancel-timer local-help-timer)
  (setq local-help-timer nil))

(global-set-key "\C-h\C-l" 'print-local-help)
============================================================




reply via email to

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