From unknown Mon Jun 16 23:50:36 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#24456 <24456@debbugs.gnu.org> To: bug#24456 <24456@debbugs.gnu.org> Subject: Status: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords Reply-To: bug#24456 <24456@debbugs.gnu.org> Date: Tue, 17 Jun 2025 06:50:36 +0000 retitle 24456 25.1; [PATCH] Caps-lock doesn't affect interpretation of key = chords reassign 24456 emacs submitter 24456 Dima Kogan severity 24456 minor tag 24456 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 03:01:57 2016 Received: (at submit) by debbugs.gnu.org; 18 Sep 2016 07:01:57 +0000 Received: from localhost ([127.0.0.1]:34181 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blW6u-0001yE-Mq for submit@debbugs.gnu.org; Sun, 18 Sep 2016 03:01:56 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56175) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blW6s-0001xz-SW for submit@debbugs.gnu.org; Sun, 18 Sep 2016 03:01:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1blW6m-0003TK-KK for submit@debbugs.gnu.org; Sun, 18 Sep 2016 03:01:49 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:59149) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blW6m-0003R2-CD for submit@debbugs.gnu.org; Sun, 18 Sep 2016 03:01:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blW6j-000512-QL for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2016 03:01:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1blW6d-0003EV-Ot for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2016 03:01:44 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:58413) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1blW6b-0002rR-Dl for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2016 03:01:39 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D96012047C for ; Sun, 18 Sep 2016 03:01:25 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Sun, 18 Sep 2016 03:01:25 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=content-type:date:from:message-id:mime-version:subject:to :x-sasl-enc:x-sasl-enc; s=mesmtp; bh=vSQSN+1AeThg2v3uFkFsCqoUQX8 =; b=rfXxHMhW3mYZ8Sw9++dw1qsobeOheMACu0ZV6678aoCkxf+A+BzaVnwsegC FMaCgnJZptbKMTTsN0oOvwypci0+Zo27+WpeSHdRf330ZdbErxO568QKERiJSdD+ XFtakYLHY1JBK+Ki3cZ14oDzNKEmH+zBRfWwqO36yY7oUxHw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=vS QSN+1AeThg2v3uFkFsCqoUQX8=; b=kIwefIuOU+fhBJSuZRgZYJAZvlRIOFkXhL sY++N7a8MkrTW4Q15R7r+0wxzKr26JHIr9AP5DDemjAsSY/lDZBD9EOtc+gczFZK Cq8FCevKoofpNeL5VQQwOA9n10ZnqoELFFGgrn2Nfnp3U7fJNqdE0Eb/qh42N/ky lkxPfdW0s= X-Sasl-enc: sRLtkkzTXf0mZfiDtH+XScqKU7QiPP8Nk7KYg3P0s5RD 1474182085 Received: from shorty.local (50-1-153-216.dsl.dynamic.fusionbroadband.com [50.1.153.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 709C9CCE89 for ; Sun, 18 Sep 2016 03:01:25 -0400 (EDT) Received: from dima by shorty.local with local (Exim 4.87) (envelope-from ) id 1blW6N-0005Fr-Uy for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2016 00:01:23 -0700 From: Dima Kogan To: bug-gnu-emacs@gnu.org Subject: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords Date: Sun, 18 Sep 2016 00:01:23 -0700 Message-ID: <87oa3l7ku4.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain Hi. I noticed that on some platforms the caps-lock state can affect how key chords are interpreted. It is currently inconsistent across platforms. The behavior that feels correct to me is that caps-lock should affect the case of letters as they are typed, and NOTHING else. On gtk, if caps-lock is ON then Control+s produces C-S-s and Control+Shift+s produces C-s; this is backwards from what I think it should do. On OSX it looks like with caps-lock, both shifted and non-shifted presses produce C-s, which is 50% wrong regardless of how one thinks this SHOULD work. On Windows it does the right thing. In a console on Debian it looks like Control+Shift+s produces C-s regardless of caps-lock, but I suspect this has a deeper cause than what this patch touches. I have tested this patch on gtk (fixes it) and the console (doesn't change anything). Hopefully it makes osx work properly while letting windows builds keep working. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Caps-lock-doesn-t-affect-interpretation-of-key-chord.patch >From 7e34d122ff981c4a9eb671aa2400efbf65144506 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 17 Sep 2016 23:47:48 -0700 Subject: [PATCH] Caps-lock doesn't affect interpretation of key chords * src/keyboard.c (make_lispy_event): when a user pressed key-chords the caps-lock no longer affects the "shift" state of the generated chord. For instance Control+s produces C-s regardless of the caps-lock state. And Control+Shift+s produces C-S-s regardless of the caps-lock state. --- src/keyboard.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/keyboard.c b/src/keyboard.c index b8bc361..a977de5 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5415,6 +5415,32 @@ make_lispy_event (struct input_event *event) EMACS_INT c = event->code; if (event->kind == ASCII_KEYSTROKE_EVENT) { + /* Caps-lock shouldn't affect interpretation of key chords: + Control+s should produce C-s whether caps-lock is on or + not. And Control+Shift+s should produce C-S-s whether + caps-lock is on or not. */ + if (event->modifiers & ~shift_modifier) + { + /* this is a key chord: some non-shift modifier is + depressed */ + + if ('A' <= c && c <= 'Z' && + !(event->modifiers & shift_modifier) ) + { + /* Got a capital letter without a shift. The caps + lock is on. Un-capitalize the letter */ + c |= (unsigned)('a' - 'A'); + } + else if (('a' <= c && c <= 'z') && + (event->modifiers & shift_modifier) ) + { + /* Got a lower-case letter even though shift is + depressed. The caps lock is on. Capitalize the + letter */ + c &= ~(unsigned)('a' - 'A'); + } + } + c &= 0377; eassert (c == event->code); /* Turn ASCII characters into control characters -- 2.9.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 10:04:35 2016 Received: (at 24456) by debbugs.gnu.org; 18 Sep 2016 14:04:35 +0000 Received: from localhost ([127.0.0.1]:34442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blchv-0005jg-1w for submit@debbugs.gnu.org; Sun, 18 Sep 2016 10:04:35 -0400 Received: from mail-it0-f54.google.com ([209.85.214.54]:36346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blchs-0005jM-Ri; Sun, 18 Sep 2016 10:04:33 -0400 Received: by mail-it0-f54.google.com with SMTP id o3so49029608ita.1; Sun, 18 Sep 2016 07:04:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=/3p5eVCif1vJndL1EL4FRxn4GCU68OLTMO30ZVtecZY=; b=Kie1JG04vhRXtCfuvpv9RSdi8RzhY5v0y3HY/0RTmdQZFMiwWrxru2TvXv8w87koJ1 S+k54X0SpIliGixGfTILmZDp+MkAwz2KN9bCUbNkgIXO4Ym715jBRML9NXDciCPJjui6 Fd0pfM3k/phlzN5FbTCn3Om1cWmYaLj6MQm9RYO/vtVZDYdHib8AdcqonPzi0TI/aBG+ VTvkkRqmAfmIkUOQ3pR67li76+r8nvxz7kI+94rvNvAxJX2EsDXInPYwUiTCUb+/DMHd BijWkyQt+UgmHVYNfyQBXmXyt4yIWFFyKx4ewbFp0c2dcLeDJB8YSD1Ds+HvC6AAmXhX elOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=/3p5eVCif1vJndL1EL4FRxn4GCU68OLTMO30ZVtecZY=; b=MzDuoM4LovZFdTpFW7OA6/vcECl2HVO82sC6xPGj6LTr0qMz88ai6/q+5LxROWr2K1 feBRzTRh7mjZgLfI4KAmtPZsKUF2pA7TGMAj+mcYW7b2jCUN8Ovl90oxvxpzMFRmMoA6 AMSURstkOXb4zKfz5g00WUEl4B4VCBLf+nHHJJOFePnhzn3BCgXvERLecYpdMGoAZ1w3 sdi5XckgbG+H01guj7gzhO/INy19exsL7/8pwy2m2mGirhPFZhDO4Ph9JL7zS1FliY4A +iuYjF85/l1oAr/d/jPPGmovnavNHelYiDHpwjkOpF1q8F103W1J57BYQU7YR6i2vohB 5hBg== X-Gm-Message-State: AE9vXwOj/ttjp3TFPBeJEgTsdp5ndqMgpsBjH15N1N/XVPWJx7Fl16dPKcxmY08DTnDmSw== X-Received: by 10.36.39.195 with SMTP id g186mr5827294ita.53.1474207467163; Sun, 18 Sep 2016 07:04:27 -0700 (PDT) Received: from zony ([45.2.7.130]) by smtp.googlemail.com with ESMTPSA id f14sm6525318ita.10.2016.09.18.07.04.26 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 18 Sep 2016 07:04:26 -0700 (PDT) From: npostavs@users.sourceforge.net To: Dima Kogan Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords References: <87oa3l7ku4.fsf@secretsauce.net> Date: Sun, 18 Sep 2016 10:04:50 -0400 In-Reply-To: <87oa3l7ku4.fsf@secretsauce.net> (Dima Kogan's message of "Sun, 18 Sep 2016 00:01:23 -0700") Message-ID: <87k2e9z4l9.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 24456 Cc: 24456@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) forcemerge 4931 24456 quit Dima Kogan writes: > > In a console on Debian it looks like Control+Shift+s produces C-s > regardless of caps-lock, but I suspect this has a deeper cause than what > this patch touches. Yeah, I think for terminals the keystrokes have to fit in bytes, so there is no room for both a Ctrl and Shift bit to be set. > > > I have tested this patch on gtk (fixes it) and the console (doesn't > change anything). Hopefully it makes osx work properly while letting > windows builds keep working. After applying the patch to emacs-25, I built --with-x-toolkit=lucid and --enable-checking; I get an assertion violation when hitting C-n with capslock on. In GNU Emacs 25.1.28 (x86_64-unknown-linux-gnu, X toolkit) of 2016-09-18 built on zony Repository revision: 76981c4457682ae8699789b334a3be7b60ad301d Windowing system distributor 'The X.Org Foundation', version 11.0.11804000 Configured using: 'configure --cache-file=../debug-config.cache 'CFLAGS=-O0 -g3 -march=native' --enable-checking MAKEINFO=makeinfo-4.13a --with-x-toolkit=lucid --without-toolkit-scroll-bars --with-gif=no --with-jpeg=no' #0 terminate_due_to_signal (sig=6, backtrace_limit=2147483647) at emacs.c:354 #1 0x00000000005fa996 in die (msg=0x7273e6 "c == event->code", file=0x7259b0 "keyboard.c", line=5415) at alloc.c:7223 #2 0x000000000057d40e in make_lispy_event (event=0xd2ab68 ) at keyboard.c:5415 #3 0x000000000057a2e3 in kbd_buffer_get_event (kbp=0x7fffffffddc8, used_mouse_menu=0x7fffffffe3af, end_time=0x0) at keyboard.c:4071 #4 0x000000000057514a in read_event_from_main_queue (end_time=0x0, local_getcjmp=0x7fffffffe170, used_mouse_menu=0x7fffffffe3af) at keyboard.c:2148 #5 0x0000000000575410 in read_decoded_event_from_main_queue (end_time=0x0, local_getcjmp=0x7fffffffe170, prev_event=0, used_mouse_menu=0x7fffffffe3af) at keyboard.c:2211 #6 0x0000000000576fa7 in read_char (commandflag=1, map=28530083, prev_event=0, used_mouse_menu=0x7fffffffe3af, end_time=0x0) at keyboard.c:2799 #7 0x0000000000585fe3 in read_key_sequence (keybuf=0x7fffffffe560, bufsize=30, prompt=0, dont_downcase_last=false, can_return_switch_frame=true, fix_current_buffer=true, prevent_redisplay=false) at keyboard.c:9089 #8 0x00000000005730f0 in command_loop_1 () at keyboard.c:1365 #9 0x000000000061a8c2 in internal_condition_case (bfun=0x572cb4 , handlers=19056, hfun=0x572346 ) at eval.c:1309 #10 0x00000000005728f6 in command_loop_2 (ignore=0) at keyboard.c:1107 #11 0x0000000000619e91 in internal_catch (tag=45840, func=0x5728cd , arg=0) at eval.c:1074 #12 0x0000000000572898 in command_loop () at keyboard.c:1086 #13 0x0000000000571e36 in recursive_edit_1 () at keyboard.c:692 #14 0x0000000000572036 in Frecursive_edit () at keyboard.c:763 #15 0x000000000056fde3 in main (argc=2, argv=0x7fffffffe9f8) at emacs.c:1626 From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 10:41:45 2016 Received: (at 24456) by debbugs.gnu.org; 18 Sep 2016 14:41:45 +0000 Received: from localhost ([127.0.0.1]:34452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bldHs-0008J2-E5 for submit@debbugs.gnu.org; Sun, 18 Sep 2016 10:41:45 -0400 Received: from eggs.gnu.org ([208.118.235.92]:51349) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bldHr-0008Io-Ag for 24456@debbugs.gnu.org; Sun, 18 Sep 2016 10:41:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bldHl-0002NL-Ak for 24456@debbugs.gnu.org; Sun, 18 Sep 2016 10:41:38 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:49251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bldHl-0002M5-8L; Sun, 18 Sep 2016 10:41:37 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2923 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bldHj-0001fo-CD; Sun, 18 Sep 2016 10:41:35 -0400 Date: Sun, 18 Sep 2016 17:41:50 +0300 Message-Id: <83k2e9i829.fsf@gnu.org> From: Eli Zaretskii To: Dima Kogan In-reply-to: <87oa3l7ku4.fsf@secretsauce.net> (message from Dima Kogan on Sun, 18 Sep 2016 00:01:23 -0700) Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords References: <87oa3l7ku4.fsf@secretsauce.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.3 (-------) X-Debbugs-Envelope-To: 24456 Cc: 24456@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.3 (-------) > From: Dima Kogan > Date: Sun, 18 Sep 2016 00:01:23 -0700 > > diff --git a/src/keyboard.c b/src/keyboard.c > index b8bc361..a977de5 100644 > --- a/src/keyboard.c > +++ b/src/keyboard.c > @@ -5415,6 +5415,32 @@ make_lispy_event (struct input_event *event) > EMACS_INT c = event->code; > if (event->kind == ASCII_KEYSTROKE_EVENT) > { > + /* Caps-lock shouldn't affect interpretation of key chords: > + Control+s should produce C-s whether caps-lock is on or > + not. And Control+Shift+s should produce C-S-s whether > + caps-lock is on or not. */ > + if (event->modifiers & ~shift_modifier) > + { > + /* this is a key chord: some non-shift modifier is > + depressed */ > + > + if ('A' <= c && c <= 'Z' && > + !(event->modifiers & shift_modifier) ) > + { > + /* Got a capital letter without a shift. The caps > + lock is on. Un-capitalize the letter */ > + c |= (unsigned)('a' - 'A'); > + } > + else if (('a' <= c && c <= 'z') && > + (event->modifiers & shift_modifier) ) > + { > + /* Got a lower-case letter even though shift is > + depressed. The caps lock is on. Capitalize the > + letter */ > + c &= ~(unsigned)('a' - 'A'); > + } > + } > + Doesn't this mean that ASCII keys will behave differently from non-ASCII when Caps Lock is ON? From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 14:25:51 2016 Received: (at 24456) by debbugs.gnu.org; 18 Sep 2016 18:25:51 +0000 Received: from localhost ([127.0.0.1]:34537 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blgmk-0005Fn-QQ for submit@debbugs.gnu.org; Sun, 18 Sep 2016 14:25:51 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:57063) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blgmj-0005Ff-0R for 24456@debbugs.gnu.org; Sun, 18 Sep 2016 14:25:49 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 96B0820815; Sun, 18 Sep 2016 14:25:48 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Sun, 18 Sep 2016 14:25:48 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=DFCF4 v3jscrGMjcKVRJbv6wAaco=; b=bOypX/YsA8ZAuBoutv7aezfD1T0RUvuZNkdwG hCP9PtSbqspEq/ZORk3M1T8FFybg24M7IGJ6hX4JAA/N/oMZhD5NzAECZzQtzJyd 3sH1rt1BlsIvZq76CTSZU6svqq2ATcwlINqXTiWv/xBeoupsbj7kV8WgKc/amiGa 3SRY1k= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=DFCF4v3jscrGMjcKVRJbv6wAaco=; b=liQJu M4aa7kfQG3iFQW7YcSdIgqnYn2sv+kchRYJKsVdpcjJjsMlGTL5ep0KqrRlz+6QZ rhofKFycJQL1c/fJZ3+ZxWWyK/GzBnF98LPKmvo+J28GqywJeypVZUmtL5g2oPwf XhFUzu4DuXEuyOWAwmk0snNAQqEUdfG9XfREKo= X-Sasl-enc: QmujnPV3RFBshehLvu+KfaFY06MherclgFcrWAcO3xTU 1474223148 Received: from shorty.local (50-1-153-216.dsl.dynamic.fusionbroadband.com [50.1.153.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 3CE8CCCEA5; Sun, 18 Sep 2016 14:25:48 -0400 (EDT) Received: from dima by shorty.local with local (Exim 4.87) (envelope-from ) id 1blgmg-0006FD-Os; Sun, 18 Sep 2016 11:25:46 -0700 References: <87oa3l7ku4.fsf@secretsauce.net> <87k2e9z4l9.fsf@users.sourceforge.net> User-agent: mu4e 0.9.17; emacs 25.1.1 From: Dima Kogan To: npostavs@users.sourceforge.net Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords In-reply-to: <87k2e9z4l9.fsf@users.sourceforge.net> Date: Sun, 18 Sep 2016 11:25:46 -0700 Message-ID: <87lgyp6p5h.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 24456 Cc: 24456@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain npostavs@users.sourceforge.net writes: > After applying the patch to emacs-25, I built --with-x-toolkit=lucid and > --enable-checking; I get an assertion violation when hitting C-n with > capslock on. Thanks for testing. I didn't realize that assertions are disabled by default. Fixed patch attached. Eli Zaretskii writes: > Doesn't this mean that ASCII keys will behave differently from > non-ASCII when Caps Lock is ON? If you're talking about characters used in non-English languages, then I really have no idea what the current behavior is, or how to test it. I'm hoping one of yall who actually use these languages will tell me. dima --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Caps-lock-doesn-t-affect-interpretation-of-key-chord.patch >From 66510839464f0efdc625790f3e64091012408dda Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 17 Sep 2016 23:47:48 -0700 Subject: [PATCH] Caps-lock doesn't affect interpretation of key chords * src/keyboard.c (make_lispy_event): when a user pressed key-chords the caps-lock no longer affects the "shift" state of the generated chord. For instance Control+s produces C-s regardless of the caps-lock state. And Control+Shift+s produces C-S-s regardless of the caps-lock state. --- src/keyboard.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/keyboard.c b/src/keyboard.c index b8bc361..cd8413b 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5417,6 +5417,33 @@ make_lispy_event (struct input_event *event) { c &= 0377; eassert (c == event->code); + + /* Caps-lock shouldn't affect interpretation of key chords: + Control+s should produce C-s whether caps-lock is on or + not. And Control+Shift+s should produce C-S-s whether + caps-lock is on or not. */ + if (event->modifiers & ~shift_modifier) + { + /* this is a key chord: some non-shift modifier is + depressed */ + + if ('A' <= c && c <= 'Z' && + !(event->modifiers & shift_modifier) ) + { + /* Got a capital letter without a shift. The caps + lock is on. Un-capitalize the letter */ + c |= (unsigned)('a' - 'A'); + } + else if (('a' <= c && c <= 'z') && + (event->modifiers & shift_modifier) ) + { + /* Got a lower-case letter even though shift is + depressed. The caps lock is on. Capitalize the + letter */ + c &= ~(unsigned)('a' - 'A'); + } + } + /* Turn ASCII characters into control characters when proper. */ if (event->modifiers & ctrl_modifier) -- 2.9.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 14:53:57 2016 Received: (at 24456) by debbugs.gnu.org; 18 Sep 2016 18:53:57 +0000 Received: from localhost ([127.0.0.1]:34542 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blhDx-0005t2-6Z for submit@debbugs.gnu.org; Sun, 18 Sep 2016 14:53:57 -0400 Received: from mail-it0-f44.google.com ([209.85.214.44]:35889) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blhDv-0005sm-2b for 24456@debbugs.gnu.org; Sun, 18 Sep 2016 14:53:55 -0400 Received: by mail-it0-f44.google.com with SMTP id o3so52568685ita.1 for <24456@debbugs.gnu.org>; Sun, 18 Sep 2016 11:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=BrKvE4LbCZTqiiAPF14vgfrNeLjZ43pjfbbmPbJ7h8Y=; b=R5PYkhsQ/pBrBtWD9+hiWr3wEFjxcVD/DKTdwZJm986STL/yTnwe+49kNXscnN+69f gHeyfFxRR0kmzgSPsrHq/F98Qs53w9CGDAGL/Y2Pk4ku7+tP3fpcGpaMt3ecbGnAwd/C lk3APMCJfnLAKmL48Ua/hQZQVUBojjMon16IUMSTK0wxU5zZIzthhcuk6VcA51AxeJsM 6ZVU8HbD6I+lEq65f5++/fnAe03sKnUHhzB6YdGLTftHf8LyS+FVuW0dQmwnUNWoLaGW 9EcCj5zRhELuIVDbuVW5L36/g2aH2Kb53apR306iRoudHW6nOmNwjLRMI605EMgJZfko CvyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=BrKvE4LbCZTqiiAPF14vgfrNeLjZ43pjfbbmPbJ7h8Y=; b=GI6pVgRVf53O/4M3QMHJQRBeUK7NleTZCPtWc1nSpC9R9TdKcAREGmG1g6U+Jf5eLy xT9tql9oi6CYWqoV1VycBOMiubGEbugc87vuW+CPqkLRHcPnxafpXNmuOsL6NX45/Gw2 y4G+wUBhBT+MGxgH7m8qDI3N294TztzjC8S0YCSok6gk6PW8QlADTf+wsscfvj7ZXk40 vMHJv2aTefWT2gbwaew+zIlGZRfDHoyYYJzB0DR1V3kL+5KAdw8fKE6rx2jMMl8824vD XOBandUAxZcw8p5KfG0KoF7ncAzm1AqSohPms/Xhv7RvDTGNZVBi8u4vwRShvWSVoBDE D5lQ== X-Gm-Message-State: AE9vXwM12yzVlh5SE9Y3bN9UKYlJblB3eTlyrqo6fezr6E27HQjYqNvP8AP9VzDZO4jVvg== X-Received: by 10.36.103.131 with SMTP id u125mr7350515itc.68.1474224829601; Sun, 18 Sep 2016 11:53:49 -0700 (PDT) Received: from zony ([45.2.7.130]) by smtp.googlemail.com with ESMTPSA id r123sm8442576ith.1.2016.09.18.11.53.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 18 Sep 2016 11:53:49 -0700 (PDT) From: npostavs@users.sourceforge.net To: Dima Kogan Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords References: <87oa3l7ku4.fsf@secretsauce.net> <87k2e9z4l9.fsf@users.sourceforge.net> <87lgyp6p5h.fsf@secretsauce.net> Date: Sun, 18 Sep 2016 14:54:13 -0400 In-Reply-To: <87lgyp6p5h.fsf@secretsauce.net> (Dima Kogan's message of "Sun, 18 Sep 2016 11:25:46 -0700") Message-ID: <87h99dyr6y.fsf@users.sourceforge.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.2 (/) X-Debbugs-Envelope-To: 24456 Cc: 24456@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.2 (/) Dima Kogan writes: > npostavs@users.sourceforge.net writes: > >> After applying the patch to emacs-25, I built --with-x-toolkit=lucid and >> --enable-checking; I get an assertion violation when hitting C-n with >> capslock on. > > Thanks for testing. I didn't realize that assertions are disabled by > default. Fixed patch attached. New patch works well. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 22:23:48 2016 Received: (at 24456) by debbugs.gnu.org; 19 Sep 2016 02:23:48 +0000 Received: from localhost ([127.0.0.1]:34665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bloFH-0001Ee-Pl for submit@debbugs.gnu.org; Sun, 18 Sep 2016 22:23:47 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49927) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bloFG-0001ES-Jw for 24456@debbugs.gnu.org; Sun, 18 Sep 2016 22:23:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bloF6-0003u3-MD for 24456@debbugs.gnu.org; Sun, 18 Sep 2016 22:23:41 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33434) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bloF6-0003tz-Jq; Sun, 18 Sep 2016 22:23:36 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4877 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bloF5-0005cy-O7; Sun, 18 Sep 2016 22:23:36 -0400 Date: Mon, 19 Sep 2016 05:23:53 +0300 Message-Id: <834m5ciq4m.fsf@gnu.org> From: Eli Zaretskii To: Dima Kogan In-reply-to: <87lgyp6p5h.fsf@secretsauce.net> (message from Dima Kogan on Sun, 18 Sep 2016 11:25:46 -0700) Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords References: <87oa3l7ku4.fsf@secretsauce.net> <87k2e9z4l9.fsf@users.sourceforge.net> <87lgyp6p5h.fsf@secretsauce.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.3 (-------) X-Debbugs-Envelope-To: 24456 Cc: 24456@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.3 (-------) > From: Dima Kogan > Cc: 24456@debbugs.gnu.org, Eli Zaretskii > Date: Sun, 18 Sep 2016 11:25:46 -0700 > > Eli Zaretskii writes: > > > Doesn't this mean that ASCII keys will behave differently from > > non-ASCII when Caps Lock is ON? > > If you're talking about characters used in non-English languages, then I > really have no idea what the current behavior is, or how to test it. I'm > hoping one of yall who actually use these languages will tell me. I don't understand what you mean by that. The effect of Caps Lock on non-ASCII letters is clear: to produce the upper-case variant of the letter. My point is that treating ASCII letters differently from non-ASCII in this regard should not be taken lightly. We should at least discuss whether the results are acceptable. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 19 01:22:14 2016 Received: (at 24456) by debbugs.gnu.org; 19 Sep 2016 05:22:14 +0000 Received: from localhost ([127.0.0.1]:34710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blr1x-0005UB-DX for submit@debbugs.gnu.org; Mon, 19 Sep 2016 01:22:14 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:33203) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1blr1v-0005U4-Ue for 24456@debbugs.gnu.org; Mon, 19 Sep 2016 01:22:12 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 8D61D202C9; Mon, 19 Sep 2016 01:22:11 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Mon, 19 Sep 2016 01:22:11 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=4K2F4 i8aizkrxBAVmNG8gqbeJmQ=; b=pEwDX+Llb5ZA2GPHRVtLwAutKzSxLYebkgprH vn7UKlL5Sw6KXWGrtJ06lGoNTolSe28WmXjFFH4nU3FItkO7sgoaGD+kqpb6YJmK vOnunEYQp+m7KHFJyh1TrHtC2Et6ojfdc6W59w8mc6mNHrplUN41ZkNVoaSO04Bc kaJ5X4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=4K2F4i8aizkrxBAVmNG8gqbeJmQ=; b=tiqxe w4OrqpZn4SjzX74SR9HyWnUBIp4wkEkqoce3nxCpbmRCT/qL6I8mLMMWkryt/QVA OhHJj5VszkDATdcjyfDQRqSpO1jOjjKKtqWDaeVSYDvsprJB2Jy6fqxjT0B9tCFo I8IqMKwp5ZMb+YYGnZw83l2t3+DEVsyBzpJnzw= X-Sasl-enc: fQDJL4o/DTPW3s+AjnUmRKlHbjVWCpwBfjoRYtplk7u6 1474262531 Received: from shorty.local (50-1-153-216.dsl.dynamic.fusionbroadband.com [50.1.153.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 34E63CCE8B; Mon, 19 Sep 2016 01:22:11 -0400 (EDT) Received: from dima by shorty.local with local (Exim 4.87) (envelope-from ) id 1blr1t-0000wV-O7; Sun, 18 Sep 2016 22:22:09 -0700 References: <87oa3l7ku4.fsf@secretsauce.net> <87k2e9z4l9.fsf@users.sourceforge.net> <87lgyp6p5h.fsf@secretsauce.net> <834m5ciq4m.fsf@gnu.org> User-agent: mu4e 0.9.17; emacs 25.1.1 From: Dima Kogan To: Eli Zaretskii Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords In-reply-to: <834m5ciq4m.fsf@gnu.org> Date: Sun, 18 Sep 2016 22:22:09 -0700 Message-ID: <87k2e879by.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 24456 Cc: 24456@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii writes: >> If you're talking about characters used in non-English languages, then I >> really have no idea what the current behavior is, or how to test it. I'm >> hoping one of yall who actually use these languages will tell me. > > I don't understand what you mean by that. The effect of Caps Lock on > non-ASCII letters is clear: to produce the upper-case variant of the > letter. > > My point is that treating ASCII letters differently from non-ASCII in > this regard should not be taken lightly. We should at least discuss > whether the results are acceptable. I just meant that as someone who uses English almost exclusively, I don't ordinarily encounter wide chars and unicode, and I don't know how they apply here. The hope was that somebody who IS familiar with non-English keyboards would point out the shortcomings, and would know how to address them. Eli, do you know how caps-lock works on foreign keyboards? From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 19 12:43:29 2016 Received: (at 24456) by debbugs.gnu.org; 19 Sep 2016 16:43:29 +0000 Received: from localhost ([127.0.0.1]:35301 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bm1fE-000746-St for submit@debbugs.gnu.org; Mon, 19 Sep 2016 12:43:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:49156) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bm1fD-00073s-P1 for 24456@debbugs.gnu.org; Mon, 19 Sep 2016 12:43:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bm1f4-0000QL-2s for 24456@debbugs.gnu.org; Mon, 19 Sep 2016 12:43:22 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48354) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bm1f3-0000QG-VQ; Mon, 19 Sep 2016 12:43:17 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1325 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bm1f2-0005jE-O0; Mon, 19 Sep 2016 12:43:17 -0400 Date: Mon, 19 Sep 2016 19:43:25 +0300 Message-Id: <83shsvhmc2.fsf@gnu.org> From: Eli Zaretskii To: Dima Kogan In-reply-to: <87k2e879by.fsf@secretsauce.net> (message from Dima Kogan on Sun, 18 Sep 2016 22:22:09 -0700) Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords References: <87oa3l7ku4.fsf@secretsauce.net> <87k2e9z4l9.fsf@users.sourceforge.net> <87lgyp6p5h.fsf@secretsauce.net> <834m5ciq4m.fsf@gnu.org> <87k2e879by.fsf@secretsauce.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.1 (--------) X-Debbugs-Envelope-To: 24456 Cc: 24456@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.1 (--------) > From: Dima Kogan > Cc: npostavs@users.sourceforge.net, 24456@debbugs.gnu.org > Date: Sun, 18 Sep 2016 22:22:09 -0700 > > Eli, do you know how caps-lock works on foreign keyboards? They capitalize letters, AFAIK. Of course, the effect also depends on the OS and the application that receives the keys. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 19 14:15:40 2016 Received: (at 24456) by debbugs.gnu.org; 19 Sep 2016 18:15:40 +0000 Received: from localhost ([127.0.0.1]:35331 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bm36S-0000jd-C3 for submit@debbugs.gnu.org; Mon, 19 Sep 2016 14:15:40 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:42393) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bm36Q-0000jW-TX for 24456@debbugs.gnu.org; Mon, 19 Sep 2016 14:15:39 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 722A120597; Mon, 19 Sep 2016 14:15:38 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Mon, 19 Sep 2016 14:15:38 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-sasl-enc:x-sasl-enc; s=mesmtp; bh=h+gl6X+AfHVbyzM5IYnmdHuRLek =; b=UmZbAoLQJCnItMYNevmjD/MWt5SnkdMkt4em7IwIK/kih4vEVcMxOz+jrGV ls0iBiA+k48ZO6jssKc24U77PEAVLVXYRL/uT3frmJzmBGnu1y448fmZFJ+96dfy vScH/CwNLuwU7mj6JC0TVhMON4huh8JTnPV2G9Zzzx+Nna2w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=h+gl6X+AfHVbyzM 5IYnmdHuRLek=; b=qnnKp9i95eJ0QlEgeCD5180VWkHQjC1jlocgc60tnK9cYr/ haRRlTA3CCXO1216gmnsZZSz4FAK1HE+XX5ylX+lB+EMAJWyp8Tc+a1iTSV0di7G aL0gtwhtuQVaazG0TtNDX4CaHlMy+w8BufWRSFu1QgVy8Hh2UgskVMUVWick= X-Sasl-enc: 8qFGNFGy+Q5inTeeat8M7XIjCSgQuNjpG+7U4bZDrwPp 1474308938 Received: from shorty.local (unknown [128.149.110.210]) by mail.messagingengine.com (Postfix) with ESMTPA id 1DC57CCEA8; Mon, 19 Sep 2016 14:15:38 -0400 (EDT) Received: from dima by shorty.local with local (Exim 4.87) (envelope-from ) id 1bm36P-0005cQ-0t; Mon, 19 Sep 2016 11:15:37 -0700 References: <87oa3l7ku4.fsf@secretsauce.net> <87k2e9z4l9.fsf@users.sourceforge.net> <87lgyp6p5h.fsf@secretsauce.net> <834m5ciq4m.fsf@gnu.org> <87k2e879by.fsf@secretsauce.net> <83shsvhmc2.fsf@gnu.org> User-agent: mu4e 0.9.17; emacs 25.1.1 From: Dima Kogan To: Eli Zaretskii Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords In-reply-to: <83shsvhmc2.fsf@gnu.org> Date: Mon, 19 Sep 2016 11:15:37 -0700 Message-ID: <87fuov7o3a.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 24456 Cc: 24456@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii writes: >> From: Dima Kogan >> Cc: npostavs@users.sourceforge.net, 24456@debbugs.gnu.org >> Date: Sun, 18 Sep 2016 22:22:09 -0700 >> >> Eli, do you know how caps-lock works on foreign keyboards? > > They capitalize letters, AFAIK. Of course, the effect also depends on > the OS and the application that receives the keys. OK. So how do we test this? The current patch fixes the ASCII case and has no effect on the non-ASCII case. Maybe this is OK, actually, since the only potentially broken remaining cases are with people binding things like C-ó. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 19 14:50:52 2016 Received: (at 24456) by debbugs.gnu.org; 19 Sep 2016 18:50:52 +0000 Received: from localhost ([127.0.0.1]:35348 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bm3eW-0001ZT-F6 for submit@debbugs.gnu.org; Mon, 19 Sep 2016 14:50:52 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58229) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bm3eU-0001ZE-Rx for 24456@debbugs.gnu.org; Mon, 19 Sep 2016 14:50:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bm3eL-0006pZ-Os for 24456@debbugs.gnu.org; Mon, 19 Sep 2016 14:50:45 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:50612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bm3eL-0006pG-Gb; Mon, 19 Sep 2016 14:50:41 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1460 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bm3eH-0004VF-Hq; Mon, 19 Sep 2016 14:50:40 -0400 Date: Mon, 19 Sep 2016 21:50:38 +0300 Message-Id: <83lgynhgg1.fsf@gnu.org> From: Eli Zaretskii To: Dima Kogan In-reply-to: <87fuov7o3a.fsf@secretsauce.net> (message from Dima Kogan on Mon, 19 Sep 2016 11:15:37 -0700) Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords References: <87oa3l7ku4.fsf@secretsauce.net> <87k2e9z4l9.fsf@users.sourceforge.net> <87lgyp6p5h.fsf@secretsauce.net> <834m5ciq4m.fsf@gnu.org> <87k2e879by.fsf@secretsauce.net> <83shsvhmc2.fsf@gnu.org> <87fuov7o3a.fsf@secretsauce.net> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.1 (--------) X-Debbugs-Envelope-To: 24456 Cc: 24456@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.1 (--------) > From: Dima Kogan > Cc: npostavs@users.sourceforge.net, 24456@debbugs.gnu.org > Date: Mon, 19 Sep 2016 11:15:37 -0700 > > The current patch fixes the ASCII case and has no effect on the > non-ASCII case. Maybe this is OK, actually, since the only > potentially broken remaining cases are with people binding things > like C-ó. The likes of C-ó and M-ó is precisely what I'm worried about. I don't think it's right to support only ASCII letters in this use case. We should support the non-ASCII letters as well. What exactly requires testing for ASCII lower-case letters in your patch? Why only ASCII? From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 19 16:29:00 2016 Received: (at 24456) by debbugs.gnu.org; 19 Sep 2016 20:29:00 +0000 Received: from localhost ([127.0.0.1]:57557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bm5BU-0002cg-E0 for submit@debbugs.gnu.org; Mon, 19 Sep 2016 16:29:00 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:35126) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bm5BS-0002cY-AL for 24456@debbugs.gnu.org; Mon, 19 Sep 2016 16:28:58 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id BE19420599; Mon, 19 Sep 2016 16:28:57 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Mon, 19 Sep 2016 16:28:57 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=A50+E zBvKOthxxrueKWJk8T3iBE=; b=p9zMHVVT4vjWlDI+rNueIAndQK+nl6Of9PEKg G8y/VRIiXlZf50TY1zO2lPIS2xwIiGP4GdqTc14FTAAhtu4NDZvUMieess+wPvNz RhQ58exZN1h9D6ityayMfI9bp9PpQwVFSwq8mu43CiKjSKYg4LJnv2FmhURnHjfy DzEz4w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=A50+EzBvKOthxxrueKWJk8T3iBE=; b=ZmBQq f38hbGOx/y/uKFb658AkFDhhemmNi2RIlXe7a1q2xrFHPFThNq5cO6SJAQ6QPO1s BiDJWxU2BkBPeCM4CEWagCeGC3tYBDiSEjac3cpSoWw5AwWJJTSgtnePDCR/mu+p PA/c/SLeB2u9afL95r5zi7WgOJ4xhf/tixenLg= X-Sasl-enc: trm+5djMmGoKg2NiA0P3+yHxKbS5V1ISZIrnmlXno3Dd 1474316937 Received: from shorty.local (unknown [128.149.110.210]) by mail.messagingengine.com (Postfix) with ESMTPA id 6A7D4F29CC; Mon, 19 Sep 2016 16:28:57 -0400 (EDT) Received: from dima by shorty.local with local (Exim 4.87) (envelope-from ) id 1bm5BQ-0007KA-3m; Mon, 19 Sep 2016 13:28:56 -0700 References: <87oa3l7ku4.fsf@secretsauce.net> <87k2e9z4l9.fsf@users.sourceforge.net> <87lgyp6p5h.fsf@secretsauce.net> <834m5ciq4m.fsf@gnu.org> <87k2e879by.fsf@secretsauce.net> <83shsvhmc2.fsf@gnu.org> <87fuov7o3a.fsf@secretsauce.net> <83lgynhgg1.fsf@gnu.org> User-agent: mu4e 0.9.17; emacs 25.1.1 From: Dima Kogan To: Eli Zaretskii Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords In-reply-to: <83lgynhgg1.fsf@gnu.org> Date: Mon, 19 Sep 2016 13:28:56 -0700 Message-ID: <87d1jz7hx3.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 24456 Cc: 24456@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Eli Zaretskii writes: > What exactly requires testing for ASCII lower-case letters in your > patch? Why only ASCII? I'm trying to detect the caps-lock by finding capital letters that were produced without Shift (and vice versa). I can do something like !shift_pressed && isupper(c) but that doesn't work with wide characters. There's iswupper(c). Are the wide chars it takes the same ones we get in that function? How about non-latin scripts? Fundamentally I'm the worst person to be testing this, sadly. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 21 10:56:46 2016 Received: (at 24456) by debbugs.gnu.org; 21 Sep 2016 14:56:46 +0000 Received: from localhost ([127.0.0.1]:59693 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bmix4-0001Yh-EK for submit@debbugs.gnu.org; Wed, 21 Sep 2016 10:56:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42170) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bmix2-0001YU-Mw for 24456@debbugs.gnu.org; Wed, 21 Sep 2016 10:56:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bmiwr-0001hG-2F for 24456@debbugs.gnu.org; Wed, 21 Sep 2016 10:56:36 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37991) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bmiwq-0001gi-Vc; Wed, 21 Sep 2016 10:56:32 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3648 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bmiwl-0008Im-RC; Wed, 21 Sep 2016 10:56:29 -0400 Date: Wed, 21 Sep 2016 17:56:51 +0300 Message-Id: <83mvj1fgi4.fsf@gnu.org> From: Eli Zaretskii To: Dima Kogan In-reply-to: <87d1jz7hx3.fsf@secretsauce.net> (message from Dima Kogan on Mon, 19 Sep 2016 13:28:56 -0700) Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords References: <87oa3l7ku4.fsf@secretsauce.net> <87k2e9z4l9.fsf@users.sourceforge.net> <87lgyp6p5h.fsf@secretsauce.net> <834m5ciq4m.fsf@gnu.org> <87k2e879by.fsf@secretsauce.net> <83shsvhmc2.fsf@gnu.org> <87fuov7o3a.fsf@secretsauce.net> <83lgynhgg1.fsf@gnu.org> <87d1jz7hx3.fsf@secretsauce.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.1 (--------) X-Debbugs-Envelope-To: 24456 Cc: 24456@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.1 (--------) > From: Dima Kogan > Cc: npostavs@users.sourceforge.net, 24456@debbugs.gnu.org > Date: Mon, 19 Sep 2016 13:28:56 -0700 > > Eli Zaretskii writes: > > > What exactly requires testing for ASCII lower-case letters in your > > patch? Why only ASCII? > > I'm trying to detect the caps-lock by finding capital letters that were > produced without Shift (and vice versa). I can do something like > > !shift_pressed && isupper(c) > > but that doesn't work with wide characters. There's iswupper(c). Are the > wide chars it takes the same ones we get in that function? How about > non-latin scripts? We already have an inline function 'uppercasep', which you could use; it supports any character that Emacs supports. > Fundamentally I'm the worst person to be testing this, sadly. Once the code is written, we can ask people to test it in different locales, I don't expect problems in this area. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 21 19:30:26 2016 Received: (at 24456) by debbugs.gnu.org; 21 Sep 2016 23:30:26 +0000 Received: from localhost ([127.0.0.1]:60046 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bmqyA-0002TL-Au for submit@debbugs.gnu.org; Wed, 21 Sep 2016 19:30:26 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:38448) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bmqy8-0002TD-IK for 24456@debbugs.gnu.org; Wed, 21 Sep 2016 19:30:25 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 1F28D20675; Wed, 21 Sep 2016 19:30:24 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Wed, 21 Sep 2016 19:30:24 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=1SG4L /Pp2WIsQ4NQd1TVtJm7Xo4=; b=Gocl8XSb8TQhSG5AzVUGr7HU486HPe8SULyxH ctsSAGpAjcWP1tf9OCPuP02srjYxfbbf54OcGXA9u4iDOqYieGwZ39RbyD03+GXO f0Y684GoPodQPWOIbDDK8pgDTK+BGqwzUz3KAkwBGkFXpBDRw2yGopuusu8/N9BK M1GdYw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=1SG4L/Pp2WIsQ4NQd1TVtJm7Xo4=; b=j2DJR oKgHB81k/WReX+q2QijyAgfdrMHyQYlcCg6h/WmlhUWimxfYXcpnX5WWyVdMdnnB O31XedbztrKrJ2sMMY+aIS7+IL8JpOS7OLPMFzV/znxqeieBj+uvbXIHricNMW98 oNk9yZU+zLHQvGiLU1mHq37BnfWv+0JaqPQfIY= X-Sasl-enc: olWSBbFrQh5I6Sl8s8AXUls/NBYILa8AjxOsmq8zsHxK 1474500623 Received: from shorty.local (unknown [128.149.110.210]) by mail.messagingengine.com (Postfix) with ESMTPA id C8118CCE8B; Wed, 21 Sep 2016 19:30:23 -0400 (EDT) Received: from dima by shorty.local with local (Exim 4.87) (envelope-from ) id 1bmqy5-0006GU-Db; Wed, 21 Sep 2016 16:30:21 -0700 References: <87oa3l7ku4.fsf@secretsauce.net> <87k2e9z4l9.fsf@users.sourceforge.net> <87lgyp6p5h.fsf@secretsauce.net> <834m5ciq4m.fsf@gnu.org> <87k2e879by.fsf@secretsauce.net> <83shsvhmc2.fsf@gnu.org> <87fuov7o3a.fsf@secretsauce.net> <83lgynhgg1.fsf@gnu.org> <87d1jz7hx3.fsf@secretsauce.net> <83mvj1fgi4.fsf@gnu.org> User-agent: mu4e 0.9.17; emacs 25.1.1 From: Dima Kogan To: Eli Zaretskii Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords In-reply-to: <83mvj1fgi4.fsf@gnu.org> Date: Wed, 21 Sep 2016 16:30:21 -0700 Message-ID: <8737ks7rw2.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 24456 Cc: 24456@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > We already have an inline function 'uppercasep', which you could use; > it supports any character that Emacs supports. OK. In that case, how about the attached patch? Tested working on gtk. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Caps-lock-doesn-t-affect-interpretation-of-key-chord.patch >From 2b81504e1f34fed36c5ec1ee95dbceaf8df9d321 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 17 Sep 2016 23:47:48 -0700 Subject: [PATCH] Caps-lock doesn't affect interpretation of key chords * src/keyboard.c (make_lispy_event): when a user pressed key-chords the caps-lock no longer affects the "shift" state of the generated chord. For instance Control+s produces C-s regardless of the caps-lock state. And Control+Shift+s produces C-S-s regardless of the caps-lock state. --- src/keyboard.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/keyboard.c b/src/keyboard.c index b8bc361..ed0d9db 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5417,6 +5417,33 @@ make_lispy_event (struct input_event *event) { c &= 0377; eassert (c == event->code); + + /* Caps-lock shouldn't affect interpretation of key chords: + Control+s should produce C-s whether caps-lock is on or + not. And Control+Shift+s should produce C-S-s whether + caps-lock is on or not. */ + if (event->modifiers & ~shift_modifier) + { + /* this is a key chord: some non-shift modifier is + depressed */ + + if (uppercasep(c) && + !(event->modifiers & shift_modifier) ) + { + /* Got a capital letter without a shift. The caps + lock is on. Un-capitalize the letter */ + c = downcase(c); + } + else if (lowercasep(c) && + (event->modifiers & shift_modifier) ) + { + /* Got a lower-case letter even though shift is + depressed. The caps lock is on. Capitalize the + letter */ + c = upcase(c); + } + } + /* Turn ASCII characters into control characters when proper. */ if (event->modifiers & ctrl_modifier) -- 2.9.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 22 11:22:43 2016 Received: (at 24456) by debbugs.gnu.org; 22 Sep 2016 15:22:43 +0000 Received: from localhost ([127.0.0.1]:60792 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bn5pj-000217-0Q for submit@debbugs.gnu.org; Thu, 22 Sep 2016 11:22:43 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36171) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bn5ph-00020u-Nz for 24456@debbugs.gnu.org; Thu, 22 Sep 2016 11:22:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bn5pZ-0000lx-Dy for 24456@debbugs.gnu.org; Thu, 22 Sep 2016 11:22:36 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_05,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:58127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bn5pZ-0000l6-BL; Thu, 22 Sep 2016 11:22:33 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1483 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bn5pX-0004bz-4L; Thu, 22 Sep 2016 11:22:31 -0400 Date: Thu, 22 Sep 2016 18:22:55 +0300 Message-Id: <83oa3gdkmo.fsf@gnu.org> From: Eli Zaretskii To: Dima Kogan In-reply-to: <8737ks7rw2.fsf@secretsauce.net> (message from Dima Kogan on Wed, 21 Sep 2016 16:30:21 -0700) Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords References: <87oa3l7ku4.fsf@secretsauce.net> <87k2e9z4l9.fsf@users.sourceforge.net> <87lgyp6p5h.fsf@secretsauce.net> <834m5ciq4m.fsf@gnu.org> <87k2e879by.fsf@secretsauce.net> <83shsvhmc2.fsf@gnu.org> <87fuov7o3a.fsf@secretsauce.net> <83lgynhgg1.fsf@gnu.org> <87d1jz7hx3.fsf@secretsauce.net> <83mvj1fgi4.fsf@gnu.org> <8737ks7rw2.fsf@secretsauce.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.1 (--------) X-Debbugs-Envelope-To: 24456 Cc: 24456@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.1 (--------) > From: Dima Kogan > Cc: npostavs@users.sourceforge.net, 24456@debbugs.gnu.org > Date: Wed, 21 Sep 2016 16:30:21 -0700 > > > We already have an inline function 'uppercasep', which you could use; > > it supports any character that Emacs supports. > > OK. In that case, how about the attached patch? Tested working on gtk. Thanks. However, this doesn't look right to me: your code is entirely inside the following condition: if (event->kind == ASCII_KEYSTROKE_EVENT) So it will not do anything for non-ASCII keystrokes. You should move the code out of that condition, I think. > + if (uppercasep(c) && > + !(event->modifiers & shift_modifier) ) A nit: our coding standards request a space between the function name and the opening parenthesis that follows it, and no spaces between closing parentheses. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 25 14:44:28 2016 Received: (at 24456) by debbugs.gnu.org; 25 Sep 2016 18:44:28 +0000 Received: from localhost ([127.0.0.1]:35775 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1boEPc-0000CG-0Y for submit@debbugs.gnu.org; Sun, 25 Sep 2016 14:44:28 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:37561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1boEPa-0000C8-Gk for 24456@debbugs.gnu.org; Sun, 25 Sep 2016 14:44:26 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id CB63F206B4; Sun, 25 Sep 2016 14:44:25 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Sun, 25 Sep 2016 14:44:25 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=Nx5+g Qb3qrk06PGF/tfuW5YGmnU=; b=dMPD4gwJVmAjqZr9yg07X9CC657ho6OXytpyj xdeylIfv0424ECzJmoBj6rj5suOtAfzj2DJXbN/VKJ3Eyp58CQmuajHnDOvTOy52 A+p5Af+f/ry00l7++WkoY2lJZA9J2xdxkcPgstYheU3a4K8HfR5Tx5vDRXXsr6gH 8jxQn0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=Nx5+gQb3qrk06PGF/tfuW5YGmnU=; b=CAAsP Xf/IskEcJyKlgCaVhDrxs+PjWzq863Fppi14Bzj1F1BEGQtLKZ+cZ9Lr1x82NXpQ ZeXT3AqCJIXLrQz6i2i7K2IAWEL4s/jMswvdoDgp3qpxtpNyVNLm2OxPdu2P4brK uL+d1KuiYwBNWDTCZn5MAU/zU6Xa8uF1PKbHXw= X-Sasl-enc: IqrFkAOOETohfTFmUQ+nqNC9xnVHjAvFGcjCnCXjgLpe 1474829065 Received: from shorty.local (50-1-153-216.dsl.dynamic.fusionbroadband.com [50.1.153.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 5A0BFCCE88; Sun, 25 Sep 2016 14:44:25 -0400 (EDT) Received: from dima by shorty.local with local (Exim 4.87) (envelope-from ) id 1boEPX-0006OA-Mx; Sun, 25 Sep 2016 11:44:23 -0700 References: <87oa3l7ku4.fsf@secretsauce.net> <87k2e9z4l9.fsf@users.sourceforge.net> <87lgyp6p5h.fsf@secretsauce.net> <834m5ciq4m.fsf@gnu.org> <87k2e879by.fsf@secretsauce.net> <83shsvhmc2.fsf@gnu.org> <87fuov7o3a.fsf@secretsauce.net> <83lgynhgg1.fsf@gnu.org> <87d1jz7hx3.fsf@secretsauce.net> <83mvj1fgi4.fsf@gnu.org> <8737ks7rw2.fsf@secretsauce.net> <83oa3gdkmo.fsf@gnu.org> User-agent: mu4e 0.9.17; emacs 25.1.50.1 From: Dima Kogan To: Eli Zaretskii Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords In-reply-to: <83oa3gdkmo.fsf@gnu.org> Date: Sun, 25 Sep 2016 11:44:23 -0700 Message-ID: <87shsnddko.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 24456 Cc: 24456@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain Eli Zaretskii writes: > Thanks. However, this doesn't look right to me: your code is entirely > inside the following condition: > > if (event->kind == ASCII_KEYSTROKE_EVENT) > > So it will not do anything for non-ASCII keystrokes. You should move > the code out of that condition, I think. > >> + if (uppercasep(c) && >> + !(event->modifiers & shift_modifier) ) > > A nit: our coding standards request a space between the function name > and the opening parenthesis that follows it, and no spaces between > closing parentheses. OK. How about this? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Caps-lock-doesn-t-affect-interpretation-of-key-chord.patch >From e3a0375ea66a746a6a02e94f85ef71bf7fe9db5d Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 17 Sep 2016 23:47:48 -0700 Subject: [PATCH] Caps-lock doesn't affect interpretation of key chords * src/keyboard.c (make_lispy_event): when a user pressed key-chords the caps-lock no longer affects the "shift" state of the generated chord. For instance Control+s produces C-s regardless of the caps-lock state. And Control+Shift+s produces C-S-s regardless of the caps-lock state. --- src/keyboard.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/keyboard.c b/src/keyboard.c index b8bc361..e8a199d 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5417,6 +5417,37 @@ make_lispy_event (struct input_event *event) { c &= 0377; eassert (c == event->code); + } + + + /* Caps-lock shouldn't affect interpretation of key chords: + Control+s should produce C-s whether caps-lock is on or + not. And Control+Shift+s should produce C-S-s whether + caps-lock is on or not. */ + if (event->modifiers & ~shift_modifier) + { + /* this is a key chord: some non-shift modifier is + depressed */ + + if (uppercasep (c) && + !(event->modifiers & shift_modifier)) + { + /* Got a capital letter without a shift. The caps + lock is on. Un-capitalize the letter */ + c = downcase(c); + } + else if (lowercasep (c) && + (event->modifiers & shift_modifier)) + { + /* Got a lower-case letter even though shift is + depressed. The caps lock is on. Capitalize the + letter */ + c = upcase(c); + } + } + + if (event->kind == ASCII_KEYSTROKE_EVENT) + { /* Turn ASCII characters into control characters when proper. */ if (event->modifiers & ctrl_modifier) -- 2.9.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 01 04:28:10 2016 Received: (at 24456) by debbugs.gnu.org; 1 Oct 2016 08:28:10 +0000 Received: from localhost ([127.0.0.1]:40230 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bqFeT-0000TT-TJ for submit@debbugs.gnu.org; Sat, 01 Oct 2016 04:28:10 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40769) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bqFeS-0000TF-Gv for 24456@debbugs.gnu.org; Sat, 01 Oct 2016 04:28:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bqFeM-00041I-EM for 24456@debbugs.gnu.org; Sat, 01 Oct 2016 04:28:03 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_20,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:33015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqFeM-00041B-B5; Sat, 01 Oct 2016 04:28:02 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1535 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bqFeJ-0004rA-67; Sat, 01 Oct 2016 04:27:59 -0400 Date: Sat, 01 Oct 2016 11:28:07 +0300 Message-Id: <83zimolbhk.fsf@gnu.org> From: Eli Zaretskii To: Dima Kogan In-reply-to: <87shsnddko.fsf@secretsauce.net> (message from Dima Kogan on Sun, 25 Sep 2016 11:44:23 -0700) Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords References: <87oa3l7ku4.fsf@secretsauce.net> <87k2e9z4l9.fsf@users.sourceforge.net> <87lgyp6p5h.fsf@secretsauce.net> <834m5ciq4m.fsf@gnu.org> <87k2e879by.fsf@secretsauce.net> <83shsvhmc2.fsf@gnu.org> <87fuov7o3a.fsf@secretsauce.net> <83lgynhgg1.fsf@gnu.org> <87d1jz7hx3.fsf@secretsauce.net> <83mvj1fgi4.fsf@gnu.org> <8737ks7rw2.fsf@secretsauce.net> <83oa3gdkmo.fsf@gnu.org> <87shsnddko.fsf@secretsauce.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.0 (--------) X-Debbugs-Envelope-To: 24456 Cc: 24456@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.0 (--------) > From: Dima Kogan > Cc: npostavs@users.sourceforge.net, 24456@debbugs.gnu.org > Date: Sun, 25 Sep 2016 11:44:23 -0700 > > > Thanks. However, this doesn't look right to me: your code is entirely > > inside the following condition: > > > > if (event->kind == ASCII_KEYSTROKE_EVENT) > > > > So it will not do anything for non-ASCII keystrokes. You should move > > the code out of that condition, I think. > > > >> + if (uppercasep(c) && > >> + !(event->modifiers & shift_modifier) ) > > > > A nit: our coding standards request a space between the function name > > and the opening parenthesis that follows it, and no spaces between > > closing parentheses. > > OK. How about this? Looks okay, but you still didn't leave a space before the opening parentheses and the function name. Did you try this with a non-ASCII key (assuming you have one on your keyboard)? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 01 04:37:23 2016 Received: (at 24456) by debbugs.gnu.org; 1 Oct 2016 08:37:23 +0000 Received: from localhost ([127.0.0.1]:40234 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bqFnO-0000hl-QV for submit@debbugs.gnu.org; Sat, 01 Oct 2016 04:37:23 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:51454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bqFnN-0000hd-2f for 24456@debbugs.gnu.org; Sat, 01 Oct 2016 04:37:21 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3smMB75t1Hz3hjkw; Sat, 1 Oct 2016 10:37:19 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.68]) by mail.m-online.net (Postfix) with ESMTP id 3smMB74N7Hzvl1r; Sat, 1 Oct 2016 10:37:19 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.68]) (amavisd-new, port 10024) with ESMTP id OEzOb5MKzUQ0; Sat, 1 Oct 2016 10:37:18 +0200 (CEST) X-Auth-Info: FWEpWa8onuwarQHfhNpCpUeF4cOhaXLnvTeLdW5ft2yrpHycx9FyiCWmdCXI1oWr Received: from linux.local (ppp-88-217-15-174.dynamic.mnet-online.de [88.217.15.174]) by mail.mnet-online.de (Postfix) with ESMTPA; Sat, 1 Oct 2016 10:37:18 +0200 (CEST) Received: by linux.local (Postfix, from userid 501) id 182CC1E55F7; Sat, 1 Oct 2016 10:37:17 +0200 (CEST) From: Andreas Schwab To: Dima Kogan Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords References: <87oa3l7ku4.fsf@secretsauce.net> <87k2e9z4l9.fsf@users.sourceforge.net> <87lgyp6p5h.fsf@secretsauce.net> <834m5ciq4m.fsf@gnu.org> <87k2e879by.fsf@secretsauce.net> <83shsvhmc2.fsf@gnu.org> <87fuov7o3a.fsf@secretsauce.net> <83lgynhgg1.fsf@gnu.org> <87d1jz7hx3.fsf@secretsauce.net> <83mvj1fgi4.fsf@gnu.org> <8737ks7rw2.fsf@secretsauce.net> <83oa3gdkmo.fsf@gnu.org> <87shsnddko.fsf@secretsauce.net> X-Yow: BARRY.. That was the most HEART-WARMING rendition of ``I DID IT MY WAY'' I've ever heard!! Date: Sat, 01 Oct 2016 10:37:17 +0200 In-Reply-To: <87shsnddko.fsf@secretsauce.net> (Dima Kogan's message of "Sun, 25 Sep 2016 11:44:23 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 24456 Cc: 24456@debbugs.gnu.org, Eli Zaretskii , npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Sep 25 2016, Dima Kogan wrote: > + if (uppercasep (c) && Line break before operator, not after. Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 01 11:12:32 2016 Received: (at 24456) by debbugs.gnu.org; 1 Oct 2016 15:12:33 +0000 Received: from localhost ([127.0.0.1]:41241 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bqLxo-0005R4-MQ for submit@debbugs.gnu.org; Sat, 01 Oct 2016 11:12:32 -0400 Received: from out3-smtp.messagingengine.com ([66.111.4.27]:45791) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bqLxm-0005Qw-F1 for 24456@debbugs.gnu.org; Sat, 01 Oct 2016 11:12:31 -0400 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id CF92C20822; Sat, 1 Oct 2016 11:12:29 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Sat, 01 Oct 2016 11:12:29 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=secretsauce.net; h=cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=V1uEo qOC2XPAfZctWItavfkmJ98=; b=EBvk0j+AYPUMTmgOmktlafmBQxNtPJudKhg6X E+gFonfcpT+cZhsltih4bPsq/PRGq548L/j5umIkqxBVkdkkR7e94pnmnSmLzAyF YVxQLmW+cSkD0FxeX8Gcrw7peOmeq3xQpuHTTcaH3XA1oD8J1I0+Yof0bJwkSbNR FQ9C2g= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=V1uEoqOC2XPAfZctWItavfkmJ98=; b=rVwtR BOmCMdMdugHV92PRC1TthzP6c+3LBun0iIDGPsm8MsKaIbt/As1+xGuOm3/IfBoO wDRss0HLy4N26mMBQHWlWP2SjzduA3lBYxQCuTxkbbz9RqHQRx9B9UULAvjvZsPo CCKx9NtEp4KeHAcrKEJIC98ZMajVQJAvUUVAdM= X-Sasl-enc: tJ6o1rrNPY7rr0QVCigQMeWUpkOnZmTQREgHXO+KKUBO 1475334749 Received: from scrawny (50-1-153-216.dsl.dynamic.fusionbroadband.com [50.1.153.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 77FF7F2985; Sat, 1 Oct 2016 11:12:29 -0400 (EDT) Received: from [::1] (helo=scrawny) by scrawny with esmtp (Exim 4.87) (envelope-from ) id 1bqLxk-0003dh-7E; Sat, 01 Oct 2016 08:12:28 -0700 References: <87oa3l7ku4.fsf@secretsauce.net> <87k2e9z4l9.fsf@users.sourceforge.net> <87lgyp6p5h.fsf@secretsauce.net> <834m5ciq4m.fsf@gnu.org> <87k2e879by.fsf@secretsauce.net> <83shsvhmc2.fsf@gnu.org> <87fuov7o3a.fsf@secretsauce.net> <83lgynhgg1.fsf@gnu.org> <87d1jz7hx3.fsf@secretsauce.net> <83mvj1fgi4.fsf@gnu.org> <8737ks7rw2.fsf@secretsauce.net> <83oa3gdkmo.fsf@gnu.org> <87shsnddko.fsf@secretsauce.net> <83zimolbhk.fsf@gnu.org> User-agent: mu4e 0.9.17; emacs 25.1.1 From: Dima Kogan To: Eli Zaretskii Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords In-reply-to: <83zimolbhk.fsf@gnu.org> Date: Sat, 01 Oct 2016 08:12:27 -0700 Message-ID: <87k2dsxfvo.fsf@secretsauce.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 24456 Cc: 24456@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) --=-=-= Content-Type: text/plain Andreas Schwab writes: > Line break before operator, not after. Eli Zaretskii writes: > Looks okay, but you still didn't leave a space before the opening > parentheses and the function name. Attached. Is there a tool to automatically detect/fix these? > Did you try this with a non-ASCII key (assuming you have one on your > keyboard)? I did not try. I live in the US, and pretty much never see keyboards with anything non-trivial on them. If somebody else would test it, that would be great. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Caps-lock-doesn-t-affect-interpretation-of-key-chord.patch >From 9b12fff089dd3a4eb99373e92c635c20cebd0198 Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Sat, 17 Sep 2016 23:47:48 -0700 Subject: [PATCH] Caps-lock doesn't affect interpretation of key chords * src/keyboard.c (make_lispy_event): when a user pressed key-chords the caps-lock no longer affects the "shift" state of the generated chord. For instance Control+s produces C-s regardless of the caps-lock state. And Control+Shift+s produces C-S-s regardless of the caps-lock state. --- src/keyboard.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/keyboard.c b/src/keyboard.c index ccd3405..cdeea8e 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -5368,6 +5368,37 @@ make_lispy_event (struct input_event *event) { c &= 0377; eassert (c == event->code); + } + + + /* Caps-lock shouldn't affect interpretation of key chords: + Control+s should produce C-s whether caps-lock is on or + not. And Control+Shift+s should produce C-S-s whether + caps-lock is on or not. */ + if (event->modifiers & ~shift_modifier) + { + /* this is a key chord: some non-shift modifier is + depressed */ + + if (uppercasep (c) + && !(event->modifiers & shift_modifier)) + { + /* Got a capital letter without a shift. The caps + lock is on. Un-capitalize the letter */ + c = downcase (c); + } + else if (lowercasep (c) + && (event->modifiers & shift_modifier)) + { + /* Got a lower-case letter even though shift is + depressed. The caps lock is on. Capitalize the + letter */ + c = upcase (c); + } + } + + if (event->kind == ASCII_KEYSTROKE_EVENT) + { /* Turn ASCII characters into control characters when proper. */ if (event->modifiers & ctrl_modifier) -- 2.8.0.rc3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 01 11:59:11 2016 Received: (at 24456) by debbugs.gnu.org; 1 Oct 2016 15:59:12 +0000 Received: from localhost ([127.0.0.1]:41291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bqMgx-0006bV-N0 for submit@debbugs.gnu.org; Sat, 01 Oct 2016 11:59:11 -0400 Received: from eggs.gnu.org ([208.118.235.92]:44918) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bqMgw-0006bJ-99 for 24456@debbugs.gnu.org; Sat, 01 Oct 2016 11:59:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bqMgn-0000eS-Kn for 24456@debbugs.gnu.org; Sat, 01 Oct 2016 11:59:04 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bqMgn-0000eG-HH; Sat, 01 Oct 2016 11:59:01 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1960 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bqMgl-0004ny-29; Sat, 01 Oct 2016 11:58:59 -0400 Date: Sat, 01 Oct 2016 18:59:05 +0300 Message-Id: <83fuogkqly.fsf@gnu.org> From: Eli Zaretskii To: Dima Kogan In-reply-to: <87k2dsxfvo.fsf@secretsauce.net> (message from Dima Kogan on Sat, 01 Oct 2016 08:12:27 -0700) Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords References: <87oa3l7ku4.fsf@secretsauce.net> <87k2e9z4l9.fsf@users.sourceforge.net> <87lgyp6p5h.fsf@secretsauce.net> <834m5ciq4m.fsf@gnu.org> <87k2e879by.fsf@secretsauce.net> <83shsvhmc2.fsf@gnu.org> <87fuov7o3a.fsf@secretsauce.net> <83lgynhgg1.fsf@gnu.org> <87d1jz7hx3.fsf@secretsauce.net> <83mvj1fgi4.fsf@gnu.org> <8737ks7rw2.fsf@secretsauce.net> <83oa3gdkmo.fsf@gnu.org> <87shsnddko.fsf@secretsauce.net> <83zimolbhk.fsf@gnu.org> <87k2dsxfvo.fsf@secretsauce.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -8.0 (--------) X-Debbugs-Envelope-To: 24456 Cc: 24456@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -8.0 (--------) > From: Dima Kogan > Cc: npostavs@users.sourceforge.net, 24456@debbugs.gnu.org > Date: Sat, 01 Oct 2016 08:12:27 -0700 > > > Looks okay, but you still didn't leave a space before the opening > > parentheses and the function name. > > Attached. Looks good, thanks. > Is there a tool to automatically detect/fix these? I'm not aware of any, but that doesn't mean there isn't one. > > Did you try this with a non-ASCII key (assuming you have one on your > > keyboard)? > > I did not try. I live in the US, and pretty much never see keyboards > with anything non-trivial on them. If somebody else would test it, that > would be great. Could someone please try that and see if it works correctly? From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 15 10:24:29 2016 Received: (at 24456-done) by debbugs.gnu.org; 15 Oct 2016 14:24:29 +0000 Received: from localhost ([127.0.0.1]:60091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvPsz-0001FT-Aa for submit@debbugs.gnu.org; Sat, 15 Oct 2016 10:24:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59741) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bvPsx-0001FG-3w for 24456-done@debbugs.gnu.org; Sat, 15 Oct 2016 10:24:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bvPso-0007wJ-SG for 24456-done@debbugs.gnu.org; Sat, 15 Oct 2016 10:24:21 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46406) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bvPsa-0007r1-7h; Sat, 15 Oct 2016 10:24:04 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4629 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bvPsZ-0007ji-88; Sat, 15 Oct 2016 10:24:03 -0400 Date: Sat, 15 Oct 2016 17:23:59 +0300 Message-Id: <83r37h1yio.fsf@gnu.org> From: Eli Zaretskii To: dima@secretsauce.net In-reply-to: <83fuogkqly.fsf@gnu.org> (message from Eli Zaretskii on Sat, 01 Oct 2016 18:59:05 +0300) Subject: Re: bug#24456: 25.1; [PATCH] Caps-lock doesn't affect interpretation of key chords References: <87oa3l7ku4.fsf@secretsauce.net> <87k2e9z4l9.fsf@users.sourceforge.net> <87lgyp6p5h.fsf@secretsauce.net> <834m5ciq4m.fsf@gnu.org> <87k2e879by.fsf@secretsauce.net> <83shsvhmc2.fsf@gnu.org> <87fuov7o3a.fsf@secretsauce.net> <83lgynhgg1.fsf@gnu.org> <87d1jz7hx3.fsf@secretsauce.net> <83mvj1fgi4.fsf@gnu.org> <8737ks7rw2.fsf@secretsauce.net> <83oa3gdkmo.fsf@gnu.org> <87shsnddko.fsf@secretsauce.net> <83zimolbhk.fsf@gnu.org> <87k2dsxfvo.fsf@secretsauce.net> <83fuogkqly.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.4 (-----) X-Debbugs-Envelope-To: 24456-done Cc: 24456-done@debbugs.gnu.org, npostavs@users.sourceforge.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.4 (-----) > Date: Sat, 01 Oct 2016 18:59:05 +0300 > From: Eli Zaretskii > Cc: 24456@debbugs.gnu.org, npostavs@users.sourceforge.net > > > From: Dima Kogan > > Cc: npostavs@users.sourceforge.net, 24456@debbugs.gnu.org > > Date: Sat, 01 Oct 2016 08:12:27 -0700 > > > > > Looks okay, but you still didn't leave a space before the opening > > > parentheses and the function name. > > > > Attached. > > Looks good, thanks. > > > Is there a tool to automatically detect/fix these? > > I'm not aware of any, but that doesn't mean there isn't one. > > > > Did you try this with a non-ASCII key (assuming you have one on your > > > keyboard)? > > > > I did not try. I live in the US, and pretty much never see keyboards > > with anything non-trivial on them. If somebody else would test it, that > > would be great. > > Could someone please try that and see if it works correctly? No further comments, so I pushed this to the master branch, and I'm marking this bug done. Thanks. From unknown Mon Jun 16 23:50:36 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 13 Nov 2016 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator