GNU bug report logs - #77326
[PATCH] Add symbol-mode

Previous Next

Package: emacs;

Reported by: Gabriel Santos <gabriel.santos.smtp <at> gmail.com>

Date: Fri, 28 Mar 2025 04:42:02 UTC

Severity: normal

Tags: patch

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Gabriel Santos <gabrielsantosdesouza <at> disroot.org>
To: Ship Mints <shipmints <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: Andrea Corallo <acorallo <at> gnu.org>, Gabriel Santos <gabriel.santos.smtp <at> gmail.com>, Stefan Monnier <monnier <at> iro.umontreal.ca>, 77326 <at> debbugs.gnu.org, Stefan Kangas <stefankangas <at> gmail.com>
Subject: bug#77326: [PATCH] Add symbol-mode
Date: Sat, 05 Apr 2025 11:10:48 -0300
>One nice feature this patch could have is to cycle among symbol naming
>conventions: CamelCase, snakeCase, hyphen-case, underscore_case (any
>others?) and that would make it convenient when a variable name with the
>same components are used across modalities; e.g. in config files, json,
>xml, protobufs, C/C++ vs. python, and in emacs-lisp-mode and Emacs C code,
>cycling among to Fsymbol_name or Ssymbol_name?

There are multiple packages like this[1, 2, 3, 4, 5, 6].

Despite that, I think I could give it a try, I just have to
avoid looking into them because of copyright.

So a comnand that changes between different symbol naming conventions,
Like how the capitalization commands work?

Point is "|":

>M-x cycle-convention-symbol
>|this-is-a-symbol
>thisIsASymbol|

>cycle among symbol naming conventions:

So subsequent calls would switch to another convention? I think this
would be ok if the point didn't move.

>M-x mark-sexp
>this-is-a-symbol
>M-x cycle-convention-symbol
>thisIsASymbol
>M-x cycle-convention-symbol
>this_is_a_symbol
>M-x cycle-convention-symbol
>ThisIsASymbol

Besides cycling, maybe choosing a convention with
completion?

>CamelCase, snakeCase, hyphen-case, underscore_case

This could be another issue. The names I know these as
are, respectively:

- PascalCase
- camelCase
- kebab-case (yes, really)
- snake_case

>There are multiple packages like this[1, 2, 3, 4, 5, 6].

Another interesting option would be to contact the author
of one of these packages for inclusion in this file.

[1] <https://github.com/HKey/caseformat>
[2] <https://hg.sr.ht/~zck/caser.el>
[3] <https://github.com/TakesxiSximada/change-case.el>
[4] <https://github.com/jcs-elpa/cycle-case-style>
[5] <https://codeberg.org/acdw/titlecase.el>
[6] <https://github.com/akicho8/string-inflection>

-- 
Gabriel Santos




This bug report was last modified 33 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.