From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: Re: Reducing mouse-dependency In Emacs. Date: Mon, 11 Aug 2003 21:49:53 -0500 (CDT) Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <200308120249.h7C2nrw21487@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1060656871 3535 80.91.224.253 (12 Aug 2003 02:54:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 12 Aug 2003 02:54:31 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Tue Aug 12 04:54:29 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19mPIr-0003jL-00 for ; Tue, 12 Aug 2003 04:54:29 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19mPQN-0006Ti-00 for ; Tue, 12 Aug 2003 05:02:16 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19mPHC-0005dE-EP for emacs-devel@quimby.gnus.org; Mon, 11 Aug 2003 22:52:46 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19mPGe-0005cA-VR for emacs-devel@gnu.org; Mon, 11 Aug 2003 22:52:12 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19mPG8-0004yp-Cj for emacs-devel@gnu.org; Mon, 11 Aug 2003 22:52:11 -0400 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.20) id 19mPG7-0004xe-Jh for emacs-devel@gnu.org; Mon, 11 Aug 2003 22:51:39 -0400 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.9/8.12.9) with ESMTP id h7C2pceQ009987 for ; Mon, 11 Aug 2003 21:51:38 -0500 (CDT) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.6+Sun/8.11.6) id h7C2nrw21487; Mon, 11 Aug 2003 21:49:53 -0500 (CDT) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:15894 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:15894 The following (still strictly experimental) version of automatic help-echo display eliminates the main obnoxiousness of the original version. In the original version, you could be asked a question in the minibuffer, have to think about the answer, and suddenly the question disappears for some useless help-echo. The following version prevents that. It will only display the help-echo if the minibuffer is empty or contains "Quit". So, if you have "Mark set" in the echo area, you have to do C-g or otherwise clear the echo area (say by moving point) to get the help-echo. Seems better than to miss an important message, if not paying attention, by having it overridden by help-echo. Anyway, I wound up finding the original version unbearable in actual use. I found the one below much better. ===File ~/newhelp-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 for use in `run-with-idle-timer' and prevents display 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 "%s" short)) ((stringp echo) (message "%s" 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 #'maybe-display-help))) (defun maybe-display-help () (unless (and (current-message) (not (string= (current-message) "Quit"))) (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) ============================================================