Subject: bug#77326: [PATCH] Add symbol-mode

From: Gabriel Santos <[email-masked]>
Date: Sun, 13 Apr 2025 07:12:31 -0300

>So what do you suggest we do with this issue?  Are you still offering
>this mode for addition to Emacs?

Since superword-mode already does what this mode does, I think the mode
should be dropped.

Sorry about this, I just had subword-mode in mind instead so I didn't
look into it-despite them residing in the same file.

What I'm doing right now (the convention cycling function Ship
Mints mentioned) is only loosely related to this, so I don't
think this issue should remain open for that. Again, sorry
for wasting your maintainer time on discussing something
that is already built-in in Emacs.

If you want to read up on my progress with the convention
function, the below paragraphs are just on that.

I'm using kebab-case and PascalCase as tests. I managed to get
it working for the symbol at point and the region, but the logic
is inside a single function, so it's in
need of
some refactoring.

I also need to think of how to get the cycling working, but I
had another idea: a 
(major-mode . convention-function) alist to define the preferred
convention of a language, falling back to the function preferred
by the user if the mode doesn't have one. But seeing the changes that will be done to
eglot-server-programs, namely, to make it a "mode-local" variable,
maybe that doesn't seem like the correct approach.

There's also the integration with tree-sitter that Ship
Mints mentioned. Tree-sitter could be used in multiple applications
here. Maybe, instead of relying on the "symbol" regexp, the
mode's definition of an identifier would be used, if it were
to be found in the grammar? Or, perhaps, a tree-sitter-"conventionalize"
function that changes the convention of every identifier in the
buffer? I don't think the latter should exist before a
tree-sitter-rename does, in the likes of eglot-rename.

Other conventions, viz. pascalCase, SCREAMING_SNAKE_CASE
(I got the name from the Rust book, really like this one) would
require different logic, but shouldn't be difficult to implement.

And I think that was it on the convention function, so I'm signing this message off.

Regards,

-- 
Gabriel Santos