This patch converts the currently used groups like "Programming 
languages", "Scripting languages", etc. to groups based on the 
starting letter of the language only. There are two main reasons for this 
change:

1. Some languages are hard to categorize by some semantic group name and the 
group names are not really fitting. In addition, the currently used group name 
"Programming languages" isn't very good as "Scripting 
languages" are also a subset of programming languages. On the other hand 
it's hard to find a good substitute for "Programming languages" - 
mostly these are "Compiled languages" but not always and some 
languages allow to be both interpreted and compiled which complicates the 
situation.
2. The "Programming languages" group is too big and the menu is so 
long that it doesn't fit the display on smaller screens and one has to 
scroll the menu to get to the right item which isn't user friendly. Things 
will get only worse as there are still many "Programming languages" 
that Geany does not support yet and that might be added to the editor in the 
future.

The newly introduced alphabetic groups are:
```
A-B
C
D-E-F
G-H-I
J-K-L
M-N-O
P-Q
R-S
T-U-V-W
X-Y-Z
```

These allow roughly even distribution of existing languages into smaller groups 
with enough space for possible future language additions. While it would be 
possible to make the group names more symmetrical, e.g. by having 
"R-S-T", "U-V-W", I found that the asymmetry helps quicker 
navigation as one remembers the group with his favorite language is e.g. 
"the one before the long group" without thinking where exactly in the 
alphabet the letter is.

Some notes to the implementation:
1. It mostly follows the existing implementation trying to do minimal changes 
and doing things in a "dumb and straightforward way". This means that 
group names are hard coded (they could also be autogenerated, possibly 
auto-attempting to distribute languages into evenly sized groups).
2. Technically this change breaks API as it modifies GeanyFiletypeGroupID which 
is used for the group member of GeanyFiletype which is accessible to plugins. 
However, this member isn't documented to plugins and no existing plugin 
from geany-plugins uses it so probably not a big problem.
3. Because grouping happens automatically now, the [Groups] section from 
filetype_extensions.conf can be removed and is not read any more.
4. Because grouping happens automatically now, the [5] argument from FT_INIT() 
can be removed.
5. In addition, this patch also removes the [4] argument from FT_INIT() which 
determined the suffix in the filetype menu like "C++ source file" - 
IMO the "source file", "file", etc. suffix for all the 
languages in the menu introduced just a visual clutter and made legibility 
worse. In addition with the removal of [Groups] from filetype_extensions.conf 
in (3), it would not be possible to determine the right suffix for custom file 
types.
6. The newly introduced groups are untranslatable strings - there should be no 
need to translate those.

For some more context, see 
https://github.com/geany/geany/issues/3938#issuecomment-2394477313 and below.

A few screenshots with the new grouping:

<img width="595" alt="Screenshot 2024-10-06 at 14 35 12" 
src="https://github.com/user-attachments/assets/e4812d3b-50b6-4831-827f-0cf0e41e23e5">

<img width="787" alt="Screenshot 2024-10-06 at 14 36 18" 
src="https://github.com/user-attachments/assets/980c19a9-e59d-4cbf-8311-d32b237d5375">

<img width="865" alt="Screenshot 2024-10-06 at 14 37 18" 
src="https://github.com/user-attachments/assets/56829792-f244-46ae-9a6a-7d5f4b9b00e7">


You can view, comment on, or merge this pull request online at:

  https://github.com/geany/geany/pull/3977

-- Commit Summary --

  * Regroup filetypes by letter

-- File Changes --

    M data/filetype_extensions.conf (8)
    M src/dialogs.c (47)
    M src/filetypes.c (276)
    M src/filetypes.h (14)

-- Patch Links --

https://github.com/geany/geany/pull/3977.patch
https://github.com/geany/geany/pull/3977.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3977
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/pull/[email protected]>

Reply via email to