From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Shift on console Date: Mon, 17 Mar 2008 23:31:05 +0000 Message-ID: <20080317233104.GA1824@muc.de> References: <20080316192329.GB1544@muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205795814 17795 80.91.229.12 (17 Mar 2008 23:16:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Mar 2008 23:16:54 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Robert J. Chassell" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 18 00:17:23 2008 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 1JbOa0-0001Fl-1F for ged-emacs-devel@m.gmane.org; Tue, 18 Mar 2008 00:17:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JbOZQ-0001bS-3V for ged-emacs-devel@m.gmane.org; Mon, 17 Mar 2008 19:16:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JbOZL-0001b7-6W for emacs-devel@gnu.org; Mon, 17 Mar 2008 19:16:39 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JbOZJ-0001ai-Jl for emacs-devel@gnu.org; Mon, 17 Mar 2008 19:16:38 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JbOZJ-0001ad-DV for emacs-devel@gnu.org; Mon, 17 Mar 2008 19:16:37 -0400 Original-Received: from colin.muc.de ([193.149.48.1] helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JbOZJ-00057Q-3V for emacs-devel@gnu.org; Mon, 17 Mar 2008 19:16:37 -0400 Original-Received: (qmail 10578 invoked by uid 3782); 17 Mar 2008 23:16:26 -0000 Original-Received: from acm.muc.de (p57AF7E15.dip.t-dialin.net [87.175.126.21]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Tue, 18 Mar 2008 00:16:25 +0100 Original-Received: (qmail 4563 invoked by uid 1000); 17 Mar 2008 23:31:05 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-kernel: by monty-python.gnu.org: FreeBSD 4.6-4.9 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:92859 Archived-At: Hi, Robert! On Mon, Mar 17, 2008 at 12:49:27AM +0000, Robert J. Chassell wrote: > Alan Mackenzie asked > Where "console" = ???? > /dev/tty2, also known by the Debian folks and others as a `virtual > console'. It does not have X or any other windowing system and is > what we once called a `terminal'. > This problem is going to become really problematic if "shift-movement > selection" becomes the Emacs default". > Perhaps others expect a graphical windowing environment in all > circumstances. > When I SSH to gnu.org and log into it with an RXVT shell on my local > machine, and invoke Emacs on fp.gnu.org, I can run C-M-S-v > (scroll-other-window-down), that is to say, the shift key succeeds; > but when I do the same in a plain console -- no RXVT shell -- I > cannot. In my last post when I said "GNU tty", I actually meant "Linux tty". Sorry! (Who's been getting me confused between GNU and Linux? ;-) There is actually a feature/bug/misfeature (I'd say bug), in event-apply-modifier (simple.el), which forces C-a and C-A (possibly with more modifiers) to be identical, namely 0x01. I've been using the following function instead, which sets b25 (the bit) on C-S-a: ("kn" stands for Kalle Niemitalo, BTW, who worked out most of this stuff ~10 years ago). (defun kn-event-apply-modifier (event symbol lshiftby prefix) "Apply a modifier flag to event EVENT. Unlike the core Emacs function `event-apply-modifier', when both and are modifying a\(n English\) letter in an event, b25 is set (for shift), and the LSB contains C-. SYMBOL is the name of this modifier, as a symbol. LSHIFTBY is the bit position of the modifier bit; e.g. 25 means 0x2000000. PREFIX is the string that represents this modifier in an event type symbol." (if (numberp event) (let ((letter (logand event 4194303))) ; 2^22 - 1 (if (eq symbol 'control) (cond ((and (>= letter ?A) (<= letter ?Z)) (- (logior (lsh 1 25) event) ?A -1)) ; add ((and (>= letter ?a) (<= letter ?z)) (- event ?a -1)) ((and (>= letter ?\C-a) (<= letter ?\C-z))) ; do nothing (t (logior (lsh 1 lshiftby) event))) (logior (lsh 1 lshiftby) event))) (if (memq symbol (event-modifiers event)) event (let ((event-type (if (symbolp event) event (car event)))) (setq event-type (intern (concat prefix (symbol-name event-type)))) (if (symbolp event) event-type (cons event-type (cdr event))))))) > Robert J. Chassell -- Alan Mackenzie (Nuremberg, Germany).