all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: emacs-devel <emacs-devel@gnu.org>,
	Stefan Monnier <monnier@IRO.UMontreal.CA>
Subject: Re: Guidelines for the "symbol" syntax class
Date: Mon, 4 Jan 2016 02:46:02 +0200	[thread overview]
Message-ID: <5689C0CA.7050005@yandex.ru> (raw)
In-Reply-To: <m2io3amfvw.fsf@newartisans.com>

On 01/04/2016 12:56 AM, John Wiegley wrote:

> Does removing ':' from the symbol class for ruby solve all of your problems,
> and create no new ones? :)

I wish.

With fewer (hopefully none) false negatives returned by 
xref-collect-references, there will come more false positive matches.

One false negative comes to mind: if `:' is not a symbol constituent, 
and the user searches for all references to `:foo', using the current 
implementation, they will get none. The default input suggested by 
xref-find-references will be `foo', though (when point is on `:foo').

In completion, if we continue to simply collect all symbols from all 
buffers, the user will start typing a method name , try completion and 
will get offered the names of all method and Symbols they ever typed 
anywhere, in the code. While Symbols are used to refer to method names, 
they're also used for method keyword arguments (in Ruby 2.0+), and you 
even often see them in business logic. For instance, in most web 
applications there will be Symbols :username, :password, :account_id, 
and so on, referring to the HTTP request parameters. So, there will be a 
lot of false positives here as well.

I don't know how to fight that, except by using a smarter program, one 
that loads the application and/or parses the code, etc, but there will 
always be some use cases that are not handled by "smart" logic already 
written, and being able to write a quick-and-simple solution is often handy.

Further, I'm sure there are a lot of third-party packages out there, 
some of them language-agnostic, which deal with source code and use the 
notion of a symbol.

One example that I do use is `easy-kill'. If my cursor is at the end of 
a Symbol :foo, currently calling this command will select `:foo', 
including the colon, which is handy to be able to copy and paste, or 
kill, that value as a whole. If `:' is no longer a symbol constituent, 
either I'll have to live with always additionally typing or deleting 
these colons in that kind of situations, or will have to provide the 
"boundary of thing" info to easy-kill additionally somehow.

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?



  reply	other threads:[~2016-01-04  0:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-03  5:09 Guidelines for the "symbol" syntax class Dmitry Gutov
2016-01-03 22:56 ` John Wiegley
2016-01-04  0:46   ` Dmitry Gutov [this message]
2016-01-04  0:51     ` Stefan Monnier
2016-01-04  0:58       ` Dmitry Gutov
2016-01-04  1:13       ` John Yates
2016-01-04  1:18         ` Dmitry Gutov
     [not found]           ` <CAJnXXog5fO_h5UNnVR67EJtT+u7+G-BVMFV3FnJgK=weGj0m_w@mail.gmail.com>
2016-01-04  2:01             ` Dmitry Gutov
2016-01-04  0:55     ` John Wiegley
2016-01-04  1:14       ` Dmitry Gutov
2016-01-04  2:56         ` Stefan Monnier
2016-01-04  3:47           ` Dmitry Gutov
     [not found]     ` <CAJnXXogonsWpqadNpX0BijzoiztorYP1d=b31seBfvGVBwwT_Q@mail.gmail.com>
     [not found]       ` <5689CC5C.4000408@yandex.ru>
     [not found]         ` <CAJnXXojy1b6LUdXcC+cDVPYT-OJMXCE8m8yqObE9oUYwU_PGbg@mail.gmail.com>
2016-01-04  2:34           ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5689C0CA.7050005@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.