From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: How to distinguish character from noncharacter input events? Date: Tue, 10 Aug 2004 15:32:05 GMT Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1092152199 25676 80.91.224.253 (10 Aug 2004 15:36:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 10 Aug 2004 15:36:39 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Aug 10 17:36:20 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BuYfj-00032j-00 for ; Tue, 10 Aug 2004 17:36:19 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BuYjX-0000nA-Mo for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Aug 2004 11:40:15 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!snoopy.risq.qc.ca!charlie.risq.qc.ca!53ab2750!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 25 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Original-NNTP-Posting-Host: 132.204.24.84 Original-X-Complaints-To: abuse@umontreal.ca Original-X-Trace: charlie.risq.qc.ca 1092151925 132.204.24.84 (Tue, 10 Aug 2004 11:32:05 EDT) Original-NNTP-Posting-Date: Tue, 10 Aug 2004 11:32:05 EDT Original-Xref: shelby.stanford.edu gnu.emacs.help:124724 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:20069 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:20069 > Is there a function that distinguishes character from noncharacter > input events? It would be nice to be able to write > (let ((next (read-event))) > (if (char-p next) > (progn ...) > (...))) > but I can't find anything of the sort. What for? What's your definition of a "character event"? You could try (integerp event) but it will also return non-nil for M-p and C-x. So you might want to use (and (integerp event) (null (event-modifiers event)) but it all depends on what you consider to be a character event, of course. Stefan