From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Wiegley Newsgroups: gmane.emacs.devel Subject: Re: Guidelines for the "symbol" syntax class Date: Sun, 03 Jan 2016 16:55:44 -0800 Message-ID: References: <5688AD13.7050904@yandex.ru> <5689C0CA.7050005@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1451868979 5075 80.91.229.3 (4 Jan 2016 00:56:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 4 Jan 2016 00:56:19 +0000 (UTC) Cc: Stefan Monnier , emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 04 01:56:14 2016 Return-path: Envelope-to: ged-emacs-devel@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 1aFtRW-0004Fs-3t for ged-emacs-devel@m.gmane.org; Mon, 04 Jan 2016 01:56:14 +0100 Original-Received: from localhost ([::1]:43433 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFtRS-0002qu-B3 for ged-emacs-devel@m.gmane.org; Sun, 03 Jan 2016 19:56:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFtRP-0002qo-G0 for emacs-devel@gnu.org; Sun, 03 Jan 2016 19:56:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aFtRM-0007UY-9j for emacs-devel@gnu.org; Sun, 03 Jan 2016 19:56:07 -0500 Original-Received: from mail-pf0-x233.google.com ([2607:f8b0:400e:c00::233]:33299) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aFtRM-0007UU-37 for emacs-devel@gnu.org; Sun, 03 Jan 2016 19:56:04 -0500 Original-Received: by mail-pf0-x233.google.com with SMTP id q63so157159288pfb.0 for ; Sun, 03 Jan 2016 16:56:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:date:message-id:references :user-agent:mail-followup-to:mime-version:content-type; bh=3asnXs+YAi9sDo00xhw8K13jkLtbKbpEkPGRhb5WmCU=; b=s74Wp5hzpa0LvaFtTtmJyQAu9tofMW0a0kmflMoIVrH2r5PbpLwtqjlcZkmvtGNEQw PKwiwDxrETeyuB2AG+tEjL3FgfR2+AyyR8K2x4BzZZixYhCwoyT5ANVfX+iLEGRMpsgS YddObCvkxm7yRPep05a5KMdgissnm5EVqOJbhjN0DN3VTKx4cut4Os8EQkHe45Gwey0w 7xRPWIjBJuwi95GUALPMWg87YAXA3WfHrIMEg2xHKMpRnAsMANE0P6OvY60zl1qUkgw8 /FSDWM2OycKp5VAoFuMQMhc2PkbSX6olwkR8O+sRrh4Alko23WDLlvzrQjC/ADz/RBOZ AWvA== X-Received: by 10.98.42.75 with SMTP id q72mr125078873pfq.10.1451868963383; Sun, 03 Jan 2016 16:56:03 -0800 (PST) Original-Received: from Vulcan.local (76-234-68-79.lightspeed.frokca.sbcglobal.net. [76.234.68.79]) by smtp.gmail.com with ESMTPSA id r90sm116560188pfi.80.2016.01.03.16.56.02 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 03 Jan 2016 16:56:02 -0800 (PST) X-Google-Original-From: "John Wiegley" Original-Received: by Vulcan.local (Postfix, from userid 501) id 14BE91201302B; Sun, 3 Jan 2016 16:56:02 -0800 (PST) In-Reply-To: <5689C0CA.7050005@yandex.ru> (Dmitry Gutov's message of "Mon, 4 Jan 2016 02:46:02 +0200") User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/24.5 (darwin) Mail-Followup-To: Dmitry Gutov , emacs-devel , Stefan Monnier X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::233 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:197544 Archived-At: >>>>> Dmitry Gutov writes: > That's why I'm asking if there are any existing guidelines, formal or > informal, that I can take into consideration. That might also inform changes > to xref-collection-references and company-dabbrev-code; not just ruby-mode. > Would anyone care for another wall of text? I suppose my informal guideline is to implement a strategy that works best for the mode you want to derive information from, and to not expect syntax classes to be a capable enough interface. I'd expect Ruby symbols to include ":", personally. A::B is the qualified name of a symbol -- although "B" is technically an unqualified symbol in its own right within that qualified name. Better yet, define a more general API that all modes can use, since many modes struggle with these same issues (imenu, thing-at-pt, dabbrev, etc). This echoes back to our long IDE thread. Perhaps we need layered, semantically- defined classes, such that a given text position might occur within many such layers (for example, selection might choose B, A::B, or A::B.foo, depending on how many times I smash the "select current" key). -- John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2