[Geany] Changed session handling and encoding changes

Enrico Tröger enrico.troeger at xxxxx
Fri Dec 7 14:37:29 UTC 2007


Hi,

since SVN r2093, Geany stores some more document-specific attributes
per session. This means, Geany will "remember" the filetype, the cursor
position, the read-only state, the used encoding, the use-tabs-setting,
the auto indentation setting and the line wrapping state per file which
is saved in the session. This affects also the project session files.
But this also means, your current session will be lost when starting
Geany the next time because the format of the saved session files has
changed. Sorry for that.
But especially saving the used encoding should increase the startup
speed of Geany slightly when non-UTF8 files are used(Geany doesn't
have to detect the file encoding again on startup but just read it
from the config).


Another new feature is the possibility to specify a file encoding in
the file itself to help Geany using the right one. This is useful for
e.g. files encoded in ISO-8859-15 which are mostly detected as
ISO-8859-1. There are some other encodings which are not detected
correctly. Geany scans for HTML meta tags like
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-15" />
and for Geany specific lines like
# geany_encoding=ISO-8859-15 #
geany_encoding must follow one or more whitespace characters and must
be followed by one or more whitespace characters. Other rules to get it
detected properly are mentioned in the manual[1].
For anyone interested, the used regular expression is:
"[\t ]geany_encoding=([a-z0-9-]+)[\t ]"
(if anyone can imrpove it, just tell me)

Basically, we could also add a regexp to scan for VIM's modelines(IIRC
there is a flag "fenc" for the file encding) but one have to write the
regexp ;-).

[1]
http://geany.uvena.de/manual/index.html#in-file-encoding-specification

Regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.key


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/users/attachments/20071207/b0f2a110/attachment.pgp>


More information about the Users mailing list