Gtk2::S...Manager(3)
๐ Gtk2::SourceView2::LanguageManager ๐
okay bestie, gather round, because this one is literally the keeper of all the languages โจ It's Gtk2::SourceView2::LanguageManager, straight out of the User Contributed Perl Documentation (that's the manual it lives in, for the record ๐). Think of it as the lil front desk that knows where every language definition file is hiding and can guess what language your file is in like it's reading your aura. ๐ฎ
๐ HIERARCHY ๐
so here's the family tree, and yes it's giving nepo baby but make it Glib:
Glib::Object
+----Gtk2::SourceView2::LanguageManager
โจ METHODS โจ
languagemanager = Gtk2::SourceView2::LanguageManager->newโ makes you a fresh new manager, blank slate, main character energy ๐languagemanager = Gtk2::SourceView2::LanguageManager->get_defaultโ hands you the shared default manager, the one everybody's already using. no need to build your own when the group chat already exists ๐ซถlanguage or undef = $lm->guess_language ($filename, $content_type=undef)โ the vibe check method ๐ give it a filename and it'll guess which language it is. returns the language, orundefif it's not picking up what you're putting down ๐ญ$filename(string or undef)$content_type(string or undef)
language or undef = $lm->get_language ($id)โ gimme the language for this exact id, no guessing involved. also can come backundefif that id isn't a thing ๐$id(string)
list = $lm->get_language_idsโ the full roster of every language id it's got. the whole squad list ๐list = $lm->get_search_pathโ shows you the list of directories where$lmgoes looking for language files. like showing you where it keeps its stuff ๐$lm->set_search_path (...)โ sets that list of directories where thelmlooks for language files. ๐บ๏ธ...(list)
okay so here's the tea โ โ if you pass no dirs at all (empty list), the search path gets cleared. But if you pass undef, the search path gets reset to the default. Two very different outcomes, don't mix them up bestie!!
Note: at the moment this function can only be called before the language files are loaded for the first time. In practice, to set a custom search path for a Gtk2::SourceLanguageManager, you have to call this function right after creating it. So do it immediately, no procrastinating, this is a now-or-never situation fr fr ๐ค
๐ PROPERTIES ๐
'language-ids'(Glib::Strv: defaultundef: readable) โ List of the ids of the available languages ๐'search-path'(Glib::Strv: defaultundef: readable / writable) โ List of directories where the language specification files (.lang) are located ๐ฆ
๐ SEE ALSO ๐
Gtk2::SourceView2Glib::Object
go read those too, iykyk ๐ธ
๐ COPYRIGHT ๐
Copyright (C) 2009 by Emmanuel Rodriguez
and that's the whole page, bestie!! this was brought to you by perl v5.42.0, dated 2025-07-25, and honestly? iconic. slay, periodt, go guess some languages ๐
โจ๐
๐ฆ where this page comes from
- fedora 43: perl-Gtk2-SourceView2 0.12-18.fc43 ยท GPL-2.0-or-later OR Artistic-2.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms