From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 01 02:23:30 2014 Received: (at submit) by debbugs.gnu.org; 1 Feb 2014 07:23:30 +0000 Received: from localhost ([127.0.0.1]:43714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9UvJ-0002BL-4V for submit@debbugs.gnu.org; Sat, 01 Feb 2014 02:23:29 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43867) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9UvF-0002BC-Uk for submit@debbugs.gnu.org; Sat, 01 Feb 2014 02:23:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9Uv6-0006vT-CL for submit@debbugs.gnu.org; Sat, 01 Feb 2014 02:23:25 -0500 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 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56647) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9Uv6-0006vO-8x for submit@debbugs.gnu.org; Sat, 01 Feb 2014 02:23:16 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9Uuy-0000W2-S4 for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2014 02:23:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9Uur-0006sn-F7 for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2014 02:23:08 -0500 Received: from mail-ee0-f41.google.com ([74.125.83.41]:44815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9Uur-0006sY-5w for bug-gnu-emacs@gnu.org; Sat, 01 Feb 2014 02:23:01 -0500 Received: by mail-ee0-f41.google.com with SMTP id e51so722583eek.28 for ; Fri, 31 Jan 2014 23:23:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-type; bh=1//PCp9mZGPjlnz5DGdJwO9yx06Lh0brYimEILP7ptE=; b=RPNYKCWX+gef8mnoENgRaqteFL6gNv7qniTIDqrn5tGbEz8QHWKu5CoZOOiOOIKVq0 GQJPi4cNyfIFOGdWoj6dG8NLw9nGH7IcHaAObLBX4IrvnNg7kjz6RGrlG76LpMlWg4c8 Y6rs7PDfda6hG16fbIVJImVy0cEcTdcmBW7kFuISdpVDDt20jiUG+kQm3xcdMLtRpHEG Jkrm8/GipRo4FTGOizaoA/S7PP9+4CgX7yuZy/JhGYzcdk5QUyd97C+4qNs90aOohUZp lskhM/Ym34+YtVAjwXNkNBu1Qde8vuA+WcOjbm7cphOdDLvL3jz0hALfh9CGR/NTnip5 K1Og== X-Gm-Message-State: ALoCoQmmUQc12Fff+EZhGnY8aSSHUAbZ7r2DXgDPuuQ/M556XOLeDuzFVBMiHCU1yK6wh1gPgHwq X-Received: by 10.14.203.197 with SMTP id f45mr178148eeo.90.1391239380374; Fri, 31 Jan 2014 23:23:00 -0800 (PST) Received: from Bozhidars-MacBook-Pro.local (93-152-182-45.ddns.onlinedirect.bg. [93.152.182.45]) by mx.google.com with ESMTPSA id 4sm46314567eed.14.2014.01.31.23.22.58 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 31 Jan 2014 23:22:59 -0800 (PST) Received: by Bozhidars-MacBook-Pro.local (Postfix, from userid 501) id 064367DB1982; Sat, 1 Feb 2014 09:22:56 +0200 (EET) From: Bozhidar Batsov To: bug-gnu-emacs@gnu.org Subject: 24.3.50; [ruby-mode] Variables named as built-in functions font-locked incorrectly Date: Sat, 01 Feb 2014 09:22:56 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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.15 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 (-----) In the following snippet `format` is font-locked as the built-in function, but it's actually a variable. respond_to do |format| format.json do # ... end end This problem obviously exists for all built-ins, but it's not a big issue in general, since most of them don't have names that are likely to be used as variable names. Not sure if we can have a simple solution for this problem without a parser, though. I guess we can have a check if the built-in methods have arguments (as most of them have). In GNU Emacs 24.3.50.1 (x86_64-apple-darwin13.0.0, NS apple-appkit-1265.00) of 2014-01-27 on Bozhidars-MacBook-Pro.local Windowing system distributor `Apple', version 10.3.1265 Configured using: `configure --prefix=/usr/local/Cellar/emacs/HEAD --without-dbus --enable-locallisppath=/usr/local/share/emacs/site-lisp --infodir=/usr/local/Cellar/emacs/HEAD/share/info/emacs --without-gnutls --with-ns --disable-ns-self-contained' Important settings: locale-coding-system: utf-8-unix Major mode: Ruby Minor modes in effect: diff-auto-refine-mode: t subword-mode: t ruby-tools-mode: t inf-ruby-minor-mode: t guru-mode: t erc-truncate-mode: t erc-spelling-mode: t erc-list-mode: t erc-menu-mode: t erc-autojoin-mode: t erc-ring-mode: t erc-networks-mode: t erc-pcomplete-mode: t erc-track-mode: t erc-match-mode: t erc-button-mode: t erc-fill-mode: t erc-stamp-mode: t erc-netsplit-mode: t erc-irccontrols-mode: t erc-noncommands-mode: t erc-move-to-prompt-mode: t erc-readonly-mode: t global-flycheck-mode: t flycheck-mode: t which-function-mode: t flx-ido-mode: t ido-ubiquitous-mode: t winner-mode: t global-undo-tree-mode: t undo-tree-mode: t whitespace-mode: t global-anzu-mode: t anzu-mode: t projectile-global-mode: t projectile-mode: t flyspell-mode: t volatile-highlights-mode: t global-hl-line-mode: t shell-dirtrack-mode: t recentf-mode: t savehist-mode: t show-smartparens-global-mode: t show-smartparens-mode: t smartparens-mode: t global-auto-revert-mode: t delete-selection-mode: t prelude-global-mode: t prelude-mode: t tooltip-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t size-indication-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: k e l y SPC o p e r a t o r s SPC w i t h SPC s p e C-x b * = = \ C-p C-p C-n / / C-x b O t h e r SPC s i m i l a r SPC o p e r a t o r s SPC l i k e SPC * , SPC / , SPC e t c SPC e x h i b i t SPC t h e SPC s a m e SPC p r o b l e m . C-p C-p C-x b + x SPC = SPC = SPC 5 SPC + SPC 1 0 C-a C-f C-f C-f C-f C-k y SPC + SPC z C-a C-SPC C-e M-w C-x o # # # C-y C-a SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC SPC C-e SPC # SPC t h i s SPC s h o u l d SPC n o t SPC b e SPC i n b a d SPC i n d e n t a t i o n C-c C-c y M-x Recent messages: Saving file /Users/bozhidar/projects/test.rb... Wrote /Users/bozhidar/projects/test.rb Mark set Auto-saving...done Mark set Send this bug report to the Emacs maintainers? (y or n) y Sending... Mark set [2 times] Sending via mail... Sending...done Load-path shadows: /Users/bozhidar/.emacs.d/elpa/flycheck-20140121.147/.dir-locals hides /usr/local/Cellar/emacs/HEAD/share/emacs/24.3.50/lisp/gnus/.dir-locals /Users/bozhidar/.emacs.d/elpa/tabulated-list-20120406.2251/tabulated-list hides /usr/local/Cellar/emacs/HEAD/share/emacs/24.3.50/lisp/emacs-lisp/tabulated-list Features: (shadow sort emacsbug ielm pcase mail-extr sgml-mode nxml-uchnm rng-xsd xsd-regexp rng-cmpct vc-annotate vc vc-dispatcher lisp-mnt network-stream starttls tls cider cider-mode cider-repl cider-eldoc cider-version clojure-test-mode cider-interaction arc-mode archive-mode cider-client nrepl-client cider-util ewoc clojure-mode-expansions clojure-mode inf-lisp ibuf-ext ibuffer conf-mode yaml-mode ace-jump-mode find-dired ffap url-parse url-vars hippie-exp misearch multi-isearch eieio-opt speedbar sb-image ezimage dframe mule-util markdown-mode noutline outline executable magit-key-mode magit view epa derived epg epg-config diff-mode git-rebase-mode git-commit-mode server log-edit message sendmail rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader pcvs-util add-log vc-git superword subword ruby-tools inf-ruby ruby-mode-expansions smartparens-ruby ruby-mode smie rainbow-mode color rainbow-delimiters elisp-slime-nav guru-mode prelude-key-chord key-chord prelude-xml nxml-mode-expansions html-mode-expansions smartparens-html rng-nxml rng-valid rng-loc rng-uri rng-parse nxml-parse rng-match rng-dt rng-util rng-pttrn nxml-ns nxml-mode nxml-outln nxml-rap nxml-util nxml-glyph nxml-enc xmltok prelude-web prelude-scss prelude-scheme prelude-ruby prelude-perl prelude-org prelude-js prelude-erc erc-truncate erc-autoaway erc-spelling erc-notify erc-log erc-list erc-menu erc-join erc-ring erc-networks erc-pcomplete erc-track erc-match erc-button erc-fill erc-stamp erc-netsplit erc-goodies erc erc-backend erc-compat prelude-emacs-lisp prelude-css prelude-common-lisp slime-autoloads prelude-clojure prelude-lisp prelude-c prelude-programming flycheck help-mode rx f which-func imenu prelude-ido smex flx-ido flx ido-ubiquitous warnings ido prelude-osx exec-path-from-shell prelude-global-keybindings prelude-editor winner undo-tree diff esh-var esh-io esh-cmd esh-opt esh-ext esh-proc esh-arg eldoc esh-groups eshell esh-module esh-mode esh-util re-builder whitespace browse-kill-ring midnight ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff dired-x dired anzu projectile pkg-info find-func grep compile s bookmark pp expand-region text-mode-expansions er-basic-expansions expand-region-custom expand-region-core flyspell ispell etags volatile-highlights hl-line windmove tramp-cache tramp-sh tramp tramp-compat auth-source gnus-util mm-util mail-prsvr password-cache tramp-loaddefs trampver shell pcomplete comint ansi-color ring format-spec recentf tree-widget wid-edit savehist saveplace diminish smartparens-config smartparens autorevert filenotify delsel prelude-mode easy-mmode edmacro kmacro prelude-core epl advice help-fns dash thingatpt prelude-ui zenburn-theme prelude-packages finder-inf ack-and-a-half-autoloads diminish-autoloads erlang-autoloads flx-ido-autoloads eieio byte-opt bytecomp byte-compile cconv eieio-core grizzl-autoloads key-chord-autoloads logito-autoloads info easymenu cl-macs gv move-text-autoloads paredit-autoloads pkg-info-autoloads puppet-mode-autoloads rainbow-delimiters-autoloads request-autoloads rubocop-autoloads volatile-highlights-autoloads yaml-mode-autoloads package cl cl-loaddefs cl-lib time-date tooltip electric uniquify ediff-hook vc-hooks lisp-float-type mwheel ns-win tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer 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 make-network-process cocoa ns multi-tty emacs) From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 01 10:19:25 2014 Received: (at 16610) by debbugs.gnu.org; 1 Feb 2014 15:19:25 +0000 Received: from localhost ([127.0.0.1]:45253 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9cLt-0006Lk-1t for submit@debbugs.gnu.org; Sat, 01 Feb 2014 10:19:25 -0500 Received: from mail-ea0-f182.google.com ([209.85.215.182]:64317) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9cLq-0006La-Vi for 16610@debbugs.gnu.org; Sat, 01 Feb 2014 10:19:23 -0500 Received: by mail-ea0-f182.google.com with SMTP id r15so2917955ead.27 for <16610@debbugs.gnu.org>; Sat, 01 Feb 2014 07:19:22 -0800 (PST) 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:content-type; bh=forD3Jgy8Ww6sjPYTUGTfwYW9PwV0sNEmMIug7LbqWA=; b=hqak7LPxpaZv/LZ0bp2eIv+sslMZIMwdNB+rCamS+1l3kKpRL3bQrJktbR47tO7QzD 53Z2ohlzGvXRst2oldM2ZpZvLY0d6LsjzWG2vVkOXXRq9pO30KvgOlGDQOl/eWlGRQyc KTp0BB9LxYTJA0k4/1iBmz8l9mNB+HKxycjoqtwfarWm8yZQiWekNHR386rPeruiIj5R P6gF7ElI6Iv0KVd++2qdzI5m+MEggHi4YD6xPWyW0aUECMFN/uYlAnzludstaSnEO0b4 PYMQH7DzeUYf+0MGffPs5e/eKL+Fo0xRUCejncxLwXnd5U3/Y6RbjrdyfjcGhJ7HK48U XGJQ== X-Received: by 10.15.109.196 with SMTP id cf44mr31633713eeb.12.1391267962005; Sat, 01 Feb 2014 07:19:22 -0800 (PST) Received: from axl (93-150-41.netrun.cytanet.com.cy. [93.109.150.41]) by mx.google.com with ESMTPSA id z49sm50607803eeo.10.2014.02.01.07.19.20 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sat, 01 Feb 2014 07:19:21 -0800 (PST) From: Dmitry Gutov To: Bozhidar Batsov Subject: Re: bug#16610: 24.3.50; [ruby-mode] Variables named as built-in functions font-locked incorrectly References: Date: Sat, 01 Feb 2014 17:19:17 +0200 In-Reply-To: (Bozhidar Batsov's message of "Sat, 01 Feb 2014 09:22:56 +0200") Message-ID: <87eh3moo7e.fsf@yandex.ru> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16610 Cc: 16610@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (/) Bozhidar Batsov writes: > In the following snippet `format` is font-locked as the built-in > function, but it's actually a variable. > > respond_to do |format| > format.json do > # ... > end > end > > This problem obviously exists for all built-ins, but it's not a big > issue in general, since most of them don't have names that are likely to > be used as variable names. Not sure if we can have a simple solution for > this problem without a parser, though. I guess we can have a check if > the built-in methods have arguments (as most of them have). A lot of them don't, though (or have no required arguments): __callee__, __dir__, __method__, binding, caller, block_given?, exit, exit!, raise, (s)rand, readline(s), sleep. Guess we can separate these, and for all others, check if they're followed by " *[]|,.)}]\\|$". From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 01 10:31:19 2014 Received: (at 16610) by debbugs.gnu.org; 1 Feb 2014 15:31:19 +0000 Received: from localhost ([127.0.0.1]:45271 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9cXO-0006fK-Vh for submit@debbugs.gnu.org; Sat, 01 Feb 2014 10:31:19 -0500 Received: from mail-ea0-f170.google.com ([209.85.215.170]:55872) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9cXM-0006fB-Cp for 16610@debbugs.gnu.org; Sat, 01 Feb 2014 10:31:17 -0500 Received: by mail-ea0-f170.google.com with SMTP id k10so2929893eaj.1 for <16610@debbugs.gnu.org>; Sat, 01 Feb 2014 07:31:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:message-id:in-reply-to:references:subject :mime-version:content-type; bh=YQ8jYlqeDll50phpjtCuLbCq4BWe/0mG/61LYGuFzxM=; b=wbw4ZgT7mzpaTxW2cI6gI1kqe+uG6bu5SnyjKUJmrZne/cYNPwWKoAm5ansTLaZBKX Wx+obl30NNbkRb1pw9vZRk1vmoHBrmRH+9qoSA2SvCOX9mNfFg8IRYmK9zayXqAr9fcQ u5iJTrjDcE9k1h6XmK+EOx+KQhpaZ+j3HmLv8RQDq083Dcw45Cb1h8X+Esu63FYTr/SF 9vatb/U1e3P/Wne4fevLajzNYY+ZmVN0n2lXT0VGP+TKQRIK3ebHKV8FXVtNWwm5MIvn 91Fiwgq8AwfE/Ro3FPXRIKRgN8Mp3rBelNFBshWKTVEAWaY0+kCgTg3+me/hvqDN3YuN HQIg== X-Received: by 10.15.55.193 with SMTP id v41mr2423417eew.80.1391268675607; Sat, 01 Feb 2014 07:31:15 -0800 (PST) Received: from [10.0.1.3] (93-152-182-45.ddns.onlinedirect.bg. [93.152.182.45]) by mx.google.com with ESMTPSA id k41sm40202822een.19.2014.02.01.07.31.13 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 01 Feb 2014 07:31:14 -0800 (PST) Date: Sat, 1 Feb 2014 17:31:12 +0200 From: Bozhidar Batsov To: Dmitry Gutov Message-ID: <6BA278AF18054533AC980400A5F5FD54@gmail.com> In-Reply-To: <87eh3moo7e.fsf@yandex.ru> References: <87eh3moo7e.fsf@yandex.ru> Subject: Re: bug#16610: 24.3.50; [ruby-mode] Variables named as built-in functions font-locked incorrectly X-Mailer: sparrow 1.6.4 (build 1178) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="52ed1340_8edbdab_1f1" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16610 Cc: 16610@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (/) --52ed1340_8edbdab_1f1 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday, =46ebruary 1, 2014 at 5:19 PM, Dmitry Gutov wrote: > Bozhidar Batsov = writes: > =20 > > In the following snippet =60format=60 is font-locked as the built-in > > function, but it's actually a variable. > > =20 > > respond=5Fto do =7Cformat=7C > > format.json do > > =23 ... > > end > > end > > =20 > > This problem obviously exists for all built-ins, but it's not a big > > issue in general, since most of them don't have names that are likely= to > > be used as variable names. Not sure if we can have a simple solution = for > > this problem without a parser, though. I guess we can have a check if= > > the built-in methods have arguments (as most of them have). > > =20 > =20 > =20 > A lot of them don't, though (or have no required arguments): =5F=5Fcall= ee=5F=5F, > =5F=5Fdir=5F=5F, =5F=5Fmethod=5F=5F, binding, caller, block=5Fgiven=3F,= exit, exit=21, raise, > (s)rand, readline(s), sleep. > =20 > Guess we can separate these, and for all others, check if they're > followed by =22 *=5B=5D=7C,.)=7D=5D=5C=5C=7C=24=22. > =20 > =20 Separating the methods sounds reasonable. Variables can=E2=80=99t end wit= h =3F, so block=5Fgiven=3F is always clear. Same goes for exit=21. Pretty= sure no one will ever name a var =5F=5Fxxx=5F=5F. =60binding=60 & =60cal= ler=60 seem the most likely names in the list to cause a problem like =60= format=60, since they=E2=80=99d be good variable names (at least in code = making use of metaprogramming). =20 --52ed1340_8edbdab_1f1 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
On Sa= turday, =46ebruary 1, 2014 at 5:19 PM, Dmitry Gutov wrote:
Bozhidar Batsov <bozhidar=40batsov.com> writes:

In the following= snippet =60format=60 is font-locked as the built-in
function, = but it's actually a variable.

respond=5Fto do =7C= format=7C
format.json do
=23 ...
en= d
end

This problem obviously exists fo= r all built-ins, but it's not a big
issue in general, since mos= t of them don't have names that are likely to
be used as variab= le names. Not sure if we can have a simple solution for
this pr= oblem without a parser, though. I guess we can have a check if
= the built-in methods have arguments (as most of them have).

A lot of them don't, though (or have no re= quired arguments): =5F=5Fcallee=5F=5F,
=5F=5Fdir=5F=5F, =5F=5Fm= ethod=5F=5F, binding, caller, block=5Fgiven=3F, exit, exit=21, raise,
(s)rand, readline(s), sleep.

Guess we can= separate these, and for all others, check if they're
followed = by =22 *=5B=5D=7C,.)=7D=5D=5C=5C=7C=24=22.
Separating the methods sounds reasonable. Variables can=E2=80= =99t end with =3F, so block=5Fgiven=3F is always clear. Same goes for exi= t=21. Pretty sure no one will ever name a var =5F=5Fxxx=5F=5F. =60binding= =60 & =60caller=60 seem the most likely names in the list to cause a = problem like =60format=60, since they=E2=80=99d be good variable names (a= t least in code making use of metaprogramming). 
=20

--52ed1340_8edbdab_1f1-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 01 11:29:20 2014 Received: (at 16610) by debbugs.gnu.org; 1 Feb 2014 16:29:20 +0000 Received: from localhost ([127.0.0.1]:45278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9dRX-00082K-Pk for submit@debbugs.gnu.org; Sat, 01 Feb 2014 11:29:20 -0500 Received: from mail-ea0-f171.google.com ([209.85.215.171]:61557) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9dRU-000828-Nk for 16610@debbugs.gnu.org; Sat, 01 Feb 2014 11:29:17 -0500 Received: by mail-ea0-f171.google.com with SMTP id f15so2929013eak.30 for <16610@debbugs.gnu.org>; Sat, 01 Feb 2014 08:29:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=TbxgBIMZ6ypy0FYkYJBi46ofsIGGQ6jKl6ejtYJvPo0=; b=Q4ljAEw8xhz884XX318upIoeL7MPbEu9/WvZ0ZD52KampjDM4xI5SMWjopeofhfDQc 8SZWlwEv7Le0PdssXJbBdB6iZZBzphCtiZygMaaiPdkzkDHfessR2MqM0P3ut3YR8sM0 qkqqpJ8Li7Me0pwJOzmjZjaaFUkZQO5l+pBTGFQMDGBL55WBnHeVVO042XYoUndAhDVX INRCuJe5JMLWolynF9vqmK1tfWDv/uDtSmt7WUv+MkFYjqxNJ6TEEXTVnCcWH9Lm5Uul vvbJsmk4F25xbf3bhlyWwj/5+FcUnc7kZoBqn1zR2ceYHewNpojkJvnc3pReaxvcVe58 DUvw== X-Received: by 10.15.53.133 with SMTP id r5mr56824eew.100.1391272155146; Sat, 01 Feb 2014 08:29:15 -0800 (PST) Received: from [192.168.10.2] (93-150-41.netrun.cytanet.com.cy. [93.109.150.41]) by mx.google.com with ESMTPSA id v7sm51048577eel.2.2014.02.01.08.29.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Feb 2014 08:29:14 -0800 (PST) Message-ID: <52ED20D6.5000300@yandex.ru> Date: Sat, 01 Feb 2014 18:29:10 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Bozhidar Batsov Subject: Re: bug#16610: 24.3.50; [ruby-mode] Variables named as built-in functions font-locked incorrectly References: <87eh3moo7e.fsf@yandex.ru> <6BA278AF18054533AC980400A5F5FD54@gmail.com> In-Reply-To: <6BA278AF18054533AC980400A5F5FD54@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16610 Cc: 16610@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 01.02.2014 17:31, Bozhidar Batsov wrote: > Variables can’t end with ?, so > block_given? is always clear. Same goes for exit!. Pretty sure no one > will ever name a var __xxx__. Good points. > `binding` & `caller` seem the most likely > names in the list to cause a problem like `format`, since they’d be good > variable names (at least in code making use of metaprogramming). Still not very likely, though (e.g. compared to `format`, which is in every other Rails tutorial). And anyone doing metaprogramming should be aware of these two, and would probably name their vars differently. I have a patch ready, but here's what I'm not sure about: if the built-in method that requires arguments is followed by (maybe whitespace and) newline, do we highlight it? If yes, we'll have false positives when a local variable with that name is at a line by itself, maybe on the last line of a method, so that its value is returned. If no, any such built-in won't be highlighted until the user types in the first argument, which is also suboptimal (if I made a typo, I'll have to go back a longer distance). From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 01 11:47:51 2014 Received: (at 16610) by debbugs.gnu.org; 1 Feb 2014 16:47:51 +0000 Received: from localhost ([127.0.0.1]:45282 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9djS-0008U2-T8 for submit@debbugs.gnu.org; Sat, 01 Feb 2014 11:47:51 -0500 Received: from mail-ea0-f179.google.com ([209.85.215.179]:51652) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9djR-0008Tu-0Y for 16610@debbugs.gnu.org; Sat, 01 Feb 2014 11:47:49 -0500 Received: by mail-ea0-f179.google.com with SMTP id q10so2423922ead.24 for <16610@debbugs.gnu.org>; Sat, 01 Feb 2014 08:47:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:message-id:in-reply-to:references:subject :mime-version:content-type; bh=wEYGhdBbyyQ8Jyt61krynO7x1RfnUvREnEZKy+TZ/OQ=; b=sDkhR74/N/BnpRwounCEZB+v4DYfu3zqDHSk+cqePitGGrB7pwKYce5M90uEUi5gWi ceN0iDOVJadKizDvLmKxI2HT8KauSTRz7GjzbQfj2Frge8Ha+Y/A6BL0b2pHSgaLu2lR bTDvSBsIX9vkWgGb1MzGScUJdMEB1SPF1kj0xM5G0TPBCBNCjyiV6PQ5s6/cVD/WUKl2 5xYE7kATlfFRahYmO7Q/KNfmfmJSAmLQgGm2Ca21evSmvj41OpQCiG4VA5WSg5ZlG98F xVse/lkVGHfwpKbQZpWebq8/MFf/YyW/Ew9j/hvboOuD2QvT3foFGYlFWsgX27dyGp5v 9QHg== X-Received: by 10.14.127.72 with SMTP id c48mr31981403eei.16.1391273268210; Sat, 01 Feb 2014 08:47:48 -0800 (PST) Received: from [10.0.1.8] (93-152-182-45.ddns.onlinedirect.bg. [93.152.182.45]) by mx.google.com with ESMTPSA id d9sm25098529eei.9.2014.02.01.08.47.46 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 01 Feb 2014 08:47:47 -0800 (PST) Date: Sat, 1 Feb 2014 18:47:43 +0200 From: Bozhidar Batsov To: Dmitry Gutov Message-ID: <2461E4B67652483FB1E4176FAFD3BC5F@gmail.com> In-Reply-To: <52ED20D6.5000300@yandex.ru> References: <87eh3moo7e.fsf@yandex.ru> <6BA278AF18054533AC980400A5F5FD54@gmail.com> <52ED20D6.5000300@yandex.ru> Subject: Re: bug#16610: 24.3.50; [ruby-mode] Variables named as built-in functions font-locked incorrectly X-Mailer: sparrow 1.6.4 (build 1178) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="52ed252f_116ae494_c8" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16610 Cc: 16610@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (/) --52ed252f_116ae494_c8 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday, =46ebruary 1, 2014 at 6:29 PM, Dmitry Gutov wrote: > On 01.02.2014 17:31, Bozhidar Batsov wrote: > > Variables can=E2=80=99t end with =3F, so > > block=5Fgiven=3F is always clear. Same goes for exit=21. Pretty sure = no one > > will ever name a var =5F=5Fxxx=5F=5F. > > =20 > =20 > =20 > Good points. > =20 > > =60binding=60 & =60caller=60 seem the most likely > > names in the list to cause a problem like =60format=60, since they=E2= =80=99d be good > > variable names (at least in code making use of metaprogramming). > > =20 > =20 > =20 > Still not very likely, though (e.g. compared to =60format=60, which is = in =20 > every other Rails tutorial). And anyone doing metaprogramming should be= =20 > aware of these two, and would probably name their vars differently. > =20 > I have a patch ready, but here's what I'm not sure about: if the =20 > built-in method that requires arguments is followed by (maybe whitespac= e =20 > and) newline, do we highlight it=3F > =20 > If yes, we'll have false positives when a local variable with that name= =20 > is at a line by itself, maybe on the last line of a method, so that its= =20 > value is returned. > =20 > If no, any such built-in won't be highlighted until the user types in =20 > the first argument, which is also suboptimal (if I made a typo, I'll =20 > have to go back a longer distance). > =20 > =20 I=E2=80=99d say that the second option is better, since it won=E2=80=99t = cause false positives. =20 This would also take care of an annoying bit regarding the =60p=60 built-= in - each time you start typing something that starts with =E2=80=9Cp=22 the =E2=80=9Cp=E2=80=9D b= riefly gets font-locked as built-in, before the following letter is inser= ted. =20 --52ed252f_116ae494_c8 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
On Sa= turday, =46ebruary 1, 2014 at 6:29 PM, Dmitry Gutov wrote:
On 01.02.2014 17:31, Bozhidar Ba= tsov wrote:
Variables can=E2= =80=99t end with =3F, so
block=5Fgiven=3F is always clear. Same= goes for exit=21. Pretty sure no one
will ever name a var =5F=5F= xxx=5F=5F.

Good points.
=

=60binding=60 &= ; =60caller=60 seem the most likely
names in the list to cause = a problem like =60format=60, since they=E2=80=99d be good
varia= ble names (at least in code making use of metaprogramming).

Still not very likely, though (e.g. compar= ed to =60format=60, which is in
every other Rails tutorial). A= nd anyone doing metaprogramming should be
aware of these two, = and would probably name their vars differently.

= I have a patch ready, but here's what I'm not sure about: if the
built-in method that requires arguments is followed by (maybe whitespa= ce
and) newline, do we highlight it=3F

If yes, we'll have false positives when a local variable with that name=
is at a line by itself, maybe on the last line of a method, s= o that its
value is returned.

If no, = any such built-in won't be highlighted until the user types in
the first argument, which is also suboptimal (if I made a typo, I'll
have to go back a longer distance).
=20 =20 =20 =20
=20
I=E2=80=99d say that = the second option is better, since it won=E2=80=99t cause false positives= .
This would als= o take care of an annoying bit regarding the =60p=60 built-in - each time= you start
typing someth= ing that starts with =E2=80=9Cp=22 the =E2=80=9Cp=E2=80=9D brie= fly gets font-locked as built-in, before the following letter is inserted= . 

--52ed252f_116ae494_c8-- From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 01 12:09:24 2014 Received: (at 16610-done) by debbugs.gnu.org; 1 Feb 2014 17:09:24 +0000 Received: from localhost ([127.0.0.1]:45291 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9e4J-0000a0-Pb for submit@debbugs.gnu.org; Sat, 01 Feb 2014 12:09:24 -0500 Received: from mail-ea0-f180.google.com ([209.85.215.180]:48005) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1W9e4H-0000Zr-6I for 16610-done@debbugs.gnu.org; Sat, 01 Feb 2014 12:09:21 -0500 Received: by mail-ea0-f180.google.com with SMTP id o10so2926103eaj.39 for <16610-done@debbugs.gnu.org>; Sat, 01 Feb 2014 09:09:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=3v/hNed/1M4uHefJrBkLNQfLqyifQ4iHz4ycicTCpog=; b=dKjKM+OZ8jDma3BIXJt9uavnX56hJ1X8+v1U2u9z2nnMbNCL2VbRCMJMLprKkppAi0 R5D7S+j++irE+85aWqxxC87nsTwW1BHHWfol2QuSSY3trNzBJYn6ViN/4rOaOhho0nQ0 yp7RPUVjQXP1ZC5Qkn34GFFKBoelgQdrFgQVIIWI24jMwbMHqCD1W9gKOp55D7HLaV/g XcYOeHICKUN88ekW2qLBgtqSkmJCsPCELt8POjdauY/r4qV3YFVW5s8efBSSB/FkqAks Shk/FonkMHfzC8cFmSLCjbkXtCboJN5YY6z0ydPPh7r19q5KJfkjSYQKzt5bOf1gA/jS qpmg== X-Received: by 10.14.218.7 with SMTP id j7mr141745eep.107.1391274560380; Sat, 01 Feb 2014 09:09:20 -0800 (PST) Received: from [192.168.10.2] (93-150-41.netrun.cytanet.com.cy. [93.109.150.41]) by mx.google.com with ESMTPSA id k41sm51402349eey.0.2014.02.01.09.09.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 01 Feb 2014 09:09:19 -0800 (PST) Message-ID: <52ED2A3C.2090001@yandex.ru> Date: Sat, 01 Feb 2014 19:09:16 +0200 From: Dmitry Gutov User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Bozhidar Batsov Subject: Re: bug#16610: 24.3.50; [ruby-mode] Variables named as built-in functions font-locked incorrectly References: <87eh3moo7e.fsf@yandex.ru> <6BA278AF18054533AC980400A5F5FD54@gmail.com> <52ED20D6.5000300@yandex.ru> <2461E4B67652483FB1E4176FAFD3BC5F@gmail.com> In-Reply-To: <2461E4B67652483FB1E4176FAFD3BC5F@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 16610-done Cc: 16610-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 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 (/) Version: 24.4 On 01.02.2014 18:47, Bozhidar Batsov wrote: > I’d say that the second option is better, since it won’t cause false > positives. > This would also take care of an annoying bit regarding the `p` built-in > - each time you start > typing something that starts with “p" the “p” briefly gets font-locked > as built-in, before the following letter is inserted. Yeah, okay. I haven't noticed this problem with "p" yet, but probably would, from now on. Installed, with the caveat that the regexp doesn't take care of binary operations and keywords. Have to leave space for future improvement. :) From unknown Thu Jun 19 14:05:04 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, 02 Mar 2014 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