aboutsummaryrefslogtreecommitdiffstats
path: root/lib-src
diff options
context:
space:
mode:
authorBill Wohler2012-12-08 17:19:00 -0800
committerBill Wohler2012-12-08 17:19:00 -0800
commite1b489df7af8f7034f8c2ef275b786e93a39df31 (patch)
tree2edc9307185e2c77b98fe75f6d7eb0476c58c7e3 /lib-src
parentce974958f93ffa2e1bd01b4dd85dcb8ec1395787 (diff)
parentc6c08d3f8fe4d2c9e588189e46d60a30ef3e8d20 (diff)
downloademacs-e1b489df7af8f7034f8c2ef275b786e93a39df31.tar.gz
emacs-e1b489df7af8f7034f8c2ef275b786e93a39df31.zip
Merge from trunk; up to 2012-12-09T01:04:43Z!rgm@gnu.org.
Diffstat (limited to 'lib-src')
-rw-r--r--lib-src/ChangeLog16
-rw-r--r--lib-src/etags.c48
-rw-r--r--lib-src/movemail.c18
3 files changed, 63 insertions, 19 deletions
diff --git a/lib-src/ChangeLog b/lib-src/ChangeLog
index b85ba12a5b2..480ddabd44a 100644
--- a/lib-src/ChangeLog
+++ b/lib-src/ChangeLog
@@ -1,3 +1,19 @@
12012-12-02 Kevin Ryde <user42@zip.com.au>
2
3 * etags.c (Lisp_functions): Skip (defvar foo) declarations unless
4 the --declarations flag is enabled (Bug#5600).
5 (Lisp_help): Update.
6 (skip_name): New function.
7
82012-12-01 Kevin Ryde <user42@zip.com.au>
9
10 * etags.c (Perl_functions): Support "use constant" (Bug#5055).
11
122012-11-27 Paul Eggert <eggert@cs.ucla.edu>
13
14 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
15 * movemail.c (main): Assume EAGAIN and EBUSY.
16
12012-11-23 Paul Eggert <eggert@cs.ucla.edu> 172012-11-23 Paul Eggert <eggert@cs.ucla.edu>
2 18
3 movemail: treat EACCES etc. failures as permanent 19 movemail: treat EACCES etc. failures as permanent
diff --git a/lib-src/etags.c b/lib-src/etags.c
index b6af17b8edf..d393c4d2e4a 100644
--- a/lib-src/etags.c
+++ b/lib-src/etags.c
@@ -353,6 +353,7 @@ static void put_entries (node *);
353static char *concat (const char *, const char *, const char *); 353static char *concat (const char *, const char *, const char *);
354static char *skip_spaces (char *); 354static char *skip_spaces (char *);
355static char *skip_non_spaces (char *); 355static char *skip_non_spaces (char *);
356static char *skip_name (char *);
356static char *savenstr (const char *, int); 357static char *savenstr (const char *, int);
357static char *savestr (const char *); 358static char *savestr (const char *);
358static char *etags_strchr (const char *, int); 359static char *etags_strchr (const char *, int);
@@ -619,7 +620,8 @@ static const char Lisp_help [] =
619"In Lisp code, any function defined with `defun', any variable\n\ 620"In Lisp code, any function defined with `defun', any variable\n\
620defined with `defvar' or `defconst', and in general the first\n\ 621defined with `defvar' or `defconst', and in general the first\n\
621argument of any expression that starts with `(def' in column zero\n\ 622argument of any expression that starts with `(def' in column zero\n\
622is a tag."; 623is a tag.\n\
624The `--declarations' option tags \"(defvar foo)\" constructs too.";
623 625
624static const char *Lua_suffixes [] = 626static const char *Lua_suffixes [] =
625 { "lua", "LUA", NULL }; 627 { "lua", "LUA", NULL };
@@ -4269,6 +4271,7 @@ Asm_labels (FILE *inf)
4269/* 4271/*
4270 * Perl support 4272 * Perl support
4271 * Perl sub names: /^sub[ \t\n]+[^ \t\n{]+/ 4273 * Perl sub names: /^sub[ \t\n]+[^ \t\n{]+/
4274 * /^use constant[ \t\n]+[^ \t\n{=,;]+/
4272 * Perl variable names: /^(my|local).../ 4275 * Perl variable names: /^(my|local).../
4273 * Original code by Bart Robinson <lomew@cs.utah.edu> (1995) 4276 * Original code by Bart Robinson <lomew@cs.utah.edu> (1995)
4274 * Additions by Michael Ernst <mernst@alum.mit.edu> (1997) 4277 * Additions by Michael Ernst <mernst@alum.mit.edu> (1997)
@@ -4291,9 +4294,10 @@ Perl_functions (FILE *inf)
4291 } 4294 }
4292 else if (LOOKING_AT (cp, "sub")) 4295 else if (LOOKING_AT (cp, "sub"))
4293 { 4296 {
4294 char *pos; 4297 char *pos, *sp;
4295 char *sp = cp;
4296 4298
4299 subr:
4300 sp = cp;
4297 while (!notinname (*cp)) 4301 while (!notinname (*cp))
4298 cp++; 4302 cp++;
4299 if (cp == sp) 4303 if (cp == sp)
@@ -4316,8 +4320,21 @@ Perl_functions (FILE *inf)
4316 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4320 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4317 free (name); 4321 free (name);
4318 } 4322 }
4323 }
4324 else if (LOOKING_AT (cp, "use constant")
4325 || LOOKING_AT (cp, "use constant::defer"))
4326 {
4327 /* For hash style multi-constant like
4328 use constant { FOO => 123,
4329 BAR => 456 };
4330 only the first FOO is picked up. Parsing across the value
4331 expressions would be difficult in general, due to possible nested
4332 hashes, here-documents, etc. */
4333 if (*cp == '{')
4334 cp = skip_spaces (cp+1);
4335 goto subr;
4319 } 4336 }
4320 else if (globals) /* only if we are tagging global vars */ 4337 else if (globals) /* only if we are tagging global vars */
4321 { 4338 {
4322 /* Skip a qualifier, if any. */ 4339 /* Skip a qualifier, if any. */
4323 bool qual = LOOKING_AT (cp, "my") || LOOKING_AT (cp, "local"); 4340 bool qual = LOOKING_AT (cp, "my") || LOOKING_AT (cp, "local");
@@ -4732,6 +4749,19 @@ Lisp_functions (FILE *inf)
4732 if (dbp[0] != '(') 4749 if (dbp[0] != '(')
4733 continue; 4750 continue;
4734 4751
4752 /* "(defvar foo)" is a declaration rather than a definition. */
4753 if (! declarations)
4754 {
4755 char *p = dbp + 1;
4756 if (LOOKING_AT (p, "defvar"))
4757 {
4758 p = skip_name (p); /* past var name */
4759 p = skip_spaces (p);
4760 if (*p == ')')
4761 continue;
4762 }
4763 }
4764
4735 if (strneq (dbp+1, "def", 3) || strneq (dbp+1, "DEF", 3)) 4765 if (strneq (dbp+1, "def", 3) || strneq (dbp+1, "DEF", 3))
4736 { 4766 {
4737 dbp = skip_non_spaces (dbp); 4767 dbp = skip_non_spaces (dbp);
@@ -6292,6 +6322,16 @@ skip_non_spaces (char *cp)
6292 return cp; 6322 return cp;
6293} 6323}
6294 6324
6325/* Skip any chars in the "name" class.*/
6326static char *
6327skip_name (char *cp)
6328{
6329 /* '\0' is a notinname() so loop stops there too */
6330 while (! notinname (*cp))
6331 cp++;
6332 return cp;
6333}
6334
6295/* Print error message and exit. */ 6335/* Print error message and exit. */
6296void 6336void
6297fatal (const char *s1, const char *s2) 6337fatal (const char *s1, const char *s2)
diff --git a/lib-src/movemail.c b/lib-src/movemail.c
index 264b3d292c6..f2b2484c8e3 100644
--- a/lib-src/movemail.c
+++ b/lib-src/movemail.c
@@ -430,22 +430,10 @@ main (int argc, char **argv)
430 for certain failure codes. */ 430 for certain failure codes. */
431 if (status < 0) 431 if (status < 0)
432 { 432 {
433 if (++lockcount <= 5) 433 if (++lockcount <= 5 && (errno == EAGAIN || errno == EBUSY))
434 { 434 {
435#ifdef EAGAIN 435 sleep (1);
436 if (errno == EAGAIN) 436 goto retry_lock;
437 {
438 sleep (1);
439 goto retry_lock;
440 }
441#endif
442#ifdef EBUSY
443 if (errno == EBUSY)
444 {
445 sleep (1);
446 goto retry_lock;
447 }
448#endif
449 } 437 }
450 438
451 pfatal_with_name (inname); 439 pfatal_with_name (inname);