emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r110231: * src/lread.c (lisp_file_lex


From: Glenn Morris
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110231: * src/lread.c (lisp_file_lexically_bound_p): Handle #! lines.
Date: Fri, 28 Sep 2012 00:40:42 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110231
fixes bug: http://debbugs.gnu.org/12528
committer: Glenn Morris <address@hidden>
branch nick: trunk
timestamp: Fri 2012-09-28 00:40:42 -0700
message:
  * src/lread.c (lisp_file_lexically_bound_p): Handle #! lines.
modified:
  src/ChangeLog
  src/lread.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-09-27 23:02:23 +0000
+++ b/src/ChangeLog     2012-09-28 07:40:42 +0000
@@ -1,3 +1,7 @@
+2012-09-28  Glenn Morris  <address@hidden>
+
+       * lread.c (lisp_file_lexically_bound_p): Handle #! lines.  (Bug#12528)
+
 2012-09-27  Paul Eggert  <address@hidden>
 
        Check more robustly for timer_settime.

=== modified file 'src/lread.c'
--- a/src/lread.c       2012-09-23 08:44:20 +0000
+++ b/src/lread.c       2012-09-28 07:40:42 +0000
@@ -764,13 +764,28 @@
 
 /* Return true if the lisp code read using READCHARFUN defines a non-nil
    `lexical-binding' file variable.  After returning, the stream is
-   positioned following the first line, if it is a comment, otherwise
-   nothing is read.  */
+   positioned following the first line, if it is a comment or #! line,
+   otherwise nothing is read.  */
 
 static int
 lisp_file_lexically_bound_p (Lisp_Object readcharfun)
 {
   int ch = READCHAR;
+
+  if (ch == '#')
+    {
+      ch = READCHAR;
+      if (ch != '!')
+        {
+          UNREAD (ch);
+          UNREAD ('#');
+          return 0;
+        }
+      while (ch != '\n' && ch != EOF)
+        ch = READCHAR;
+      if (ch == '\n') ch = READCHAR;
+    }
+
   if (ch != ';')
     /* The first line isn't a comment, just give up.  */
     {


reply via email to

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