From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Josh Newsgroups: gmane.emacs.bugs Subject: bug#13599: 24.2; (max-char) is too low (and hard to change) Date: Thu, 31 Jan 2013 13:22:20 -0800 Message-ID: References: <83k3qtcgro.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1359667405 2355 80.91.229.3 (31 Jan 2013 21:23:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 31 Jan 2013 21:23:25 +0000 (UTC) Cc: Magnar Sveen , 13599@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jan 31 22:23:45 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U11bk-0000Ef-8m for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Jan 2013 22:23:44 +0100 Original-Received: from localhost ([::1]:42838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U11bR-00055b-VU for geb-bug-gnu-emacs@m.gmane.org; Thu, 31 Jan 2013 16:23:25 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:37129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U11bN-00055J-8n for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2013 16:23:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U11bK-0000Vs-5w for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2013 16:23:21 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:52680) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U11bK-0000Vm-2W for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2013 16:23:18 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1U11c1-0001ry-Rl for bug-gnu-emacs@gnu.org; Thu, 31 Jan 2013 16:24:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Josh Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 31 Jan 2013 21:24:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13599 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 13599-submit@debbugs.gnu.org id=B13599.13596674097139 (code B ref 13599); Thu, 31 Jan 2013 21:24:01 +0000 Original-Received: (at 13599) by debbugs.gnu.org; 31 Jan 2013 21:23:29 +0000 Original-Received: from localhost ([127.0.0.1]:58144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U11bU-0001r6-KK for submit@debbugs.gnu.org; Thu, 31 Jan 2013 16:23:28 -0500 Original-Received: from mail-qa0-f48.google.com ([209.85.216.48]:44020) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1U11bR-0001qy-Sz for 13599@debbugs.gnu.org; Thu, 31 Jan 2013 16:23:26 -0500 Original-Received: by mail-qa0-f48.google.com with SMTP id j8so1806252qah.14 for <13599@debbugs.gnu.org>; Thu, 31 Jan 2013 13:22:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=WyXdraVyLQvJHtl9/tLm5LJVp1DWgvYevc0fdD3wqRE=; b=kCGwxz8A2Axw7N3PR9ZvYC+yAhsoTI+M8RpQ8nRvt6SJ3ruJwIdvoPaDCi8QyVRqS4 Du8VGZ4WQMUAEkrNw9JYe25WFr+Nlon2ryC25jMV5+1doC7ZLPaFnGsoKVAMOZEIn2aQ WQinZxgACRWip0dg6Noh2keA3J5h1yJmtQWn+hBFdegl9TFsJYDbkRhSpUfWBMn0fYZP m88lW/1EyAFe8plcEUHTiU3Z5mjax5A2Mvhl1wetbybx4/n4hSxbazTYV44Ba6yq4jYW v1tA+4Bvj81nzBa4gQjnXdArdEgeEnE51qmH2LfA1Orrellq6b7a5RaRBDCmYj1auqZQ Jm0w== X-Received: by 10.224.185.141 with SMTP id co13mr10357517qab.33.1359667361169; Thu, 31 Jan 2013 13:22:41 -0800 (PST) Original-Received: by 10.49.129.38 with HTTP; Thu, 31 Jan 2013 13:22:20 -0800 (PST) In-Reply-To: <83k3qtcgro.fsf@gnu.org> X-Google-Sender-Auth: 3bQD8KMEoHdbY1d9wYI9qOKQF4I X-Gm-Message-State: ALoCoQmMGCvXrCX5SZTdfY2RNSSUSpXD9N4x8Vv7YJGe2qD5cMjdApaOFJwiPH5J9k68OSabMCdN X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:70544 Archived-At: On Thu, Jan 31, 2013 at 11:08 AM, Eli Zaretskii wrote: >> From: Magnar Sveen [...] >> Doing a M-: (read-char) s-8 gives me the key value of 8388664. > > Which is 800038 in hex. Rings any bells? (Hint: 38 hex is the digit > 8.) > >> Following that up with (keyboard-translate 8388664 ?\[) does not work, >> since it fails the (characterp) test. Turns out that (max-char) is a C [...] >> So, is this a bug? > > No. At a minimum the fact that (characterp (read-char)) can ever return nil indicates disagreement between the two functions about exactly what a "character" is. It would be good to reconcile this disagreement in their documentation if nothing else. Given the existence of read-key, is it necessary for read-char to be able to return values greater than MAX_CHAR? If it's indeed necessary, would it be reasonable to add an optional parameter to read-char for callers such as quoted-insert to specify that read-char should return only values <= MAX_CHAR? Josh On Thu, Jan 31, 2013 at 11:08 AM, Eli Zaretskii wrote: >> From: Magnar Sveen >> Date: Thu, 31 Jan 2013 19:42:27 +0100 >> >> Due to my weird norwegian keyboard, I'm trying to map my s-8 to [. >> >> Doing a M-: (read-char) s-8 gives me the key value of 8388664. > > Which is 800038 in hex. Rings any bells? (Hint: 38 hex is the digit > 8.) > >> Following that up with (keyboard-translate 8388664 ?\[) does not work, >> since it fails the (characterp) test. Turns out that (max-char) is a C >> function that returns the highest allowed keycode. On my Emacs, that >> is 4194303. >> >> Since (max-char) is a function and not a variable, and a C function at >> that (not advisable when called from another C function (characterp)) - >> I am left without options to rectify it. Or maybe I could use a hex >> editor. :-) > > Your s-8 is a character with a modifier. max-char returns the max > value of a character, excluding any modifiers. So that value has > nothing to do with your difficulties in binding s-8 to insert [. > Something entirely different is at work here, probably some problem in > the code that you used to do the key binding. But since you didn't > show that code, it's hard to help you. > >> So, is this a bug? > > No. > >> Is it weird that max-char is a function? In C? > > That's precisely so people will be unable to change the value. It's > immutable. > > >