Just for 5 minutes of Python fun, the guard generation would be better with something like this:
'H_' + ''.join([c if c in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' else '_' for c in '{filename}'.upper().rstrip('.H')])
advantages:
- handles any character in the filename (most importantly dashes)
- use H_ as a prefix rather than a suffix, to avoid possible name
clashes with error codes (theoretically all uppercase names starting with E[A-Z] are reserved for them)
There is also a long standing convention to use uppercase filename with non-alphanumeric characters as _ so moving the H_ to the front would make Geany guards non-standard. I think despite the (very low) possibility of clashes with error codes it would be better to leave it the right way round as the default. The user can always hand edit if there is a clash.
PPS: maybe we should add some possibilities to support this with file templates, maybe providing {NORMALIZED_FILENAME} to allow guards generation?
There is a suggestion (lost?) somewhere in the system to add {FILENAME} for this but no one has had the time or inclination to do it.
Cheers Lex