From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: How to recognize keyboard insertion? Date: Sat, 31 Oct 2009 17:57:41 +0200 Message-ID: <83vdhvd096.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1257004687 13730 80.91.229.12 (31 Oct 2009 15:58:07 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 31 Oct 2009 15:58:07 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 31 16:58:00 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1N4GKz-0005sW-CE for ged-emacs-devel@m.gmane.org; Sat, 31 Oct 2009 16:57:57 +0100 Original-Received: from localhost ([127.0.0.1]:46472 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N4GKy-00080k-SJ for ged-emacs-devel@m.gmane.org; Sat, 31 Oct 2009 11:57:56 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N4GKu-000806-99 for emacs-devel@gnu.org; Sat, 31 Oct 2009 11:57:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N4GKp-0007yf-Px for emacs-devel@gnu.org; Sat, 31 Oct 2009 11:57:52 -0400 Original-Received: from [199.232.76.173] (port=47756 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N4GKp-0007yc-NJ for emacs-devel@gnu.org; Sat, 31 Oct 2009 11:57:47 -0400 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:50105) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N4GKo-0003vB-Rv for emacs-devel@gnu.org; Sat, 31 Oct 2009 11:57:47 -0400 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0KSD00600YW0R700@a-mtaout23.012.net.il> for emacs-devel@gnu.org; Sat, 31 Oct 2009 17:57:45 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.70.37.193]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0KSD006LWZ04OM00@a-mtaout23.012.net.il> for emacs-devel@gnu.org; Sat, 31 Oct 2009 17:57:41 +0200 (IST) X-012-Sender: halo1@inter.net.il X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:116511 Archived-At: Do we have infrastructure for detecting, inside one of the functions that insert text into buffers, characters that were inserted via the keyboard or keyboard macros? Failing that, can I safely assume that self-insert-command and its optimized variant in command_loop_1 are the only ways to insert characters from keyboard and keyboard macros, and that self-insert-command is only supposed to be invoked by characters typed at the keyboard? I'm asking because, in bidirectional editing, characters that are mirrored at display time need to be mirrored at keyboard input time. For example, when typing right-to-left text, the character `)' should be mirrored so that what ends up in the buffer is `(', because what the user means is to produce an open parenthesis. (Displaying this text will then mirror again, and display `)'; this last part already works in the bidi Emacs I'm working on). So I need to mirror characters typed at the keyboard, but not characters yanked from the kill ring or pasted from X selections. How can I discern the first kind from the second? TIA