diff options
| author | Richard M. Stallman | 1995-07-21 22:39:46 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-07-21 22:39:46 +0000 |
| commit | 821d417e039c368e6ca8c001a4f0fd93c303fc6c (patch) | |
| tree | 4d34037592c5323fe1df3305ef8ef846e47efce5 /src | |
| parent | dec4e22e1d8e68098661b1554966c6e92dbdca86 (diff) | |
| download | emacs-821d417e039c368e6ca8c001a4f0fd93c303fc6c.tar.gz emacs-821d417e039c368e6ca8c001a4f0fd93c303fc6c.zip | |
(read_list): When a file loaded from site-init.el uses #$,
turn it into a relative file name starting with ../lisp.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lread.c | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/src/lread.c b/src/lread.c index 6995274de5e..05ba7a5285a 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -1564,7 +1564,9 @@ read_list (flag, readcharfun) | |||
| 1564 | Lisp_Object val, tail; | 1564 | Lisp_Object val, tail; |
| 1565 | register Lisp_Object elt, tem; | 1565 | register Lisp_Object elt, tem; |
| 1566 | struct gcpro gcpro1, gcpro2; | 1566 | struct gcpro gcpro1, gcpro2; |
| 1567 | int cancel = 0; | 1567 | /* 0 is the normal case. |
| 1568 | 1 means this list is a doc reference; replace it with the number 0. */ | ||
| 1569 | int doc_reference = 0; | ||
| 1568 | 1570 | ||
| 1569 | /* Initialize this to 1 if we are reading a list. */ | 1571 | /* Initialize this to 1 if we are reading a list. */ |
| 1570 | int first_in_list = flag <= 0; | 1572 | int first_in_list = flag <= 0; |
| @@ -1581,13 +1583,25 @@ read_list (flag, readcharfun) | |||
| 1581 | 1583 | ||
| 1582 | first_in_list = 0; | 1584 | first_in_list = 0; |
| 1583 | 1585 | ||
| 1584 | /* If purifying, and the list starts with #$, | 1586 | /* While building, if the list starts with #$, treat it specially. */ |
| 1585 | return 0 instead. This is a doc string reference | ||
| 1586 | and it will be replaced anyway by Snarf-documentation, | ||
| 1587 | so don't waste pure space with it. */ | ||
| 1588 | if (EQ (elt, Vload_file_name) | 1587 | if (EQ (elt, Vload_file_name) |
| 1589 | && !NILP (Vpurify_flag) && NILP (Vdoc_file_name)) | 1588 | && !NILP (Vpurify_flag)) |
| 1590 | cancel = 1; | 1589 | { |
| 1590 | if (NILP (Vdoc_file_name)) | ||
| 1591 | /* We have not yet called Snarf-documentation, so assume | ||
| 1592 | this file is described in the DOC-MM.NN file | ||
| 1593 | and Snarf-documentation will fill in the right value later. | ||
| 1594 | For now, replace the whole list with 0. */ | ||
| 1595 | doc_reference = 1; | ||
| 1596 | else | ||
| 1597 | /* We have already called Snarf-documentation, so make a relative | ||
| 1598 | file name for this file, so it can be found properly | ||
| 1599 | in the installed Lisp directory. | ||
| 1600 | We don't use Fexpand_file_name because that would make | ||
| 1601 | the directory absolute now. */ | ||
| 1602 | elt = concat2 (build_string ("../lisp/"), | ||
| 1603 | Ffile_name_nondirectory (elt)); | ||
| 1604 | } | ||
| 1591 | 1605 | ||
| 1592 | if (ch) | 1606 | if (ch) |
| 1593 | { | 1607 | { |
| @@ -1595,7 +1609,8 @@ read_list (flag, readcharfun) | |||
| 1595 | { | 1609 | { |
| 1596 | if (ch == ']') | 1610 | if (ch == ']') |
| 1597 | return val; | 1611 | return val; |
| 1598 | Fsignal (Qinvalid_read_syntax, Fcons (make_string (") or . in a vector", 18), Qnil)); | 1612 | Fsignal (Qinvalid_read_syntax, |
| 1613 | Fcons (make_string (") or . in a vector", 18), Qnil)); | ||
| 1599 | } | 1614 | } |
| 1600 | if (ch == ')') | 1615 | if (ch == ')') |
| 1601 | return val; | 1616 | return val; |
| @@ -1609,7 +1624,11 @@ read_list (flag, readcharfun) | |||
| 1609 | read1 (readcharfun, &ch, 0); | 1624 | read1 (readcharfun, &ch, 0); |
| 1610 | UNGCPRO; | 1625 | UNGCPRO; |
| 1611 | if (ch == ')') | 1626 | if (ch == ')') |
| 1612 | return (cancel ? make_number (0) : val); | 1627 | { |
| 1628 | if (doc_reference == 1) | ||
| 1629 | return make_number (0); | ||
| 1630 | return val; | ||
| 1631 | } | ||
| 1613 | return Fsignal (Qinvalid_read_syntax, Fcons (make_string (". in wrong context", 18), Qnil)); | 1632 | return Fsignal (Qinvalid_read_syntax, Fcons (make_string (". in wrong context", 18), Qnil)); |
| 1614 | } | 1633 | } |
| 1615 | return Fsignal (Qinvalid_read_syntax, Fcons (make_string ("] in a list", 11), Qnil)); | 1634 | return Fsignal (Qinvalid_read_syntax, Fcons (make_string ("] in a list", 11), Qnil)); |