From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Steve Purcell Newsgroups: gmane.emacs.bugs Subject: bug#48180: ruby-mode.el: fix font lock for puts and printf Date: Mon, 03 May 2021 13:01:17 +1200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31325"; mail-complaints-to="usenet@ciao.gmane.io" To: 48180@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 03 03:02:44 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ldMyx-00083a-Vj for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 03 May 2021 03:02:44 +0200 Original-Received: from localhost ([::1]:40538 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldMyx-0006ET-2x for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 May 2021 21:02:43 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldMyI-0006E9-Nr for bug-gnu-emacs@gnu.org; Sun, 02 May 2021 21:02:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34255) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldMyI-0004Ft-Gp for bug-gnu-emacs@gnu.org; Sun, 02 May 2021 21:02:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ldMyI-0005EG-Ec for bug-gnu-emacs@gnu.org; Sun, 02 May 2021 21:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Steve Purcell Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 03 May 2021 01:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48180 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.162000370920089 (code B ref -1); Mon, 03 May 2021 01:02:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 3 May 2021 01:01:49 +0000 Original-Received: from localhost ([127.0.0.1]:45800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldMy5-0005Dx-47 for submit@debbugs.gnu.org; Sun, 02 May 2021 21:01:49 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:42138) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldMy1-0005Dq-Ni for submit@debbugs.gnu.org; Sun, 02 May 2021 21:01:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldMy1-0006DD-52 for bug-gnu-emacs@gnu.org; Sun, 02 May 2021 21:01:45 -0400 Original-Received: from mail.purcellpeople.com ([85.214.32.38]:34002) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldMxz-00043e-4O for bug-gnu-emacs@gnu.org; Sun, 02 May 2021 21:01:44 -0400 Original-Received: from wuji.local (122-57-13-60-adsl.sparkbb.co.nz [122.57.13.60]) by mail.purcellpeople.com (Postfix) with ESMTPSA id C007560BFD for ; Mon, 3 May 2021 03:01:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=sanityinc.com; s=default; t=1620003697; bh=d89g4g0MD+AXpyfG+rcANTvc1s0u/xYffSy7Bz75dgg=; h=From:To:Subject:Date:From; b=disrS1qLxMR9ShjWSKz9hc6IM9/nUXs1FG9I8FOF8F3xr8eeYa2sfCu9uPIPt0lMA fw+DiQUk5FK2lPi1xsSSHnUAglam5WOJ/ykSqXqoWhcLiWUccb1yFI0dfo6sIbs45s ePs4dz0jy1hRlYMDc0omFADYq98O6cWrT6LYv4PA= Received-SPF: pass client-ip=85.214.32.38; envelope-from=steve@sanityinc.com; helo=mail.purcellpeople.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:205462 Archived-At: --=-=-= Content-Type: text/plain Tags: patch Both these methods can be called without arguments, so the font locking of "bare" calls to either is incorrect. The fix is to font-lock them as for other kernel methods which accepts zero or more arguments. In GNU Emacs 28.0.50 (build 1, x86_64-apple-darwin20.4.0, NS appkit-2022.44 Version 10.16 (Build 20E232)) Repository revision: 30d974bf5c02a1367291fbb6fa17a182bb7974b7 Repository branch: master Windowing system distributor 'Apple', version 10.3.2022 System Description: macOS 11.3 Configured using: 'configure --prefix=/nix/store/kvhx6vn5wvif4s9aiwp75v8pxplh19i2-emacs-gcc-20210502.0 --disable-build-details --with-modules --with-ns --disable-ns-self-contained --with-native-compilation CFLAGS=-DMAC_OS_X_VERSION_MAX_ALLOWED=101200' --=-=-= Content-Type: text/patch Content-Disposition: attachment; filename=0001-lisp-progmodes-ruby-mode.el-puts-and-printf-do-not-r.patch >From 6041b603c0a4cadbd1eaa92a2d9c0162bedbd939 Mon Sep 17 00:00:00 2001 From: Steve Purcell Date: Mon, 3 May 2021 12:54:53 +1200 Subject: [PATCH] lisp/progmodes/ruby-mode.el: puts and printf do not require args Both these methods can be called without arguments, so the font locking of "bare" calls to either is incorrect. The fix is to font-lock them as for other kernel methods which accepts zero or more arguments. --- lisp/progmodes/ruby-mode.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 35772827ce2..0c54a1d27a6 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -2127,11 +2127,9 @@ ruby-font-lock-keywords "loop" "open" "p" - "print" "printf" "proc" "putc" - "puts" "require" "require_relative" "spawn" @@ -2180,9 +2178,11 @@ ruby-font-lock-keywords "fork" "global_variables" "local_variables" + "print" "private" "protected" "public" + "puts" "raise" "rand" "readline" -- 2.31.1 --=-=-=--