From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 07 23:51:25 2016 Received: (at submit) by debbugs.gnu.org; 8 Aug 2016 03:51:25 +0000 Received: from localhost ([127.0.0.1]:59417 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bWbb2-0002ak-Rq for submit@debbugs.gnu.org; Sun, 07 Aug 2016 23:51:25 -0400 Received: from eggs.gnu.org ([208.118.235.92]:46103) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bWbb0-0002aX-Bh for submit@debbugs.gnu.org; Sun, 07 Aug 2016 23:51:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWbau-00061i-9D for submit@debbugs.gnu.org; Sun, 07 Aug 2016 23:51:17 -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,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51762) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWbau-00061a-5r for submit@debbugs.gnu.org; Sun, 07 Aug 2016 23:51:16 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWbar-0004iU-IQ for bug-gnu-emacs@gnu.org; Sun, 07 Aug 2016 23:51:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWbaq-00061G-35 for bug-gnu-emacs@gnu.org; Sun, 07 Aug 2016 23:51:13 -0400 Received: from mail-yb0-x22a.google.com ([2607:f8b0:4002:c09::22a]:34807) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWbap-000616-Ui for bug-gnu-emacs@gnu.org; Sun, 07 Aug 2016 23:51:12 -0400 Received: by mail-yb0-x22a.google.com with SMTP id x196so33097492ybe.1 for ; Sun, 07 Aug 2016 20:51:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=QWQH+0DF3DC6SyahybUGwikSNelRxzSwQKa8E6eCeLE=; b=ZwHjCCIIFtoSn4SvlL6vaesFL9Svgx85ODLXraEBnVM7YPkQoHZRcJpsiOTAm4R9+z sf2l7pktka2Zmlx9pMSXC7F9XAU98WvmCIsFbxeHiAsa7/klbFKvaDnOD3YXiWl3NDBj Cclm5VI41K56FIJxa5M8w2iBMacqUMFIF82jRYlGQTYrBs+OTHuXg2/grxGnB5KzPTlQ bQEH1J+8nTNi5UM/51ljh5h5Dqp0K3sxuLDCFxl1wvz2NHwUFIWb7gMm+sxPsN44qHBP jxqhPUo/Siw2KpQdEcIPQrxM1/ZA4W+tDexBOAeP5WjYzvnmM9MYLcOKkU5u3ucShfa1 fOlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=QWQH+0DF3DC6SyahybUGwikSNelRxzSwQKa8E6eCeLE=; b=AtDowexkM5/IszUiveewWq+v0e3wnC1HixZWR/MPBJEHBdj5LyCXdDjev+BJxzMF7S RojbPkFOH1ev4CF8N0Vgx36GMVQWG7Ro+p4GRaT9vM/q56VANc567UxTFdirJUDddPv9 WLkXoRNEnbHMyPFGtADNE9W8517F4H3o/bhSkVE+FanGGIqfOQhtdfNFoyFgbgrB9iTU ReG7APFjO9K243L0/MGEpQyVQE8z7R2jjNcubP9knryvQQ45DzQ1C/pNCbMTYQUOlzMp vPX2FLlw75eXlMjKGi6XBYZZTc5IhrJZ9PeXS2cY/IamAre6/q1mHmMBthKIVT3PBBqk m+Qg== X-Gm-Message-State: AEkoousrCecFV0uufVPjPMymA1HsSFhDTgJVntdnp32xHlV5ZcJ3k4EmZ//eqGbLAI7bcpvIlkZJUYPt7ahsnQ== X-Received: by 10.31.15.67 with SMTP id 64mr48205851vkp.37.1470628270961; Sun, 07 Aug 2016 20:51:10 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.36.53 with HTTP; Sun, 7 Aug 2016 20:50:30 -0700 (PDT) From: Ryo Furue Date: Mon, 8 Aug 2016 12:50:30 +0900 Message-ID: Subject: 25.1.50; ruby mode: wrong auto indent after "?" string literal To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset=UTF-8 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: -4.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: -4.0 (----) Hi emacs maintainers, 1. Open an empty Ruby source code, say "tmp.rb". 2. Type the following: #!/usr/bin/ruby base = ?a.ord - 1 On hitting the return key at the end of the second line, the cursor moves below "a", not to the top of the third line. The indentation state seems to be confused. I did this test with "emacs -q" . ?a is a valid Ruby syntax for string literal. After writing this, I learned that "a".ord is equivalent (I think), so I already have a workaround. Hope this helps, Ryo In GNU Emacs 25.1.50.1 (x86_64-apple-darwin15.6.0, NS appkit-1404.47 Version 10.11.6 (Build 15G31)) of 2016-07-27 built on furufuru-mac.yes.jamstec.go.jp Repository revision: 682fdae7efe5a36636539b953a657445f2f3382b Windowing system distributor 'Apple', version 10.3.1404 Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. (New file) C-h C-g is undefined Making completion list... [2 times] Configured using: 'configure --disable-dependency-tracking --disable-silent-rules --enable-locallisppath=/usr/local/share/emacs/site-lisp --infodir=/usr/local/Cellar/emacs/HEAD-682fdae/share/info/emacs --prefix=/usr/local/Cellar/emacs/HEAD-682fdae --with-xml2 --without-dbus --with-gnutls --with-rsvg --with-imagemagick --with-ns --disable-ns-self-contained' Configured features: JPEG RSVG IMAGEMAGICK NOTIFY ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS Important settings: value of $LC_COLLATE: C value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Ruby Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message subr-x puny seq byte-opt gv bytecomp byte-compile cl-extra help-mode cconv cl-loaddefs pcase cl-lib dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils ruby-mode smie easymenu time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win ucs-normalize term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 208190 9578) (symbols 48 20842 0) (miscs 40 74 216) (strings 32 19355 5290) (string-bytes 1 615360) (vectors 16 34870) (vector-slots 8 670676 5823) (floats 8 177 312) (intervals 56 241 2) (buffers 976 14)) From debbugs-submit-bounces@debbugs.gnu.org Wed Aug 10 23:10:33 2016 Received: (at 24181) by debbugs.gnu.org; 11 Aug 2016 03:10:33 +0000 Received: from localhost ([127.0.0.1]:52806 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXgO8-00079z-Ti for submit@debbugs.gnu.org; Wed, 10 Aug 2016 23:10:33 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:37397) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXgO6-00079l-8D for 24181@debbugs.gnu.org; Wed, 10 Aug 2016 23:10:31 -0400 Received: by mail-wm0-f43.google.com with SMTP id i5so5611382wmg.0 for <24181@debbugs.gnu.org>; Wed, 10 Aug 2016 20:10:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=pvLxGL5esGC2Kw5TVOjffPgF12NVo5aIeqyR7SNQZT8=; b=MZWNzaVVfhGIxb7ixDt5q4bc7xjVr7G0JxITPR74B52wIhV1x/em7TrbByEnrPQPMP vjaFzcLXIyDEfaBm9IrrMwPqZvsm58vbYHsogulCIqqummebZHtf2v7aqLTndHDfKLlN F/Xn3OSxTQvbCx5BUIdMJIEJOH8mNMrQCIM7kLB25nIIciTH+4G3YM9nD3bTagzz3Zo2 ie9G7ZaicRmMPBQgeFez5xOQ8/PFl/lH4bCk6Vwu7VEUuQCcguipkhEPS1LwH2x9IESh P5o4d4IST3pAJQbXM7qje9p7x0oR0LPBbYKZtbgQEFzDB9QwmhPwLiDYnDttjkCVoRxM cqHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=pvLxGL5esGC2Kw5TVOjffPgF12NVo5aIeqyR7SNQZT8=; b=ffpiN3Yq+g3tlH0/pvHD3L3wMFaJ7P8rqbx6yoDTZABhGsP2f5ujk3wgfDq1yMrcQu F5HJHq7F4ue+zPQ6ICQz+hJzEUxTOrG+8+qt2UDEm3uugUKTAVgJLopKjT/Npc1A4sxf Kw5RikHfzaYNIMPKe0GgFqI8+j2+FHY0Kev92oOPFiqr+W81WFPDuUwwbDmakSpbkmJt wZy5WIEwBbH7ryi3jq6Z3ru7rVoQOmY2wA95KO9q3N21mMpAC+l311UQLD1UL08lWsyn ziDlNNaVFTRa0Qh4Ft28hFmJuMDhdUTdWed6qNQX6xe+c34rjvpLRPMI+hFQQP/5tGBP bdDA== X-Gm-Message-State: AEkoouvrL/SbuQ1L8UryPBFlzoLctAo6EuV1cm+k6EUjRoE4DY3xe8a2/6CDkKLIongLMQ== X-Received: by 10.25.90.198 with SMTP id o189mr1137792lfb.193.1470885024541; Wed, 10 Aug 2016 20:10:24 -0700 (PDT) Received: from [192.168.1.190] ([178.252.127.239]) by smtp.googlemail.com with ESMTPSA id f4sm108959lji.41.2016.08.10.20.10.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Aug 2016 20:10:24 -0700 (PDT) Subject: Re: bug#24181: 25.1.50; ruby mode: wrong auto indent after "?" string literal To: Ryo Furue , 24181@debbugs.gnu.org References: From: Dmitry Gutov Message-ID: Date: Thu, 11 Aug 2016 06:10:22 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:47.0) Gecko/20100101 Thunderbird/47.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: 24181 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.1 (/) Hi! On 08/08/2016 06:50 AM, Ryo Furue wrote: > 1. Open an empty Ruby source code, say "tmp.rb". > 2. Type the following: > > #!/usr/bin/ruby > base = ?a.ord - 1 > > On hitting the return key at the end of the second line, the cursor > moves below "a", not to the top of the third line. The indentation > state seems to be confused. I did this test with "emacs -q" . Thanks for the report. I'd like to fix it sometime, but it's not a big priority, considering this syntax is usually discouraged: https://github.com/bbatsov/ruby-style-guide#no-character-literals > ?a is a valid Ruby syntax for string literal. After writing this, I learned > that "a".ord is equivalent (I think) Yes, in Ruby 1.9 and newer, it's a full equivalent. From debbugs-submit-bounces@debbugs.gnu.org Thu Aug 11 02:42:24 2016 Received: (at 24181) by debbugs.gnu.org; 11 Aug 2016 06:42:24 +0000 Received: from localhost ([127.0.0.1]:52885 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXjhA-0000Ze-A9 for submit@debbugs.gnu.org; Thu, 11 Aug 2016 02:42:24 -0400 Received: from mail-ua0-f181.google.com ([209.85.217.181]:33876) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bXjh7-0000ZP-CI for 24181@debbugs.gnu.org; Thu, 11 Aug 2016 02:42:22 -0400 Received: by mail-ua0-f181.google.com with SMTP id k90so106037452uak.1 for <24181@debbugs.gnu.org>; Wed, 10 Aug 2016 23:42:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=MRMHimtRmJNrKh0gBtP9JSL7wNDIfs3vf4OWZEEEI3g=; b=xDSiMCLcJNalM6vSnUaiBiD7cuwzPDLRN+njw/1GtcPwafye8HbXEqA9aHqgU4qmW3 6oVGWd5Sx5sH1U8LU/8eXlODhQmEeWWKQASxxvZwyK7k0mUmHfWuRJ6n26vsQDuy6Esk wpHiHwNKlUYLa9c4VooS04/9GzrJYrwy7z4njUxXv44SWWY881XKCk1AIdUbbp6yqFKR H6mcxC4f4r3q/cpNmrxk5OJE0UIvbgHY6m/4BcsshuQe19j67mrGQNaB7LXGJ754U5R+ 79s7JkUMF9ozvjzy14MXYgJEOs1YA0nOL/kKuGEzUBlThUeP51IkvEl09IMWL73D12mD 7Uqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=MRMHimtRmJNrKh0gBtP9JSL7wNDIfs3vf4OWZEEEI3g=; b=haVCn4kM6+gkZLM1cbRGP04Uw5+VzBw3QT+SqJEiiAAFNmGWCg4ldLNxDUBj5vAMe9 R4wz/gVh8nWlnx0v2Imca76H5WvVm4KJb0/1I113uQVPqDwApzoGlqWRt7K4pi0a+2U+ ZGX+YiZCEJO+GRqT94Evv4Do3QXS2qwoq6QYNzQ5OFpwewCpHYvGcwTxaRplDi/MUjhE K6mMipEilRPJ4o1GHZRfJ2zXdHHi6PLq3VJ6eGw1FvyYjc24dEB5+umhozvpSabhmQcU WB5WA89Ks7N/0/kCenePbItDiVsiamPEodUi76VSk9JhwRTK4l+ZxsEJg8gVGogR6J2w iOdQ== X-Gm-Message-State: AEkoouthVPtLZFvaigia5OAZTRk8i7t3j8qYk3M3zvI45+5OyTJKK/YhtfI3a9K5rb7idUEpbuAKwlzFv3ueBA== X-Received: by 10.31.135.139 with SMTP id j133mr3997974vkd.133.1470897735825; Wed, 10 Aug 2016 23:42:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.159.36.53 with HTTP; Wed, 10 Aug 2016 23:41:35 -0700 (PDT) In-Reply-To: References: From: Ryo Furue Date: Thu, 11 Aug 2016 15:41:35 +0900 Message-ID: Subject: Re: bug#24181: 25.1.50; ruby mode: wrong auto indent after "?" string literal To: Dmitry Gutov Content-Type: text/plain; charset=UTF-8 X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 24181 Cc: 24181@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 (/) Hi, > Thanks for the report. I'd like to fix it sometime, but it's not a big > priority, considering this syntax is usually discouraged: > > https://github.com/bbatsov/ruby-style-guide#no-character-literals Thank you for the link! It seems very comprehensive and must be useful for many other issues, too. I agree the bug I reported isn't a big issue. >> ?a is a valid Ruby syntax for string literal. After writing this, I >> learned >> that "a".ord is equivalent (I think) > > Yes, in Ruby 1.9 and newer, it's a full equivalent. After my last message, I learned that Ruby has abandoned the idea of "character type" and instead of elevating ?a to a proper character literal, it has made it equivalent to a single-character string "a". So, a String is no longer a sequence of individual characters (because "character" has no representation in the language). "a".ord returns the character code of this single-character string but "abc".ord ignores the "bc" part. I don't think that's a clean design, but perhaps it's the simplest, practical one, in the face of various character encodings. . . . That makes me wonder how Haskell handles unicode. In that language, "String" is an alias for "[Char]" (list of Char's). . . . I digressed. Cheers, Ryo From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 01 22:06:59 2021 Received: (at 24181) by debbugs.gnu.org; 2 Jan 2021 03:06:59 +0000 Received: from localhost ([127.0.0.1]:35113 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvXFr-0001Kz-En for submit@debbugs.gnu.org; Fri, 01 Jan 2021 22:06:59 -0500 Received: from mail-ed1-f54.google.com ([209.85.208.54]:42095) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kvXFp-0001Ki-Nw for 24181@debbugs.gnu.org; Fri, 01 Jan 2021 22:06:58 -0500 Received: by mail-ed1-f54.google.com with SMTP id g24so21415719edw.9 for <24181@debbugs.gnu.org>; Fri, 01 Jan 2021 19:06:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=oTQADWn/cX7l5gA2IO1FFA6Wmy74xz7T1CZKGKhTCDk=; b=PMpwgmPeabD91YojGwITjh/N98Yg7qj0tdiySobaIAq3gTieZ+3wFAwn0jbUnq3iTh ma7d0jsJmS7ehPxBYq720zT+ltstKl21YvUmPO8hlJXxsNeahPkIE9g1pP4/+o7Oghht lLkeMkK9n5PiBrRozeZBJLNttFp248anVwMAjdyFKxrJnizkLrYvuIcsQNKsH6OxxnPf CB3o1PgGqZi1xsBY1nRAoa6aaHt/13rCsmUE8i2ln4Cl/owFGd/gjNhGAHt9+wTHCrbq heu/nWwX/igypBtBfAhy8hA4iMAOsl62hCU9pb6360tlbhQgkq8xXJJH3tBSdDAtR9VY vSSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=oTQADWn/cX7l5gA2IO1FFA6Wmy74xz7T1CZKGKhTCDk=; b=qFfyA04ZXx/pcWc7bfqNajkDPop/ajMyW7YXL5a1/qy1JcwbHLNLK0qQSmW/jP+eLq 51dW0zGnzMVv1zC5Za6KPghOTsOAA7wQe9kpSeQeLcPJkNiDYLFSj63ogMyMlnkf749n LZPuIuRtPQyB5fueAejknmDUiWgXkDIyPNxcq4UrmTcDwrVM3IQF6RkWpWaxgsE615LH ZEa9XfjqOsiYNGtqVgunauiHPyVS7kAB7ONHX98ImtQjcu5yvJW7tbgB1xOPHfLR9wb/ r07gbKCut95BevyZ65W1XNhCL9Y4gPeXqpC3C6WGGbhcwXF0R6rYyhQoCNP9bFusWrJ5 /3jw== X-Gm-Message-State: AOAM532alanuYUXo9q7Tuyy6QtwdVLwfB1iuCE+F5f9Ew1rqBQD9xnys ASpeO3sco05/zCcsvKk2ZvP1hLYPWCLbDw== X-Google-Smtp-Source: ABdhPJx5sUaTz+r2mZggqPR8Tl3ycWoT05RNttBeicaaiV0mqJPfOPWUj3PD04iDBdoZp4VMQUKfiQ== X-Received: by 2002:aa7:c698:: with SMTP id n24mr61478565edq.277.1609556811549; Fri, 01 Jan 2021 19:06:51 -0800 (PST) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id k3sm28046071eds.87.2021.01.01.19.06.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Jan 2021 19:06:50 -0800 (PST) Subject: Re: bug#24181: 25.1.50; ruby mode: wrong auto indent after "?" string literal To: Ryo Furue References: From: Dmitry Gutov Message-ID: Date: Sat, 2 Jan 2021 05:06:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 24181 Cc: 24181@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: -3.3 (---) Sorry for digging this up, just looking through old issues. On 11.08.2016 09:41, Ryo Furue wrote: >>> ?a is a valid Ruby syntax for string literal. After writing this, I >>> learned >>> that "a".ord is equivalent (I think) >> >> Yes, in Ruby 1.9 and newer, it's a full equivalent. > > After my last message, I learned that Ruby has abandoned the idea of > "character type" and instead of elevating ?a to a proper character > literal, it has made it equivalent to a single-character string "a". > So, a String is no longer a sequence of individual characters (because > "character" has no representation in the language). "a".ord returns > the character code of this single-character string but "abc".ord > ignores the "bc" part. I don't think that's a clean design, but > perhaps it's the simplest, practical one, in the face of various > character encodings. . . . This syntax there is purely for compatibility, I believe. > That makes me wonder how Haskell handles > unicode. In that language, "String" is an alias for "[Char]" (list > of Char's). . . . I digressed. Types in a statically typed language are a bit of a different beast. E.g., you can eliminate a lot of associated overhead during compilation. Not so with a dynamically typed langues. For posterity, a fix for the reported problem should look like the patch at the end of this message. I'm not going to commit it, though (or, at least, not in its current form) because Ruby makes it non-trivial to distinguish between these literals and the ternary operator: > abc ?( 1+ 2) : 4 => 3 > def dee(arg); > dee ?( 1+ 2) : 4 SyntaxError ((irb):27: syntax error, unexpected tINTEGER, expecting end) dee ?( 1+ 2) : 4 Hopefully, the syntax will just be removed in some near future version of Ruby and save us the trouble. But here's the patch. To go in, it would have to be accompanied by some extra code looking around to determine the context. diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 3effb6ed66..bd74e71f6a 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1854,9 +1854,9 @@ ruby-syntax-propertize (syntax-propertize-rules ;; $' $" $` .... are variables. ;; ?' ?" ?` are character literals (one-char strings in 1.9+). - ("\\([?$]\\)[#\"'`:?]" + ("\\([?$]\\)[#\"'`:?[:alnum:]]" (1 (if (save-excursion - (nth 3 (syntax-ppss (match-beginning 0)))) + (nth 8 (syntax-ppss (match-beginning 0)))) ;; Within a string, skip. (ignore (goto-char (match-end 1))) From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 15 08:27:04 2021 Received: (at 24181) by debbugs.gnu.org; 15 Aug 2021 12:27:04 +0000 Received: from localhost ([127.0.0.1]:46017 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFFEB-00039V-JN for submit@debbugs.gnu.org; Sun, 15 Aug 2021 08:27:03 -0400 Received: from quimby.gnus.org ([95.216.78.240]:58618) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFFE5-000399-5H for 24181@debbugs.gnu.org; Sun, 15 Aug 2021 08:26:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=KzwbhW56EMqQv6w0xTqv5NbSTkETYs5uw734acuDsOI=; b=YBghPI+b1INdGPTP4tJXHAQeA0 ypPv1+u48OyIdImV9Q5PemR0qS4kwCoxGp4Shvcvuh9CbmMF/u6wsJaV+30yvCcPoz1+CavZAmQnR 0L8y1gu5X+2FOaTBWyRDudJwHZS65UksW7XPOvbdXQmT5iKASxPRMeUnPzSHCH2gzrw8=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mFFDu-00005v-P3; Sun, 15 Aug 2021 14:26:46 +0200 From: Lars Ingebrigtsen To: Dmitry Gutov Subject: Re: bug#24181: 25.1.50; ruby mode: wrong auto indent after "?" string literal References: Date: Sun, 15 Aug 2021 14:26:42 +0200 In-Reply-To: (Dmitry Gutov's message of "Sat, 2 Jan 2021 05:06:48 +0200") Message-ID: <87fsvanbb1.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Dmitry Gutov writes: > Hopefully, the syntax will just be removed in some near future version > of Ruby and save us the trouble. But here's the patch. To go in, it > would have to be accompanied by some extra code looking [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 24181 Cc: 24181@debbugs.gnu.org, Ryo Furue 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: -3.3 (---) Dmitry Gutov writes: > Hopefully, the syntax will just be removed in some near future version > of Ruby and save us the trouble. But here's the patch. To go in, it > would have to be accompanied by some extra code looking around to > determine the context. So it sounds like the conclusion here is that we're not going to change the behaviour here, and I'm closing this bug. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 15 08:27:07 2021 Received: (at control) by debbugs.gnu.org; 15 Aug 2021 12:27:07 +0000 Received: from localhost ([127.0.0.1]:46019 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFFEF-0003A0-Vq for submit@debbugs.gnu.org; Sun, 15 Aug 2021 08:27:07 -0400 Received: from quimby.gnus.org ([95.216.78.240]:58634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFFEA-00039H-AF for control@debbugs.gnu.org; Sun, 15 Aug 2021 08:27:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=1q8Aad/faISqcRtbEpdi9+dZo470JfBHUFxcdiHVhKE=; b=kqTR/0K4++KrWC+L5yJTSmwbUl U5Q0ylnZxlSvBTf4vEsE/RUFwNJSSqhyTh3LcWqT1+SWkq8a30xj1rWIn3rCw+H8dntQyBkdgMrTv AfUHe9BiXugb3QSjRfRcSZ0OgRIrffP7844wlDw/ijK5jE1gDbDRUx6wcdnbQdyd7vHM=; Received: from [84.212.220.105] (helo=elva) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mFFE2-000065-Kg for control@debbugs.gnu.org; Sun, 15 Aug 2021 14:26:52 +0200 Date: Sun, 15 Aug 2021 14:26:50 +0200 Message-Id: <87eeaunbat.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #24181 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 24181 wontfix close 24181 quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control 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: -3.3 (---) tags 24181 wontfix close 24181 quit From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 15 18:21:20 2021 Received: (at 24181) by debbugs.gnu.org; 15 Aug 2021 22:21:20 +0000 Received: from localhost ([127.0.0.1]:47918 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFOVM-0000J8-DK for submit@debbugs.gnu.org; Sun, 15 Aug 2021 18:21:20 -0400 Received: from mail-wm1-f48.google.com ([209.85.128.48]:39469) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mFOVH-0000Is-H4 for 24181@debbugs.gnu.org; Sun, 15 Aug 2021 18:21:18 -0400 Received: by mail-wm1-f48.google.com with SMTP id f9-20020a05600c1549b029025b0f5d8c6cso13621473wmg.4 for <24181@debbugs.gnu.org>; Sun, 15 Aug 2021 15:21:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=SPo9lg7kgfzpjygEtn7yq9MJ/3kPUirKySWf1WPOjOE=; b=JgFUr1y5jyTRo+syI1eurhiNvH/RwSXMpKJPmifZEZUZV43tMDSME0CvKHq99XS2D3 XYCzHEVxuwnkOr+cqXPxjNY26AT07gADPlzzGNjhxmSUHuyB68Y39RopoPiAWwMyocPG 6CJe+J/pRqY5G+TiuiaAmyPR9eDGFRr5hRLuSQBMzmSiGjTy6XybwWK3VI2KL4LjF7mS 9QiwaoV2WYKrTiJRaTpcH5/Pk63HBg/wrdAJsm6gPMf9QhRM8TAbLsdSRe0oxS46GhGm 1/jSJDditT+pFU8AR9P1nY1YWpp63PfSfc4+tOYBdEFa9OYG9zMyAwarYhTT/su24RKl AsBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=SPo9lg7kgfzpjygEtn7yq9MJ/3kPUirKySWf1WPOjOE=; b=atGLt8T5TmyPzxoV31WPL7ovZ7XkPPQ0pZpNMkwl2SykX8OSGmQNQbHswvfhQ3Lspw 9Zjo5Xfc17PO+ErlmxmsupkKrtITXr1FJkQATpdEzU8vD5xUw8pN894Eu4xKZmDz3pD6 3f62sB5WG5o7ipxV1EWGYfq6tqt2YQLTg/tG18M1Z1ORc8+H5PNE+E3lVNamhD3hZNKX ytQj7n6Ol5J/ftf4ewMoXSiKKgvQZFI7Tx6oE/RRIOjqy2I82+cX8MVG2ZDRZieOZ7W/ /QTAD1uFE0qHzaH/Ir5GP+sltPLniEFxHSgwJ/yvLL29gezoRTW3Mds3marVr784eKXb rHfw== X-Gm-Message-State: AOAM530Bs8XyN2o983yf9xklx7kwSSQItgL43lsJFRR7RDy/Zeimc7sD NeUe1I6roki9BXU5/54tB00= X-Google-Smtp-Source: ABdhPJxg9YSxstly4Xe9gvH4kkVuHd/ZvEXKjBf2JRrAq+h2LeNQZJiu5+omQdmyoCBgrrpY8qkDCg== X-Received: by 2002:a05:600c:2311:: with SMTP id 17mr1861409wmo.89.1629066069695; Sun, 15 Aug 2021 15:21:09 -0700 (PDT) Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id g21sm385152wmk.8.2021.08.15.15.21.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 15 Aug 2021 15:21:09 -0700 (PDT) Subject: Re: bug#24181: 25.1.50; ruby mode: wrong auto indent after "?" string literal To: Lars Ingebrigtsen References: <87fsvanbb1.fsf@gnus.org> From: Dmitry Gutov Message-ID: <94e90e14-c717-0a4e-4eb9-90dc757b8bca@yandex.ru> Date: Mon, 16 Aug 2021 01:21:07 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <87fsvanbb1.fsf@gnus.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: 24181 Cc: 24181@debbugs.gnu.org, Ryo Furue 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.6 (/) On 15.08.2021 15:26, Lars Ingebrigtsen wrote: > Dmitry Gutov writes: > >> Hopefully, the syntax will just be removed in some near future version >> of Ruby and save us the trouble. But here's the patch. To go in, it >> would have to be accompanied by some extra code looking around to >> determine the context. > So it sounds like the conclusion here is that we're not going to change > the behaviour here, and I'm closing this bug. For now, at least. Since there's not much apparent user demand for it. Whether that's just because there are not too many Emacs users doing Ruby these days, or because the syntax really fell out of favor, I don't know. Hope it's the latter. From unknown Fri Jun 20 07:19:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 13 Sep 2021 11:24:08 +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