original_docstring: Name may be a language name or a delegate name.
docstring: Name may be a language name or a delegate name.
docstring_tokens: Name may be a language name or a delegate name .
code: def init_mode(self, name):
          """Name may be a language name or a delegate name."""
          if not name:
              return False
          if name == 'latex':
              name = 'tex'
                  # #1088: use tex mode for both tex and latex.
          language, rulesetName = self.nameToRulesetName(name)
          if 'coloring' in g.app.debug and not g.unitTesting:
              print(f"language: {language!r}, rulesetName: {rulesetName!r}")
          bunch = self.modes.get(rulesetName)
          if bunch:
              if bunch.language == 'unknown-language':
                  return False
              self.initModeFromBunch(bunch)
              self.language = language  # 2011/05/30
              return True
          # Don't try to import a non-existent language.
          path = g.os_path_join(g.app.loadDir, '..', 'modes')
          fn = g.os_path_join(path, f"{language}.py")
          if g.os_path_exists(fn):
              mode = g.import_module(name=f"leo.modes.{language}")
          else:
              mode = None
          return self.init_mode_from_module(name, mode)
code_tokens: def init_mode ( self , name ) : if not name : return False if name == 'latex' : name = 'tex' language , rulesetName = self . nameToRulesetName ( name ) if 'coloring' in g . app . debug and not g . unitTesting : print ( f"language: {language!r}, rulesetName: {rulesetName!r}" ) bunch = self . modes . get ( rulesetName ) if bunch : if bunch . language == 'unknown-language' : return False self . initModeFromBunch ( bunch ) self . language = language return True path = g . os_path_join ( g . app . loadDir , '..' , 'modes' ) fn = g . os_path_join ( path , f"{language}.py" ) if g . os_path_exists ( fn ) : mode = g . import_module ( name = f"leo.modes.{language}" ) else : mode = None return self . init_mode_from_module ( name , mode )
short_docstring: Name may be a language name or a delegate name.
short_docstring_tokens: Name may be a language name or a delegate name .
comment: """Name may be a language name or a delegate name."""$SEP$# #1088: use tex mode for both tex and latex.$SEP$# 2011/05/30$SEP$# Don't try to import a non-existent language.