From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Regarding Emacs, js.el, template-strings and syntax-tables Date: Tue, 5 Sep 2017 11:25:26 +0300 Message-ID: <6ca801de-9076-8a7f-6a7e-3b73ce207671@yandex.ru> References: <1503557767.41308.1083341824.4A2103C1@webmail.messagingengine.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1504600066 29219 195.159.176.226 (5 Sep 2017 08:27:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 5 Sep 2017 08:27:46 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:56.0) Gecko/20100101 Thunderbird/56.0 Cc: Stefan Monnier , emacs-devel To: Anders Lindgren Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Sep 05 10:27:31 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dp9Ca-0006Os-1D for ged-emacs-devel@m.gmane.org; Tue, 05 Sep 2017 10:27:20 +0200 Original-Received: from localhost ([::1]:57412 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dp9Ch-0007zx-7C for ged-emacs-devel@m.gmane.org; Tue, 05 Sep 2017 04:27:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dp9Ay-0007Er-TI for emacs-devel@gnu.org; Tue, 05 Sep 2017 04:25:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dp9Ao-0004Ec-Le for emacs-devel@gnu.org; Tue, 05 Sep 2017 04:25:40 -0400 Original-Received: from mail-lf0-x230.google.com ([2a00:1450:4010:c07::230]:35937) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dp9Ao-0004DH-Ck for emacs-devel@gnu.org; Tue, 05 Sep 2017 04:25:30 -0400 Original-Received: by mail-lf0-x230.google.com with SMTP id m199so8545534lfe.3 for ; Tue, 05 Sep 2017 01:25:30 -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=sayZP2kWtY7GCReEmQkodCfGO0rf6jU7JnpcOXlEo1A=; b=B7/AxB97W3dQDauK7C6bRo8WgkRTL2RMY+G8aqfYF4DEmiBEgqQHwpm8PTUhYBkb5S jWoRisjx5b5HxvtvdUVyV8WwaJdb3nDoTSz/nXQys9pSAHIpUSqTzEtlYKtxetPzeyIj 1Um+CgqGRR8QqF4NhKTk6i/qmOyC3+Vf5lH6srTxI9lKVoQ5knNrXa9orT8Fx3DcAltI v6ojgn42EsHbXqSCYGwAptwSOkXfxjZwnNNwYKVgG3e9nrQBVkaAwfqwfWn0yc8yzd5y F5HtQI4d5lN9i632MyGdCNiqREL2APp39+Gs6O2Ml8SpeALVvfoFTrWGeWee12pRBLY2 6EeA== 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=sayZP2kWtY7GCReEmQkodCfGO0rf6jU7JnpcOXlEo1A=; b=tTTDyuIUsBTy+ZirQwDmOIShuQt/gMF8K2bXWVYFqTwYN0Wq1RmV5WBCXYSdfUdU9R jzwq1E3KBwwEz4VMlHcbabuItLk7upPZw9p60ZJDBp4QGDZG+Bt/e4i11LBpwaD4X8mr DyV8BNLf69DWfApqz3F2R56ogH146ZOHzL6zZSpji3Yv3au+EonPgTERphcd52aAsn3q d1UDBzUqOSuYJsk1Qy+AFOY/5YLGJ25LceqrdAcD1ASuXQk3uU4l1ZFv4KAwSKd2cNhk 9qze6wuen55bXbintWWVNKoT/ir22UZ6L7OClyWd0pvLle1GxPehfEj33YPJrF75+hRn /g9A== X-Gm-Message-State: AHPjjUjhcMnytpvhdDHbxFEdQDZKuMpGdWLCz6DIhb+HkwPB7a0XilMz ISvBPneBusrJJFsMqgk= X-Google-Smtp-Source: ADKCNb5fQJELHGYuxsca0luOLU2LoHNEbsYSRgliU2YEeiiPXtBFcgnGyS7AkEeDS4c15a7mIRPDlA== X-Received: by 10.25.80.94 with SMTP id z30mr1055235lfj.112.1504599928824; Tue, 05 Sep 2017 01:25:28 -0700 (PDT) Original-Received: from [192.168.1.174] ([178.252.127.239]) by smtp.googlemail.com with ESMTPSA id 25sm5737ljn.16.2017.09.05.01.25.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Sep 2017 01:25:27 -0700 (PDT) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4010:c07::230 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:217939 Archived-At: On 9/5/17 10:00 AM, Anders Lindgren wrote: > In other languages where the constructs only can be > simple variables, I would prefer to retain the string face (for the sake > of things like the background color) and color the variable name by > prepending the variable name face. Sure, why not. > In my experience, I can read code easier if the delimiters aren't > highlighted the same way the content is. (In other words, the current > Ruby implementation isn't ideal for me.) Yes, so in the case of ruby-mode, the delimiters will have some special face (keyword? IDK), and the content will have the default face. > While we're on the subject. I've been thinking about highlighting > parameters in functions and blocks in Ruby. Let's maybe make it an optional mode, so ruby-mode doesn't stand out too much (or discuss whether all modes should do that if possible, on emacs-devel). But I've been looking at this too, albeit from a different standpoint (completion of local variable names). > It wouldn't be too > difficult, and it would make code easier to read. Unfortunately, it > doesn't include all variables as local variables can be created on the > fly using a plain assignment in Ruby. Finding assignments is easy (just a regexp). Tracking variable scopes (defined by their belonging to methods, or blocks, or even class/module bodies) looks harder to me. We can do that by parsing expressions with SMIE, but that's not fast if we have to parse the whole class body (there are some big classes out there). Limiting ourselves to only methods might be fine, though. > As a parallel, my lisp-extra-font-lock package > (https://github.com/Lindydancer/lisp-extra-font-lock) do this in Lisp > modes for function and lambda parameters and local variables introduces > using `let`, `dolist` et.c. Now that I've been using it for a couple of > years, I would not dream of going back to the near black-and-white world > of the default lisp modes. I like the idea, but seeing the red on the screenshot is a bit off-putting. red is for errors.