diff options
| author | Paul Eggert | 2013-07-01 17:57:46 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-07-01 17:57:46 -0700 |
| commit | c2418359b3e9f2eb7a72f4ea5245637190571cc8 (patch) | |
| tree | ca95673e0a271b9e1e53b8b1a708184b10ec824b /src/doc.c | |
| parent | 37afa042f9f56e3b3f22511ff222b49d728558d9 (diff) | |
| download | emacs-c2418359b3e9f2eb7a72f4ea5245637190571cc8.tar.gz emacs-c2418359b3e9f2eb7a72f4ea5245637190571cc8.zip | |
Simplify buildobj processing.
* Makefile.in (buildobj.h): Make it a sequence of strings each
followed by comma, rather than a single string. Put it into a
.tmp file in case there's an error while generating it.
(gl-stamp): Use .tmp for temp files.
(mostlyclean): Clean .tmp files.
* doc.c (buildobj): Move to just the routine that needs it.
It's now an array of strings, so processing is simpler.
Diffstat (limited to 'src/doc.c')
| -rw-r--r-- | src/doc.c | 33 |
1 files changed, 10 insertions, 23 deletions
| @@ -33,7 +33,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 33 | #include "buffer.h" | 33 | #include "buffer.h" |
| 34 | #include "keyboard.h" | 34 | #include "keyboard.h" |
| 35 | #include "keymap.h" | 35 | #include "keymap.h" |
| 36 | #include "buildobj.h" | ||
| 37 | 36 | ||
| 38 | Lisp_Object Qfunction_documentation; | 37 | Lisp_Object Qfunction_documentation; |
| 39 | 38 | ||
| @@ -555,7 +554,6 @@ store_function_docstring (Lisp_Object obj, ptrdiff_t offset) | |||
| 555 | } | 554 | } |
| 556 | } | 555 | } |
| 557 | 556 | ||
| 558 | static const char buildobj[] = BUILDOBJ; | ||
| 559 | 557 | ||
| 560 | DEFUN ("Snarf-documentation", Fsnarf_documentation, Ssnarf_documentation, | 558 | DEFUN ("Snarf-documentation", Fsnarf_documentation, Ssnarf_documentation, |
| 561 | 1, 1, 0, | 559 | 1, 1, 0, |
| @@ -598,27 +596,16 @@ the same file name is found in the `doc-directory'. */) | |||
| 598 | 596 | ||
| 599 | /* Vbuild_files is nil when temacs is run, and non-nil after that. */ | 597 | /* Vbuild_files is nil when temacs is run, and non-nil after that. */ |
| 600 | if (NILP (Vbuild_files)) | 598 | if (NILP (Vbuild_files)) |
| 601 | { | 599 | { |
| 602 | const char *beg, *end; | 600 | static char const *const buildobj[] = |
| 603 | 601 | { | |
| 604 | for (beg = buildobj; *beg; beg = end) | 602 | #include "buildobj.h" |
| 605 | { | 603 | }; |
| 606 | ptrdiff_t len; | 604 | int i = sizeof buildobj / sizeof *buildobj; |
| 607 | 605 | while (0 <= --i) | |
| 608 | while (*beg && c_isspace (*beg)) ++beg; | 606 | Vbuild_files = Fcons (build_string (buildobj[i]), Vbuild_files); |
| 609 | 607 | Vbuild_files = Fpurecopy (Vbuild_files); | |
| 610 | for (end = beg; *end && ! c_isspace (*end); ++end) | 608 | } |
| 611 | if (*end == '/') beg = end + 1; /* Skip directory part. */ | ||
| 612 | |||
| 613 | len = end - beg; | ||
| 614 | if (len > 4 && end[-4] == '.' && end[-3] == 'o') | ||
| 615 | len -= 2; /* Just take .o if it ends in .obj */ | ||
| 616 | |||
| 617 | if (len > 0) | ||
| 618 | Vbuild_files = Fcons (make_string (beg, len), Vbuild_files); | ||
| 619 | } | ||
| 620 | Vbuild_files = Fpurecopy (Vbuild_files); | ||
| 621 | } | ||
| 622 | 609 | ||
| 623 | fd = emacs_open (name, O_RDONLY, 0); | 610 | fd = emacs_open (name, O_RDONLY, 0); |
| 624 | if (fd < 0) | 611 | if (fd < 0) |