Article View: gnu.emacs.bug
Article #98783bug in etags.c
From: John Palkovic
Date: Tue, 26 Feb 1991 03:06
Date: Tue, 26 Feb 1991 03:06
65 lines
2423 bytes
2423 bytes
I have long wondered why etags did not produce any output when I ran
it on my LaTeX files. Now I know. The first line of my files was
always something like:
% This is a -*-LaTeX-*- file, emacs!
In etags.c, TEX_mode() is the function that decides what your TeX
escape character is (either \ or !). TEX_mode said the escape
character was ! when confronted with a file beginning with the above
line. I modified it to skip from any %s to the start of the next line.
If the first line is a TeX comment, as is often the case, it will be
skipped. Context diffs follow for the etags.c sent with emacs-18.57.
It may patch the 18.5[56] etags.c also.
*** etags.c.orig Mon Feb 25 20:41:25 1991
--- etags.c Mon Feb 25 20:49:45 1991
***************
*** 1348,1353 ****
--- 1348,1354 ----
#define TEX_LESC '\\'
#define TEX_SESC '!'
+ #define TEX_cmt '%'
/* Figure out whether TeX's escapechar is '\\' or '!' and set grouping */
/* chars accordingly. */
***************
*** 1355,1365 ****
TEX_mode (f)
FILE *f;
{
! int c;
while ((c = getc (f)) != EOF)
! if (c == TEX_LESC || c == TEX_SESC)
! break;
if (c == TEX_LESC)
{
--- 1356,1374 ----
TEX_mode (f)
FILE *f;
{
! int c, skip_line = 0;
while ((c = getc (f)) != EOF)
! {
! /* Skip to next line if we hit the TeX comment char. */
! if (c == TEX_cmt)
! skip_line = 1;
! else if (c == '\n')
! skip_line = 0;
! else if (!skip_line)
! if (c == TEX_LESC || c == TEX_SESC )
! break;
! }
if (c == TEX_LESC)
{
--
palkovic@linac.fnal.gov || {royko,tellab5,simon}!linac!palkovic
Technical Details
Message-ID:
<7*~#9A_@linac.fnal.gov>Path:
arc1-ca.pugleaf.net!gmdzi!unido!fauern!ira.uka.de!sol.ctr.columbia.edu!emory!swrinde!zaphod.mps.ohio-state.edu!magnus.ircc.ohio-state.edu!tut.cis.ohio-state.edu!unreplyable!garbageShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,6597265ef3befe2f,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1991-02-26 10:00:09 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!fauern!ira.uka.de!sol.ctr.columbia.edu!emory!swrinde!zaphod.mps.ohio-state.edu!magnus.ircc.ohio-state.edu!tut.cis.ohio-state.edu!unreplyable!garbage From: palkovic@LINAC.FNAL.GOV (John Palkovic) Newsgroups: gnu.emacs.bug Subject: bug in etags.c Message-ID: <7*~#9A_@linac.fnal.gov> Date: 26 Feb 91 03:06:57 GMT Sender: daemon@tut.cis.ohio-state.edu Reply-To: "John Palkovic" <palkovic@linac.fnal.gov> Distribution: gnu Organization: Bob's School of Quantum Mechanics Lines: 65 Approved: bug-gnu-emacs@prep.ai.mit.edu