emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] etags: Add a small list of interpretors for Python


From: Iustin Pop
Subject: [PATCH] etags: Add a small list of interpretors for Python
Date: Thu, 19 Aug 2010 17:36:06 +0200
User-agent: Mutt/1.5.20 (2009-06-14)

Currently, etags has no interpretors defined for Python, which prevents
it from recognising Python scripts that have no extension. This patch
adds a small list of interpretors for this language, which while not
perfect (e.g. it will fail on specific versions like python2.4), it is
better than the current situation where all scripts without an extension
will default to Fortran.

Note: I debated adding a more detailed list, but it would get outdated
quickly, so I left just these three versions. A regular expression for
the interpreter name would be much better here, would implementing that
make sense?

[please keep me CC-ed, I'm not subscribed to the list]

=== modified file 'lib-src/etags.c'
*** lib-src/etags.c     2010-08-11 08:20:34 +0000
--- lib-src/etags.c     2010-08-19 13:27:43 +0000
*************** line.";
*** 755,760 ****
--- 755,762 ----
  
  static const char *Python_suffixes [] =
    { "py", NULL };
+ static const char *Python_interpreters [] =
+   { "python", "python2", "python3", NULL };
  static const char Python_help [] =
  "In Python code, `def' or `class' at the beginning of a line\n\
  generate a tag.";
*************** static language lang_names [] =
*** 836,842 ****
    { "postscript",PS_help,        PS_functions,      PS_suffixes        },
    { "proc",      no_lang_help,   plain_C_entries,   plain_C_suffixes   },
    { "prolog",    Prolog_help,    Prolog_functions,  Prolog_suffixes    },
!   { "python",    Python_help,    Python_functions,  Python_suffixes    },
    { "scheme",    Scheme_help,    Scheme_functions,  Scheme_suffixes    },
    { "tex",       TeX_help,       TeX_commands,      TeX_suffixes       },
    { "texinfo",   Texinfo_help,   Texinfo_nodes,     Texinfo_suffixes   },
--- 838,844 ----
    { "postscript",PS_help,        PS_functions,      PS_suffixes        },
    { "proc",      no_lang_help,   plain_C_entries,   plain_C_suffixes   },
    { "prolog",    Prolog_help,    Prolog_functions,  Prolog_suffixes    },
!   { 
"python",Python_help,Python_functions,Python_suffixes,NULL,Python_interpreters},
    { "scheme",    Scheme_help,    Scheme_functions,  Scheme_suffixes    },
    { "tex",       TeX_help,       TeX_commands,      TeX_suffixes       },
    { "texinfo",   Texinfo_help,   Texinfo_nodes,     Texinfo_suffixes   },




reply via email to

[Prev in Thread] Current Thread [Next in Thread]