unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jan D." <jan.h.d@swipnet.se>
Cc: Andreas Schwab <schwab@suse.de>, emacs devel <emacs-devel@gnu.org>
Subject: Re: DOC for Mac OS shown for Emacs compiled for X.
Date: Fri, 29 Oct 2004 10:00:53 +0200 (CEST)	[thread overview]
Message-ID: <20041029080140.SPWE44.mxfep02.bredband.com@coolsville.localdomain> (raw)
In-Reply-To: <m1oeim1usj.fsf-monnier+emacs@gnu.org> "from Stefan at Oct 28, 2004 03:56:36 pm"

> >>> What does that mean exactly?  Should I be able to take a DOC produced
> >>> on a Mac and use it on GNU/Linux or W32?
> >> Yes.  That's why it is installed below $datadir.
> > Okay, then there is trouble, because that does not work today.
> 
> Yes, it gets broken fairly often.  We should fix it.
> 

Is the approach in the attached patch OK?  I generate a list with the objects used to build Emacs and in Snarf-documentation I compare the files in DOC with that list.  If not in that list, those sections in DOC are skipped.

Probably some adjustments needs to be made for w32 and msdos, I think someone mentioned that they put .c file names into DOC, and also build files are not named .o, but .obj.  The code that finds the C source should be adjusted to look at the list also.

The tests I've done suggests this fixes the problem I originally encountered, and I have not seen any regression.  But I am not all that familiar with the help code, so I may have overlooked something obvious.

Comments?

	Jan D.

diff -c Makefile.in.~1.303.~ Makefile.in
Index: Makefile.in
*** Makefile.in.~1.303.~	2004-10-20 17:44:02.000000000 +0200
--- Makefile.in	2004-10-28 21:46:59.000000000 +0200
***************
*** 943,953 ****
  #define MAKE_PARALLEL
  #endif
  
! temacs${EXEEXT}: MAKE_PARALLEL $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${obj} ${otherobj} OBJECTS_MACHINE prefix-args${EXEEXT}
  	$(LD) YMF_PASS_LDFLAGS (${STARTFLAGS} ${TEMACS_LDFLAGS}) $(LDFLAGS) \
      -o temacs ${STARTFILES} ${obj} ${otherobj}  \
      OBJECTS_MACHINE ${LIBES}
  
  /* We don't use ALL_LDFLAGS because LD_SWITCH_SYSTEM and LD_SWITCH_MACHINE
     often contain options that have to do with using Emacs's crt0,
     which are only good with temacs.  */
--- 943,956 ----
  #define MAKE_PARALLEL
  #endif
  
! temacs${EXEEXT}: MAKE_PARALLEL $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${obj} ${otherobj} OBJECTS_MACHINE prefix-args${EXEEXT} buildobj.lst
  	$(LD) YMF_PASS_LDFLAGS (${STARTFLAGS} ${TEMACS_LDFLAGS}) $(LDFLAGS) \
      -o temacs ${STARTFILES} ${obj} ${otherobj}  \
      OBJECTS_MACHINE ${LIBES}
  
+ buildobj.lst:
+ 	echo "${obj} ${otherobj} " OBJECTS_MACHINE > buildobj.lst
+ 
  /* We don't use ALL_LDFLAGS because LD_SWITCH_SYSTEM and LD_SWITCH_MACHINE
     often contain options that have to do with using Emacs's crt0,
     which are only good with temacs.  */
diff -c doc.c.~1.108.~ doc.c
Index: doc.c
*** doc.c.~1.108.~	2004-10-28 22:22:33.000000000 +0200
--- doc.c	2004-10-29 09:59:45.000000000 +0200
***************
*** 51,56 ****
--- 51,59 ----
  
  Lisp_Object Qfunction_documentation;
  
+ /* A list of files used to build this Emacs binary.  */
+ static Lisp_Object Vbuild_files;
+ 
  extern Lisp_Object Voverriding_local_map;
  
  /* For VMS versions with limited file name syntax,
***************
*** 581,586 ****
--- 584,590 ----
    register char *p, *end;
    Lisp_Object sym;
    char *name;
+   int skip_file = 0;
  
    CHECK_STRING (filename);
  
***************
*** 617,622 ****
--- 621,656 ----
    strcpy (name, sys_translate_unix (name));
  #endif /* VMS4_4 */
  #endif /* VMS */
+   
+   {
+     size_t cp_size = 0;
+     size_t to_read;
+     int nr_read;
+     char *cp = NULL;
+ 
+     fd = emacs_open ("buildobj.lst", O_RDONLY, 0);
+     if (fd < 0)
+       report_file_error ("Opening file buildobj.lst", Qnil);
+ 
+     filled = 0;
+     for (;;)
+       {
+         cp_size += 1024;
+         to_read = cp_size - 1 - filled;
+         cp = xrealloc (cp, cp_size);
+         nr_read = emacs_read (fd, &cp[filled], to_read);
+         filled += nr_read;
+         if (nr_read < to_read)
+           break;
+       }
+ 
+     cp[filled] = 0;
+ 
+     Vbuild_files = Feval (Fcons (intern ("split-string"),
+                                  Fcons (build_string (cp), Qnil)));
+     emacs_close (fd);
+     xfree (cp);
+   }
  
    fd = emacs_open (name, O_RDONLY, 0);
    if (fd < 0)
***************
*** 640,649 ****
        if (p != end)
  	{
  	  end = (char *) index (p, '\n');
  	  sym = oblookup (Vobarray, p + 2,
  			  multibyte_chars_in_text (p + 2, end - p - 2),
  			  end - p - 2);
! 	  if (SYMBOLP (sym))
  	    {
  	      /* Attach a docstring to a variable?  */
  	      if (p[1] == 'V')
--- 674,698 ----
        if (p != end)
  	{
  	  end = (char *) index (p, '\n');
+ 
+           /* See if this is a file name, and if it is a file in build-files.  */
+           if (p[1] == 'S' && end - p > 4 && end[-2] == '.' && end[-1] == 'o')
+             {
+               int len = end - p - 2;
+               char *fromfile = alloca (len + 1);
+               strncpy (fromfile, &p[2], len);
+               fromfile[len] = 0;
+ 
+               if (EQ (Fmember (build_string (fromfile), Vbuild_files), Qnil))
+                 skip_file = 1;
+               else
+                 skip_file = 0;
+             }
+ 
  	  sym = oblookup (Vobarray, p + 2,
  			  multibyte_chars_in_text (p + 2, end - p - 2),
  			  end - p - 2);
! 	  if (! skip_file && SYMBOLP (sym))
  	    {
  	      /* Attach a docstring to a variable?  */
  	      if (p[1] == 'V')
***************
*** 919,924 ****
--- 968,977 ----
  	       doc: /* Name of file containing documentation strings of built-in symbols.  */);
    Vdoc_file_name = Qnil;
  
+   DEFVAR_LISP ("build-files", &Vbuild_files,
+                doc: /* A list of files used to build this Emacs binary.  */);
+   Vbuild_files = Qnil;
+ 
    defsubr (&Sdocumentation);
    defsubr (&Sdocumentation_property);
    defsubr (&Ssnarf_documentation);

  reply	other threads:[~2004-10-29  8:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-27  9:09 DOC for Mac OS shown for Emacs compiled for X Jan D.
2004-10-27  9:46 ` Andreas Schwab
2004-10-28  7:26   ` Jan D.
2004-10-28  9:47     ` Andreas Schwab
2004-10-28 13:16       ` Jan D.
2004-10-28 13:57         ` Andreas Schwab
2004-10-28 19:56         ` Stefan
2004-10-29  8:00           ` Jan D. [this message]
2004-10-29 20:37             ` Stefan
2004-10-29 21:16               ` Jan D.
2004-10-29 21:48                 ` Stefan
2004-10-30  5:43                   ` Jan D.
2004-10-30 16:32                     ` Stefan
2004-10-30 17:43                       ` Jan D.
2004-10-30 21:59                     ` Kim F. Storm
2004-10-30 14:20                 ` Richard Stallman
2004-10-30 14:19             ` Richard Stallman
2004-10-30 14:39               ` Jan D.
2004-11-01  7:23                 ` Richard Stallman
2004-11-01  8:47                   ` Jan D.
2004-11-02 14:08                     ` Richard Stallman
2004-10-28  6:24 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041029080140.SPWE44.mxfep02.bredband.com@coolsville.localdomain \
    --to=jan.h.d@swipnet.se \
    --cc=emacs-devel@gnu.org \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).