* lost argument and doc string
@ 2002-02-10 6:59 Tak Ota
2002-02-10 17:08 ` Eli Zaretskii
0 siblings, 1 reply; 28+ messages in thread
From: Tak Ota @ 2002-02-10 6:59 UTC (permalink / raw)
In 21.2.50 some functions in simple.el have lost their arguments.
For example, C-h f line-number-mode shows
line-number-mode is an interactive compiled Lisp function in `simple'.
It is bound to <menu-bar> <options> <showhide> <line-number-mode>.
(line-number-mode)
Toggle whether to show the current line number in the mode-line.
where ARG and the doc string are gone.
It is the same for `column-number-mode'. In the vicinity of these
functions in simple.el `overwrite-mode' and `binary-overwrite-mode' do
retain the ARG however lost the doc string.
The functions missing the argument is really compiled that way. For
example, evaluating (line-number-mode 1) causes an error as
Debugger entered--Lisp error: (wrong-number-of-arguments #[nil "..." [line-number-mode message "Line number mode %s" "enabled" "disabled"] 3 "Toggle whether to show the current line number in the mode-line." nil] 1)
line-number-mode(1)
eval((line-number-mode 1))
eval-expression((line-number-mode 1) nil)
* call-interactively(eval-expression)
Above tested under -q --no-site-file.
-Tak
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-10 6:59 lost argument and doc string Tak Ota
@ 2002-02-10 17:08 ` Eli Zaretskii
2002-02-10 17:32 ` Pavel Janík
0 siblings, 1 reply; 28+ messages in thread
From: Eli Zaretskii @ 2002-02-10 17:08 UTC (permalink / raw)
Cc: emacs-devel
> From: Tak Ota <Takaaki.Ota@am.sony.com>
> Date: Sat, 09 Feb 2002 22:59:05 -0800 (PST)
>
> In 21.2.50 some functions in simple.el have lost their arguments.
>
> For example, C-h f line-number-mode shows
>
> line-number-mode is an interactive compiled Lisp function in `simple'.
> It is bound to <menu-bar> <options> <showhide> <line-number-mode>.
> (line-number-mode)
>
> Toggle whether to show the current line number in the mode-line.
>
> where ARG and the doc string are gone.
I cannot reproduce this. Are you sure your etc/DOC file is up to
date withe the rest of Emacs?
> The functions missing the argument is really compiled that way. For
> example, evaluating (line-number-mode 1) causes an error
Can't reproduce this, either. It works for me as good as ever.
If you can't solve this by rebuilding Emacs from scratch (i.e., delete
all the object files and then rebuild), I'd say this is Windows-specific.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-10 17:08 ` Eli Zaretskii
@ 2002-02-10 17:32 ` Pavel Janík
2002-02-10 23:28 ` Tak Ota
0 siblings, 1 reply; 28+ messages in thread
From: Pavel Janík @ 2002-02-10 17:32 UTC (permalink / raw)
Cc: Takaaki.Ota, emacs-devel
From: "Eli Zaretskii" <eliz@is.elta.co.il>
Date: Sun, 10 Feb 2002 19:08:26 +0200
> > In 21.2.50 some functions in simple.el have lost their arguments.
> >
> > For example, C-h f line-number-mode shows
> >
> > line-number-mode is an interactive compiled Lisp function in `simple'.
> > It is bound to <menu-bar> <options> <showhide> <line-number-mode>.
> > (line-number-mode)
> >
> > Toggle whether to show the current line number in the mode-line.
> >
> > where ARG and the doc string are gone.
>
> I cannot reproduce this. Are you sure your etc/DOC file is up to
> date withe the rest of Emacs?
I have just fixed that in menu-bar.el where I defined toggling functions
line-number-mode and column-number-mode.
--
Pavel Janík
It is not a raid board ... it is a raid lie
-- Andre Hedrick in linux-kernel about Promise RAID
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-10 17:32 ` Pavel Janík
@ 2002-02-10 23:28 ` Tak Ota
2002-02-11 5:48 ` Pavel Janík
` (2 more replies)
0 siblings, 3 replies; 28+ messages in thread
From: Tak Ota @ 2002-02-10 23:28 UTC (permalink / raw)
Cc: eliz, emacs-devel
Sun, 10 Feb 2002 18:32:39 +0100: Pavel@Janik.cz (Pavel Janík) wrote:
> From: "Eli Zaretskii" <eliz@is.elta.co.il>
> Date: Sun, 10 Feb 2002 19:08:26 +0200
>
> > > In 21.2.50 some functions in simple.el have lost their arguments.
> > >
> > > For example, C-h f line-number-mode shows
> > >
> > > line-number-mode is an interactive compiled Lisp function in `simple'.
> > > It is bound to <menu-bar> <options> <showhide> <line-number-mode>.
> > > (line-number-mode)
> > >
> > > Toggle whether to show the current line number in the mode-line.
> > >
> > > where ARG and the doc string are gone.
> >
> > I cannot reproduce this. Are you sure your etc/DOC file is up to
> > date withe the rest of Emacs?
>
> I have just fixed that in menu-bar.el where I defined toggling functions
> line-number-mode and column-number-mode.
Thanks, it did fix the missing ARG problem. I wonder why Eli didn't
see the same one. Is menu-bar.el specific to windoze? BTW, 21.2.50
is still suffering from the missing doc problem. Now the C-h f
line-number-mode looks like this.
line-number-mode is an interactive compiled Lisp function in `simple'.
(line-number-mode ARG)
Recently, to be conservative I've been building the new CVS source
from the scratch with "nmake bootstrap" every time. The latest build
looked like it did its job for building the DOC file. However, I
find no entry for line-number-mode in the actually created DOC file.
Does anyone have an idea?
-Tak
rm DOC
rm: cannot remove `DOC': No such file or directory
"D:\pub\emacs\emacs-21.2.50\lib-src/obj-spd/i386/make-docfile" -d ../src
abbrev.c alloc.c alloca.c buffer.c bytecode.c callint.c callproc.c casefiddle.c
cm.c cmds.c charset.c coding.c category.c ccl.c data.c dired.c dispnew.c doc.c
doprnt.c editfns.c emacs.c eval.c fileio.c filelock.c filemode.c fns.c fontset.
c indent.c insdel.c keyboard.c keymap.c lastfile.c lread.c macros.c marker.c min
ibuf.c xfaces.c print.c process.c regex.c scroll.c search.c syntax.c sysdep.c te
rm.c termcap.c tparam.c undo.c unexw32.c window.c xdisp.c casetab.c floatfns.c f
rame.c gmalloc.c intervals.c ralloc.c textprop.c vm-limit.c region-cache.c strft
ime.c w32.c w32console.c xfaces.c w32fns.c w32heap.c w32inevt.c w32proc.c w32reg
.c w32menu.c w32select.c w32term.c w32xfns.c > DOC
"D:\pub\emacs\emacs-21.2.50\lib-src/obj-spd/i386/make-docfile" -d ../src
../lisp/abbrev.el ../lisp/buff-menu.el ../lisp/byte-run.el ../lisp/cus-start
.el ../lisp/custom.el ../lisp/disp-table.el ../lisp/faces.el ../lisp/files.e
l ../lisp/textmodes/fill.el ../lisp/format.el ../lisp/facemenu.el ../lisp/se
lect.el ../lisp/scroll-bar.el ../lisp/mouse.el ../lisp/float-sup.el ../lisp/fr
ame.el ../lisp/help.el ../lisp/indent.el ../lisp/isearch.el ../lisp/emacs-l
isp/lisp-mode.el ../lisp/emacs-lisp/lisp.el ../lisp/loadup.el ../lisp/loaddef
s.el ../lisp/bindings.el ../lisp/map-ynp.el ../lisp/menu-bar.el ../lisp/inte
rnational/mule.el ../lisp/international/mule-conf.el ../lisp/international/mul
e-cmds.el ../lisp/international/characters.el ../lisp/international/ccl.el ..
/lisp/international/codepage.el ../lisp/international/utf-8.el ../lisp/case-ta
ble.el ../lisp/language/chinese.el ../lisp/language/cyrillic.el ../lisp/langu
age/devanagari.el ../lisp/language/english.el ../lisp/language/ethiopic.el ..
/lisp/language/european.el ../lisp/language/czech.el ../lisp/language/slovak.e
l ../lisp/language/romanian.el ../lisp/language/greek.el ../lisp/language/heb
rew.el ../lisp/language/indian.el ../lisp/language/japanese.el ../lisp/langua
ge/korean.el ../lisp/language/lao.el ../lisp/language/thai.el ../lisp/languag
e/tibetan.el ../lisp/language/vietnamese.el ../lisp/language/misc-lang.el ../
lisp/textmodes/page.el ../lisp/textmodes/paragraphs.el ../lisp/paths.el ../li
sp/register.el ../lisp/replace.el ../lisp/simple.el ../lisp/startup.el ../li
sp/subr.el ../lisp/term/tty-colors.el ../lisp/textmodes/text-mode.el ../lisp/
vc-hooks.el ../lisp/ediff-hook.el ../lisp/ls-lisp.el ../lisp/w32-fns.el ..
/lisp/dos-w32.el ../lisp/widget.el ../lisp/window.el ../lisp/version.el >> DO
C
cp -f DOC ../etc/DOC-X
mkdir "../src/obj-spd"
mkdir "../src/obj-spd/etc"
cp -f DOC ../src/obj-spd/etc/DOC-X
cd ..\src
NMAKE bootstrap
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-10 23:28 ` Tak Ota
@ 2002-02-11 5:48 ` Pavel Janík
2002-02-11 5:48 ` Eli Zaretskii
2002-02-11 18:48 ` Richard Stallman
2 siblings, 0 replies; 28+ messages in thread
From: Pavel Janík @ 2002-02-11 5:48 UTC (permalink / raw)
Cc: eliz, emacs-devel
From: Tak Ota <Takaaki.Ota@am.sony.com>
Date: Sun, 10 Feb 2002 15:28:12 -0800 (PST)
> Recently, to be conservative I've been building the new CVS source
> from the scratch with "nmake bootstrap" every time. The latest build
> looked like it did its job for building the DOC file. However, I
> find no entry for line-number-mode in the actually created DOC file.
> Does anyone have an idea?
Hmm, this is strange. On my system:
line-number-mode is an interactive compiled Lisp function in `simple'.
(line-number-mode ARG)
Toggle Line Number mode.
... and the doc-string continues...
--
Pavel Janík
Technology is meaningless. What matters is how people think of it.
-- Linus Torvalds in linux-kernel
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-10 23:28 ` Tak Ota
2002-02-11 5:48 ` Pavel Janík
@ 2002-02-11 5:48 ` Eli Zaretskii
2002-02-11 16:34 ` Juanma Barranquero
2002-02-11 18:48 ` Richard Stallman
2 siblings, 1 reply; 28+ messages in thread
From: Eli Zaretskii @ 2002-02-11 5:48 UTC (permalink / raw)
Cc: Pavel, emacs-devel
On Sun, 10 Feb 2002, Tak Ota wrote:
> > I have just fixed that in menu-bar.el where I defined toggling functions
> > line-number-mode and column-number-mode.
>
> Thanks, it did fix the missing ARG problem. I wonder why Eli didn't
> see the same one.
Probably because I tried after "cvs up", which caught Pavel's latest
changes that fixed the problem.
> Is menu-bar.el specific to windoze?
No, it's used by all versions.
> BTW, 21.2.50
> is still suffering from the missing doc problem. Now the C-h f
> line-number-mode looks like this.
>
> line-number-mode is an interactive compiled Lisp function in `simple'.
> (line-number-mode ARG)
>
> Recently, to be conservative I've been building the new CVS source
> from the scratch with "nmake bootstrap" every time. The latest build
> looked like it did its job for building the DOC file. However, I
> find no entry for line-number-mode in the actually created DOC file.
> Does anyone have an idea?
This _does_ seem Windows-specific, because I cannot reproduce it, and
also because another user of the Windows version reported a similar
problem with what looked like a perfectly valid DOC file.
Is it possible that the change in the way doc strings are put in C files
confuses the Windows port, either the make-docfile program or Emacs
itself?
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-11 5:48 ` Eli Zaretskii
@ 2002-02-11 16:34 ` Juanma Barranquero
2002-02-11 19:37 ` Eli Zaretskii
0 siblings, 1 reply; 28+ messages in thread
From: Juanma Barranquero @ 2002-02-11 16:34 UTC (permalink / raw)
On Mon, 11 Feb 2002 07:48:57 +0200 (IST), Eli Zaretskii <eliz@is.elta.co.il> wrote:
> This _does_ seem Windows-specific, because I cannot reproduce it, and
> also because another user of the Windows version reported a similar
> problem with what looked like a perfectly valid DOC file.
I'm certainly seeing the same problem, even after nmake bootstrap (on a
Windows XP, with a MSVC-compiled Emacs 21.2.50).
> Is it possible that the change in the way doc strings are put in C files
> confuses the Windows port, either the make-docfile program or Emacs
> itself?
Maybe, but then why some docstrings can be seen just fine?
/L/e/k/t/u
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-10 23:28 ` Tak Ota
2002-02-11 5:48 ` Pavel Janík
2002-02-11 5:48 ` Eli Zaretskii
@ 2002-02-11 18:48 ` Richard Stallman
2 siblings, 0 replies; 28+ messages in thread
From: Richard Stallman @ 2002-02-11 18:48 UTC (permalink / raw)
Cc: Pavel, eliz, emacs-devel
I remember when I lost an argument. Boy did that hurt! ;-).
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-11 16:34 ` Juanma Barranquero
@ 2002-02-11 19:37 ` Eli Zaretskii
2002-02-12 2:32 ` Tak Ota
0 siblings, 1 reply; 28+ messages in thread
From: Eli Zaretskii @ 2002-02-11 19:37 UTC (permalink / raw)
Cc: emacs-devel
> From: Juanma Barranquero <lektu@terra.es>
> Date: Mon, 11 Feb 2002 17:34:14 +0100
>
> > Is it possible that the change in the way doc strings are put in C files
> > confuses the Windows port, either the make-docfile program or Emacs
> > itself?
>
> Maybe, but then why some docstrings can be seen just fine?
Because some doc strings come from Lisp files?
But that's a stab in the dark; it would be nice if someone could step
with a debugger through the offending code and see what's going on
there.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-11 19:37 ` Eli Zaretskii
@ 2002-02-12 2:32 ` Tak Ota
2002-02-12 8:35 ` Eli Zaretskii
0 siblings, 1 reply; 28+ messages in thread
From: Tak Ota @ 2002-02-12 2:32 UTC (permalink / raw)
Cc: lektu, emacs-devel, andrewi
Mon, 11 Feb 2002 21:37:40 +0200: "Eli Zaretskii" <eliz@is.elta.co.il> wrote:
> > From: Juanma Barranquero <lektu@terra.es>
> > Date: Mon, 11 Feb 2002 17:34:14 +0100
> >
> > > Is it possible that the change in the way doc strings are put in C files
> > > confuses the Windows port, either the make-docfile program or Emacs
> > > itself?
> >
> > Maybe, but then why some docstrings can be seen just fine?
>
> Because some doc strings come from Lisp files?
>
> But that's a stab in the dark; it would be nice if someone could step
> with a debugger through the offending code and see what's going on
> there.
A debugger was found to be helpless in this particular case. I think
I found the real cause of the problem. The first suspected culprit
make-docfile turned out to be innocent by borrowing the make-docfile
from 21.1.90 produced the same result. The real problem is in
makefile.w32-in. I don't know much about how make-docfile operates
but it obviously expects some .elc files instead of .el files. By
comparing the makefile with the one in 21.1.90 and restoring those elc
definitions in lisp= macro the lost doc strings are recovered.
I suppose the following change in lib-src/ChangeLog is responsible
for this.
-Tak
2001-11-30 Andrew Innes <andrewi@gnu.org>
* makefile.w32-in (FACE_SUPPORT):
(MOUSE_SUPPORT):
(FLOAT_SUPPORT):
(WINNT_SUPPORT):
(lisp): Reference .el files instead of .elc files, to simplify
bootstrapping.
($(DOC)): Change dependency to just `make-docfile'.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-12 2:32 ` Tak Ota
@ 2002-02-12 8:35 ` Eli Zaretskii
2002-02-12 14:23 ` Tak Ota
2002-02-13 15:37 ` Richard Stallman
0 siblings, 2 replies; 28+ messages in thread
From: Eli Zaretskii @ 2002-02-12 8:35 UTC (permalink / raw)
Cc: lektu, emacs-devel, andrewi
On Mon, 11 Feb 2002, Tak Ota wrote:
> I don't know much about how make-docfile operates
> but it obviously expects some .elc files instead of .el files.
Could you please see why is this so? Is it perhaps an issue with
binary vs text reads?
> I suppose the following change in lib-src/ChangeLog is responsible
> for this.
Yes, but Andrew did that change for a reason, as the log says...
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-12 8:35 ` Eli Zaretskii
@ 2002-02-12 14:23 ` Tak Ota
2002-02-12 18:57 ` Jason Rumney
2002-02-13 15:37 ` Richard Stallman
1 sibling, 1 reply; 28+ messages in thread
From: Tak Ota @ 2002-02-12 14:23 UTC (permalink / raw)
Cc: lektu, emacs-devel, andrewi
Tue, 12 Feb 2002 10:35:24 +0200 (IST): Eli Zaretskii <eliz@is.elta.co.il> wrote:
> > I don't know much about how make-docfile operates
> > but it obviously expects some .elc files instead of .el files.
>
> Could you please see why is this so? Is it perhaps an issue with
> binary vs text reads?
I'll try to read make-docfile.c, however, someone on this list
probably can provide quick answer to this puzzle before I solve it.
What's really strange is out of all those elc files following files
are seemingly and deliberately left as el files.
cus-start.el, loadup.el, loaddefs.el, bindings.el,
international/mule-conf.el, paths.el, version.el
> > I suppose the following change in lib-src/ChangeLog is responsible
> > for this.
>
> Yes, but Andrew did that change for a reason, as the log says...
I agree, and the new way looks cleaner if it works.
I'll continue to work on this topic.
-Tak
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-12 14:23 ` Tak Ota
@ 2002-02-12 18:57 ` Jason Rumney
2002-02-12 19:48 ` Tak Ota
2002-02-14 3:11 ` Richard Stallman
0 siblings, 2 replies; 28+ messages in thread
From: Jason Rumney @ 2002-02-12 18:57 UTC (permalink / raw)
Cc: eliz, lektu, emacs-devel, andrewi
Tak Ota <Takaaki.Ota@am.sony.com> writes:
> I'll try to read make-docfile.c, however, someone on this list
> probably can provide quick answer to this puzzle before I solve it.
> What's really strange is out of all those elc files following files
> are seemingly and deliberately left as el files.
>
> cus-start.el, loadup.el, loaddefs.el, bindings.el,
> international/mule-conf.el, paths.el, version.el
There is a comment in make-docfile.c that says that docstrings in .el
files must start with a backslash and newline immediately after the
opening double quote. The files listed above (should) have docstrings
that comply with that requirement.
I tried running make-docfile on just simple.el, and only one docstring
was produced (for previous-complete-history-element), which is
consistent with that comment.
--
Jason Rumney
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-12 18:57 ` Jason Rumney
@ 2002-02-12 19:48 ` Tak Ota
2002-02-13 5:43 ` Eli Zaretskii
2002-02-13 19:50 ` Jason Rumney
2002-02-14 3:11 ` Richard Stallman
1 sibling, 2 replies; 28+ messages in thread
From: Tak Ota @ 2002-02-12 19:48 UTC (permalink / raw)
Cc: eliz, lektu, emacs-devel, andrewi
12 Feb 2002 18:57:58 +0000: Jason Rumney <jasonr@gnu.org> wrote:
> There is a comment in make-docfile.c that says that docstrings in .el
> files must start with a backslash and newline immediately after the
> opening double quote. The files listed above (should) have docstrings
> that comply with that requirement.
>
> I tried running make-docfile on just simple.el, and only one docstring
> was produced (for previous-complete-history-element), which is
> consistent with that comment.
I've just finished reading make-docfile.c. You are absolutely right.
I did the same experiment, running make-docfile manually on simple.el,
and got surprised. And the source file is requesting the sequence
`dquote bslash newline' as the beginning of the valid doc string in
case of el files. I don't think this is right. Starting doc string
that way is only optional I believe.
Since read_c_string_or_comment takes care of line continuation
(bslash at the end of line) there is really no need of handling the
very first continuation in a special manner in the individual cases.
I propose the following patch. It corrects the problem and the code
becomes cleaner too.
-Tak
*** lib-src/make-docfile.c.orig Sat Jan 5 15:37:58 2002
--- lib-src/make-docfile.c Tue Feb 12 11:28:01 2002
***************
*** 911,925 ****
else
while (c != ')')
c = getc (infile);
- skip_white (infile);
! /* If the next three characters aren't `dquote bslash newline'
! then we're not reading a docstring.
! */
! if ((c = getc (infile)) != '"'
! || (c = getc (infile)) != '\\'
! || ((c = getc (infile)) != '\n' && c != '\r'))
! {
#ifdef DEBUG
fprintf (stderr, "## non-docstring in %s (%s)\n",
buffer, filename);
--- 911,920 ----
else
while (c != ')')
c = getc (infile);
! skip_white (infile);
! if ((c = getc (infile)) != '\"')
! {
#ifdef DEBUG
fprintf (stderr, "## non-docstring in %s (%s)\n",
buffer, filename);
***************
*** 931,954 ****
else if (! strcmp (buffer, "defvar")
|| ! strcmp (buffer, "defconst"))
{
- char c1 = 0, c2 = 0;
type = 'V';
read_lisp_symbol (infile, buffer);
if (saved_string == 0)
{
!
! /* Skip until the end of line; remember two previous chars. */
! while (c != '\n' && c != '\r' && c >= 0)
! {
! c2 = c1;
! c1 = c;
! c = getc (infile);
! }
!
! /* If two previous characters were " and \,
! this is a doc string. Otherwise, there is none. */
! if (c2 != '"' || c1 != '\\')
{
#ifdef DEBUG
fprintf (stderr, "## non-docstring in %s (%s)\n",
--- 926,938 ----
else if (! strcmp (buffer, "defvar")
|| ! strcmp (buffer, "defconst"))
{
type = 'V';
read_lisp_symbol (infile, buffer);
if (saved_string == 0)
{
! skip_white (infile);
! if ((c = getc (infile)) != '\"')
{
#ifdef DEBUG
fprintf (stderr, "## non-docstring in %s (%s)\n",
***************
*** 961,967 ****
else if (! strcmp (buffer, "custom-declare-variable"))
{
- char c1 = 0, c2 = 0;
type = 'V';
c = getc (infile);
--- 945,950 ----
***************
*** 997,1013 ****
if (saved_string == 0)
{
! /* Skip to end of line; remember the two previous chars. */
! while (c != '\n' && c != '\r' && c >= 0)
! {
! c2 = c1;
! c1 = c;
! c = getc (infile);
! }
!
! /* If two previous characters were " and \,
! this is a doc string. Otherwise, there is none. */
! if (c2 != '"' || c1 != '\\')
{
#ifdef DEBUG
fprintf (stderr, "## non-docstring in %s (%s)\n",
--- 980,987 ----
if (saved_string == 0)
{
! skip_white (infile);
! if ((c = getc (infile)) != '\"')
{
#ifdef DEBUG
fprintf (stderr, "## non-docstring in %s (%s)\n",
***************
*** 1020,1026 ****
else if (! strcmp (buffer, "fset") || ! strcmp (buffer, "defalias"))
{
- char c1 = 0, c2 = 0;
type = 'F';
c = getc (infile);
--- 994,999 ----
***************
*** 1054,1070 ****
if (saved_string == 0)
{
! /* Skip to end of line; remember the two previous chars. */
! while (c != '\n' && c != '\r' && c >= 0)
! {
! c2 = c1;
! c1 = c;
! c = getc (infile);
! }
!
! /* If two previous characters were " and \,
! this is a doc string. Otherwise, there is none. */
! if (c2 != '"' || c1 != '\\')
{
#ifdef DEBUG
fprintf (stderr, "## non-docstring in %s (%s)\n",
--- 1027,1034 ----
if (saved_string == 0)
{
! skip_white (infile);
! if ((c = getc (infile)) != '\"')
{
#ifdef DEBUG
fprintf (stderr, "## non-docstring in %s (%s)\n",
***************
*** 1117,1129 ****
skip_white (infile);
if (saved_string == 0)
! {
! /* If the next three characters aren't `dquote bslash newline'
! then we're not reading a docstring. */
! if ((c = getc (infile)) != '"'
! || (c = getc (infile)) != '\\'
! || ((c = getc (infile)) != '\n' && c != '\r'))
! {
#ifdef DEBUG
fprintf (stderr, "## non-docstring in %s (%s)\n",
buffer, filename);
--- 1081,1090 ----
skip_white (infile);
if (saved_string == 0)
! {
! skip_white (infile);
! if ((c = getc (infile)) != '\"')
! {
#ifdef DEBUG
fprintf (stderr, "## non-docstring in %s (%s)\n",
buffer, filename);
***************
*** 1152,1159 ****
dynamic doc string in saved_string
or gobble a doc string from the input file.
! In the latter case, the opening quote (and leading
! backslash-newline) have already been read. */
putc (037, outfile);
putc (type, outfile);
--- 1113,1120 ----
dynamic doc string in saved_string
or gobble a doc string from the input file.
! In the latter case, the opening quote has already been
! read. */
putc (037, outfile);
putc (type, outfile);
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-12 19:48 ` Tak Ota
@ 2002-02-13 5:43 ` Eli Zaretskii
2002-02-13 6:01 ` Tak Ota
2002-02-13 13:40 ` Andreas Schwab
2002-02-13 19:50 ` Jason Rumney
1 sibling, 2 replies; 28+ messages in thread
From: Eli Zaretskii @ 2002-02-13 5:43 UTC (permalink / raw)
Cc: jasonr, lektu, emacs-devel, andrewi
On Tue, 12 Feb 2002, Tak Ota wrote:
> I did the same experiment, running make-docfile manually on simple.el,
> and got surprised. And the source file is requesting the sequence
> `dquote bslash newline' as the beginning of the valid doc string in
> case of el files. I don't think this is right. Starting doc string
> that way is only optional I believe.
Please make sure that any changes you make in this don't break
loaddefs.el. I believe loaddefs is the reason for that requirement of
how the doc string should begin (since loaddefs is generated by a
program, there's no problem satisfying that requirement in that case). I
imagine that there was some reason to require such a format, in which
case we should avoid breaking that.
Richard, do you recall why this format was required?
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-13 5:43 ` Eli Zaretskii
@ 2002-02-13 6:01 ` Tak Ota
2002-02-13 13:40 ` Andreas Schwab
1 sibling, 0 replies; 28+ messages in thread
From: Tak Ota @ 2002-02-13 6:01 UTC (permalink / raw)
Cc: jasonr, lektu, emacs-devel, andrewi
Wed, 13 Feb 2002 07:43:56 +0200 (IST): Eli Zaretskii <eliz@is.elta.co.il> wrote:
> On Tue, 12 Feb 2002, Tak Ota wrote:
>
> > I did the same experiment, running make-docfile manually on simple.el,
> > and got surprised. And the source file is requesting the sequence
> > `dquote bslash newline' as the beginning of the valid doc string in
> > case of el files. I don't think this is right. Starting doc string
> > that way is only optional I believe.
>
> Please make sure that any changes you make in this don't break
> loaddefs.el. I believe loaddefs is the reason for that requirement of
> how the doc string should begin (since loaddefs is generated by a
> program, there's no problem satisfying that requirement in that case). I
> imagine that there was some reason to require such a format, in which
> case we should avoid breaking that.
Sure, the change I submitted for make-docfile.c does not change any
doc strings, thus I believe does not affect loaddefs.el either. It
only changes how to find the doc strings, including from loaddefs.el.
And yes, it must be made clear why those constraints I removed from
make-docfile.c were there before.
-Tak
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-13 5:43 ` Eli Zaretskii
2002-02-13 6:01 ` Tak Ota
@ 2002-02-13 13:40 ` Andreas Schwab
2002-02-13 14:23 ` Eli Zaretskii
1 sibling, 1 reply; 28+ messages in thread
From: Andreas Schwab @ 2002-02-13 13:40 UTC (permalink / raw)
Cc: Tak Ota, jasonr, lektu, emacs-devel, andrewi
Eli Zaretskii <eliz@is.elta.co.il> writes:
|> On Tue, 12 Feb 2002, Tak Ota wrote:
|>
|> > I did the same experiment, running make-docfile manually on simple.el,
|> > and got surprised. And the source file is requesting the sequence
|> > `dquote bslash newline' as the beginning of the valid doc string in
|> > case of el files. I don't think this is right. Starting doc string
|> > that way is only optional I believe.
|>
|> Please make sure that any changes you make in this don't break
|> loaddefs.el. I believe loaddefs is the reason for that requirement of
|> how the doc string should begin (since loaddefs is generated by a
|> program, there's no problem satisfying that requirement in that case). I
|> imagine that there was some reason to require such a format, in which
|> case we should avoid breaking that.
|>
|> Richard, do you recall why this format was required?
I'd guess it's just so that you don't need a full Lisp parser in
make-docfile. Especially for defvar there can be an arbitrary lisp
expression before the doc string, which you would have to skip
carefully. With the current format you can just skip to end of line and
identify the doc string immediately.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-13 13:40 ` Andreas Schwab
@ 2002-02-13 14:23 ` Eli Zaretskii
0 siblings, 0 replies; 28+ messages in thread
From: Eli Zaretskii @ 2002-02-13 14:23 UTC (permalink / raw)
Cc: Tak Ota, jasonr, lektu, emacs-devel, andrewi
On Wed, 13 Feb 2002, Andreas Schwab wrote:
> I'd guess it's just so that you don't need a full Lisp parser in
> make-docfile.
Yes, it could be. If that's the reason, we should make sure we don't
break that with the suggested changes.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-12 8:35 ` Eli Zaretskii
2002-02-12 14:23 ` Tak Ota
@ 2002-02-13 15:37 ` Richard Stallman
1 sibling, 0 replies; 28+ messages in thread
From: Richard Stallman @ 2002-02-13 15:37 UTC (permalink / raw)
Cc: Takaaki.Ota, lektu, emacs-devel, andrewi
> I don't know much about how make-docfile operates
> but it obviously expects some .elc files instead of .el files.
Could you please see why is this so? Is it perhaps an issue with
binary vs text reads?
As I recall, the args to make-docfile are names of .elc files
but make-docfile actually reads the source files instead.
I think the reason for this was that src/Makefile needs to have
a list of those .elc files for some other reason.
This avoids the need to have two parallel lists,
one of .el files and one of .elc files.
GNU Make could transform one of those lists into the other
but we don't want to require use of GNU Make.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-12 19:48 ` Tak Ota
2002-02-13 5:43 ` Eli Zaretskii
@ 2002-02-13 19:50 ` Jason Rumney
2002-02-13 20:22 ` Tak Ota
2002-02-13 21:00 ` Tak Ota
1 sibling, 2 replies; 28+ messages in thread
From: Jason Rumney @ 2002-02-13 19:50 UTC (permalink / raw)
Cc: eliz, lektu, emacs-devel, andrewi
Tak Ota <Takaaki.Ota@am.sony.com> writes:
> --- lib-src/make-docfile.c Tue Feb 12 11:28:01 2002
> ***************
> *** 911,925 ****
> else
> while (c != ')')
> c = getc (infile);
> - skip_white (infile);
>
> ! /* If the next three characters aren't `dquote bslash newline'
> ! then we're not reading a docstring.
> ! */
> ! if ((c = getc (infile)) != '"'
> ! || (c = getc (infile)) != '\\'
> ! || ((c = getc (infile)) != '\n' && c != '\r'))
> ! {
> #ifdef DEBUG
> fprintf (stderr, "## non-docstring in %s (%s)\n",
> buffer, filename);
> --- 911,920 ----
> else
> while (c != ')')
> c = getc (infile);
>
> ! skip_white (infile);
> ! if ((c = getc (infile)) != '\"')
> ! {
> #ifdef DEBUG
> fprintf (stderr, "## non-docstring in %s (%s)\n",
> buffer, filename);
Be careful that the following does the right thing:
(defvar string-variable "String value" "\
This is the documentation for a string variable.")
That seems like the only logical reason for the current convention.
--
Jason Rumney
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-13 19:50 ` Jason Rumney
@ 2002-02-13 20:22 ` Tak Ota
2002-02-13 21:02 ` Jason Rumney
2002-02-13 21:00 ` Tak Ota
1 sibling, 1 reply; 28+ messages in thread
From: Tak Ota @ 2002-02-13 20:22 UTC (permalink / raw)
Cc: eliz, lektu, emacs-devel, andrewi
13 Feb 2002 19:50:17 +0000: Jason Rumney <jasonr@gnu.org> wrote:
> Tak Ota <Takaaki.Ota@am.sony.com> writes:
>
> > --- lib-src/make-docfile.c Tue Feb 12 11:28:01 2002
> > ***************
> > *** 911,925 ****
> > else
> > while (c != ')')
> > c = getc (infile);
> > - skip_white (infile);
> >
> > ! /* If the next three characters aren't `dquote bslash newline'
> > ! then we're not reading a docstring.
> > ! */
> > ! if ((c = getc (infile)) != '"'
> > ! || (c = getc (infile)) != '\\'
> > ! || ((c = getc (infile)) != '\n' && c != '\r'))
> > ! {
> > #ifdef DEBUG
> > fprintf (stderr, "## non-docstring in %s (%s)\n",
> > buffer, filename);
> > --- 911,920 ----
> > else
> > while (c != ')')
> > c = getc (infile);
> >
> > ! skip_white (infile);
> > ! if ((c = getc (infile)) != '\"')
> > ! {
> > #ifdef DEBUG
> > fprintf (stderr, "## non-docstring in %s (%s)\n",
> > buffer, filename);
>
>
> Be careful that the following does the right thing:
>
> (defvar string-variable "String value" "\
> This is the documentation for a string variable.")
>
>
> That seems like the only logical reason for the current convention.
But my point is that they are all eventually processed by
`read_c_string_or_comment' later, which takes care of backslash
continuation no matter it is the very first thing in the string or in
the middle of it.
The old code is simply enforcing doc string to begin with the line
continuation. Anything else is rejected.
-Tak
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-13 19:50 ` Jason Rumney
2002-02-13 20:22 ` Tak Ota
@ 2002-02-13 21:00 ` Tak Ota
1 sibling, 0 replies; 28+ messages in thread
From: Tak Ota @ 2002-02-13 21:00 UTC (permalink / raw)
Cc: eliz, lektu, emacs-devel, andrewi
I now see the point of your advice though you should have quoted the
following part instead of the one you picked.
-Tak
> *** 931,954 ****
> else if (! strcmp (buffer, "defvar")
> || ! strcmp (buffer, "defconst"))
> {
> - char c1 = 0, c2 = 0;
> type = 'V';
> read_lisp_symbol (infile, buffer);
>
> if (saved_string == 0)
> {
> !
> ! /* Skip until the end of line; remember two previous chars. */
> ! while (c != '\n' && c != '\r' && c >= 0)
> ! {
> ! c2 = c1;
> ! c1 = c;
> ! c = getc (infile);
> ! }
> !
> ! /* If two previous characters were " and \,
> ! this is a doc string. Otherwise, there is none. */
> ! if (c2 != '"' || c1 != '\\')
> {
> #ifdef DEBUG
> fprintf (stderr, "## non-docstring in %s (%s)\n",
> --- 926,938 ----
> else if (! strcmp (buffer, "defvar")
> || ! strcmp (buffer, "defconst"))
> {
> type = 'V';
> read_lisp_symbol (infile, buffer);
>
> if (saved_string == 0)
> {
> ! skip_white (infile);
> ! if ((c = getc (infile)) != '\"')
> {
> #ifdef DEBUG
> fprintf (stderr, "## non-docstring in %s (%s)\n",
13 Feb 2002 19:50:17 +0000: Jason Rumney <jasonr@gnu.org> wrote:
> Tak Ota <Takaaki.Ota@am.sony.com> writes:
>
> > --- lib-src/make-docfile.c Tue Feb 12 11:28:01 2002
> > ***************
> > *** 911,925 ****
> > else
> > while (c != ')')
> > c = getc (infile);
> > - skip_white (infile);
> >
> > ! /* If the next three characters aren't `dquote bslash newline'
> > ! then we're not reading a docstring.
> > ! */
> > ! if ((c = getc (infile)) != '"'
> > ! || (c = getc (infile)) != '\\'
> > ! || ((c = getc (infile)) != '\n' && c != '\r'))
> > ! {
> > #ifdef DEBUG
> > fprintf (stderr, "## non-docstring in %s (%s)\n",
> > buffer, filename);
> > --- 911,920 ----
> > else
> > while (c != ')')
> > c = getc (infile);
> >
> > ! skip_white (infile);
> > ! if ((c = getc (infile)) != '\"')
> > ! {
> > #ifdef DEBUG
> > fprintf (stderr, "## non-docstring in %s (%s)\n",
> > buffer, filename);
>
>
> Be careful that the following does the right thing:
>
> (defvar string-variable "String value" "\
> This is the documentation for a string variable.")
>
>
> That seems like the only logical reason for the current convention.
>
>
> --
> Jason Rumney
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-13 20:22 ` Tak Ota
@ 2002-02-13 21:02 ` Jason Rumney
2002-02-14 7:36 ` Tak Ota
0 siblings, 1 reply; 28+ messages in thread
From: Jason Rumney @ 2002-02-13 21:02 UTC (permalink / raw)
Cc: eliz, lektu, emacs-devel, andrewi
Tak Ota <Takaaki.Ota@am.sony.com> writes:
> > Be careful that the following does the right thing:
> >
> > (defvar string-variable "String value" "\
> > This is the documentation for a string variable.")
> >
> >
> > That seems like the only logical reason for the current convention.
>
> But my point is that they are all eventually processed by
> `read_c_string_or_comment' later, which takes care of backslash
The backslash wasn't what I was concerned about. We need to make sure
that "String value" is not picked up as a documentation string in the
above case. That is the only reason I can think of where the current
convention might be useful.
--
Jason Rumney
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-12 18:57 ` Jason Rumney
2002-02-12 19:48 ` Tak Ota
@ 2002-02-14 3:11 ` Richard Stallman
2002-02-14 15:13 ` Tak Ota
1 sibling, 1 reply; 28+ messages in thread
From: Richard Stallman @ 2002-02-14 3:11 UTC (permalink / raw)
Cc: Takaaki.Ota, eliz, lektu, emacs-devel, andrewi
I see my recollection was mistaken: make-docfile reads the binary
files directly. Sorry if I caused any confusion.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-13 21:02 ` Jason Rumney
@ 2002-02-14 7:36 ` Tak Ota
2002-02-15 10:36 ` Richard Stallman
0 siblings, 1 reply; 28+ messages in thread
From: Tak Ota @ 2002-02-14 7:36 UTC (permalink / raw)
Cc: eliz, lektu, emacs-devel, andrewi
13 Feb 2002 21:02:42 +0000: Jason Rumney <jasonr@gnu.org> wrote:
> > > Be careful that the following does the right thing:
> > >
> > > (defvar string-variable "String value" "\
> > > This is the documentation for a string variable.")
> > >
> > >
> > > That seems like the only logical reason for the current convention.
> >
> > But my point is that they are all eventually processed by
> > `read_c_string_or_comment' later, which takes care of backslash
>
> The backslash wasn't what I was concerned about. We need to make sure
> that "String value" is not picked up as a documentation string in the
> above case. That is the only reason I can think of where the current
> convention might be useful.
Thanks for the advice. How about the change below? It does more
elaborate lisp object parsing. Also it consolidates some redundant
code repetitions.
-Tak
Index: make-docfile.c
===================================================================
RCS file: /cvsroot/emacs/emacs/lib-src/make-docfile.c,v
retrieving revision 1.50
diff -u -r1.50 make-docfile.c
--- make-docfile.c 5 Jan 2002 23:37:58 -0000 1.50
+++ make-docfile.c 14 Feb 2002 07:33:43 -0000
@@ -323,7 +323,7 @@
at the beginning of a line will be removed, and *SAW_USAGE set to
true if any were encountered. */
-int
+static int
read_c_string_or_comment (infile, printflag, comment, saw_usage)
FILE *infile;
int printflag;
@@ -414,7 +414,7 @@
/* Write to file OUT the argument names of function FUNC, whose text is in BUF.
MINARGS and MAXARGS are the minimum and maximum number of arguments. */
-void
+static void
write_c_args (out, func, buf, minargs, maxargs)
FILE *out;
char *func, *buf;
@@ -501,7 +501,7 @@
Looks for DEFUN constructs such as are defined in ../src/lisp.h.
Accepts any word starting DEF... so it finds DEFSIMPLE and DEFPRED. */
-int
+static int
scan_c_file (filename, mode)
char *filename, *mode;
{
@@ -765,7 +765,7 @@
An entry is output only if DOCSTRING has \ newline just after the opening "
*/
-void
+static void
skip_white (infile)
FILE *infile;
{
@@ -775,10 +775,10 @@
ungetc (c, infile);
}
-void
-read_lisp_symbol (infile, buffer)
+static void
+read_lisp_symbol (infile, buffer, filename)
FILE *infile;
- char *buffer;
+ char *buffer, *filename;
{
char c;
char *fillp = buffer;
@@ -789,7 +789,7 @@
c = getc (infile);
if (c == '\\')
*(++fillp) = getc (infile);
- else if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '(' || c == ')')
+ else if (c == ' ' || c == '\t' || c == '\n' || c == '\r' || c == '(' || c == ')' || c == '[' || c == ']')
{
ungetc (c, infile);
*fillp = 0;
@@ -800,11 +800,138 @@
}
if (! buffer[0])
- fprintf (stderr, "## expected a symbol, got '%c'\n", c);
+ fprintf (stderr, "## expected a symbol, got '%c' in %s\n", c, filename);
skip_white (infile);
}
+static int
+read_quoted_lisp_symbol (infile, buffer, filename, form)
+ FILE *infile;
+ char *buffer, *filename, *form;
+{
+ register int c;
+
+ c = getc (infile);
+ if (c == '\'')
+ read_lisp_symbol (infile, buffer, filename);
+ else
+ {
+ if (c != '(')
+ {
+ fprintf (stderr,
+ "## unparsable name in %s in %s\n",
+ form, filename);
+ return 1;
+ }
+ read_lisp_symbol (infile, buffer, filename);
+ if (strcmp (buffer, "quote"))
+ {
+ fprintf (stderr,
+ "## unparsable name in %s in %s\n",
+ form, filename);
+ return 1;
+ }
+ read_lisp_symbol (infile, buffer, filename);
+ c = getc (infile);
+ if (c != ')')
+ {
+ fprintf (stderr,
+ "## unparsable quoted name in %s in %s\n",
+ form, filename);
+ return 1;
+ }
+ }
+ return 0;
+}
+
+static int
+read_lisp_char (infile)
+ FILE *infile;
+{
+ int c;
+
+ continuation:
+ if ((c = getc (infile)) != '\\')
+ return c;
+
+ switch (c = getc (infile))
+ {
+ case '\n': case '\r':
+ goto continuation;
+ case 'a': return 7;
+ case 'b': return 8;
+ case 't': return 9;
+ case 'n': return 10;
+ case 'v': return 11;
+ case 'f': return 12;
+ case 'r': return 13;
+ case 'e': return 27;
+ case '\\': return 92;
+ case 'd': return 127;
+ case 'C':
+ if ((c = getc (infile)) != '-')
+ return c; /* ignore the syntax error */
+ /* follow through */
+ case '^':
+ c = getc (infile);
+ return ((c < 'a' ? c : c - 32) - '@') & 127;
+ }
+ return c;
+}
+
+static int
+skip_lisp_object (infile, filename)
+ FILE *infile;
+ char *filename;
+{
+ int c;
+
+ skip_white (infile);
+ c = getc (infile);
+ switch (c)
+ {
+ case EOF:
+ return 0;
+ case '?':
+ read_lisp_char (infile);
+ return 1;
+ case '\'':
+ return skip_lisp_object (infile, filename);
+ case '\"':
+ do
+ {
+ c = read_lisp_char (infile);
+ }
+ while (c != '\"' && c != EOF);
+ return 1;
+ case '(': case '[':
+ {
+ int term = c == '(' ? ')' : ']';
+ while (1)
+ {
+ skip_white (infile);
+ c = getc (infile);
+ if (c == term)
+ return 1;
+ if (c == EOF)
+ return 0;
+ ungetc (c, infile);
+ skip_lisp_object (infile, filename);
+ }
+ }
+ case ')': case ']':
+ return 0;
+ default:
+ ungetc (c, infile);
+ {
+ char buffer[BUFSIZ];
+ read_lisp_symbol (infile, buffer, filename);
+ }
+ return 1;
+ }
+}
+
int
scan_lisp_file (filename, mode)
char *filename, *mode;
@@ -880,46 +1007,21 @@
if (c != '(')
continue;
- read_lisp_symbol (infile, buffer);
+ read_lisp_symbol (infile, buffer, filename);
if (! strcmp (buffer, "defun")
|| ! strcmp (buffer, "defmacro")
|| ! strcmp (buffer, "defsubst"))
{
type = 'F';
- read_lisp_symbol (infile, buffer);
+ read_lisp_symbol (infile, buffer, filename);
- /* Skip the arguments: either "nil" or a list in parens */
+ /* Skip the arguments */
+ skip_lisp_object (infile, filename);
- c = getc (infile);
- if (c == 'n') /* nil */
- {
- if ((c = getc (infile)) != 'i'
- || (c = getc (infile)) != 'l')
- {
- fprintf (stderr, "## unparsable arglist in %s (%s)\n",
- buffer, filename);
- continue;
- }
- }
- else if (c != '(')
- {
- fprintf (stderr, "## unparsable arglist in %s (%s)\n",
- buffer, filename);
- continue;
- }
- else
- while (c != ')')
- c = getc (infile);
skip_white (infile);
-
- /* If the next three characters aren't `dquote bslash newline'
- then we're not reading a docstring.
- */
- if ((c = getc (infile)) != '"'
- || (c = getc (infile)) != '\\'
- || ((c = getc (infile)) != '\n' && c != '\r'))
- {
+ if ((c = getc (infile)) != '\"')
+ {
#ifdef DEBUG
fprintf (stderr, "## non-docstring in %s (%s)\n",
buffer, filename);
@@ -931,24 +1033,16 @@
else if (! strcmp (buffer, "defvar")
|| ! strcmp (buffer, "defconst"))
{
- char c1 = 0, c2 = 0;
type = 'V';
- read_lisp_symbol (infile, buffer);
+ read_lisp_symbol (infile, buffer, filename);
if (saved_string == 0)
{
+ /* Skip the value */
+ skip_lisp_object (infile, filename);
- /* Skip until the end of line; remember two previous chars. */
- while (c != '\n' && c != '\r' && c >= 0)
- {
- c2 = c1;
- c1 = c;
- c = getc (infile);
- }
-
- /* If two previous characters were " and \,
- this is a doc string. Otherwise, there is none. */
- if (c2 != '"' || c1 != '\\')
+ skip_white (infile);
+ if ((c = getc (infile)) != '\"')
{
#ifdef DEBUG
fprintf (stderr, "## non-docstring in %s (%s)\n",
@@ -961,53 +1055,15 @@
else if (! strcmp (buffer, "custom-declare-variable"))
{
- char c1 = 0, c2 = 0;
type = 'V';
- c = getc (infile);
- if (c == '\'')
- read_lisp_symbol (infile, buffer);
- else
- {
- if (c != '(')
- {
- fprintf (stderr,
- "## unparsable name in custom-declare-variable in %s\n",
- filename);
- continue;
- }
- read_lisp_symbol (infile, buffer);
- if (strcmp (buffer, "quote"))
- {
- fprintf (stderr,
- "## unparsable name in custom-declare-variable in %s\n",
- filename);
- continue;
- }
- read_lisp_symbol (infile, buffer);
- c = getc (infile);
- if (c != ')')
- {
- fprintf (stderr,
- "## unparsable quoted name in custom-declare-variable in %s\n",
- filename);
- continue;
- }
- }
+ if (read_quoted_lisp_symbol (infile, buffer, filename, "custom-declare-variable"))
+ continue;
if (saved_string == 0)
{
- /* Skip to end of line; remember the two previous chars. */
- while (c != '\n' && c != '\r' && c >= 0)
- {
- c2 = c1;
- c1 = c;
- c = getc (infile);
- }
-
- /* If two previous characters were " and \,
- this is a doc string. Otherwise, there is none. */
- if (c2 != '"' || c1 != '\\')
+ skip_white (infile);
+ if ((c = getc (infile)) != '\"')
{
#ifdef DEBUG
fprintf (stderr, "## non-docstring in %s (%s)\n",
@@ -1020,51 +1076,15 @@
else if (! strcmp (buffer, "fset") || ! strcmp (buffer, "defalias"))
{
- char c1 = 0, c2 = 0;
type = 'F';
- c = getc (infile);
- if (c == '\'')
- read_lisp_symbol (infile, buffer);
- else
- {
- if (c != '(')
- {
- fprintf (stderr, "## unparsable name in fset in %s\n",
- filename);
- continue;
- }
- read_lisp_symbol (infile, buffer);
- if (strcmp (buffer, "quote"))
- {
- fprintf (stderr, "## unparsable name in fset in %s\n",
- filename);
- continue;
- }
- read_lisp_symbol (infile, buffer);
- c = getc (infile);
- if (c != ')')
- {
- fprintf (stderr,
- "## unparsable quoted name in fset in %s\n",
- filename);
- continue;
- }
- }
+ if (read_quoted_lisp_symbol (infile, buffer, filename, "fset"))
+ continue;
if (saved_string == 0)
{
- /* Skip to end of line; remember the two previous chars. */
- while (c != '\n' && c != '\r' && c >= 0)
- {
- c2 = c1;
- c1 = c;
- c = getc (infile);
- }
-
- /* If two previous characters were " and \,
- this is a doc string. Otherwise, there is none. */
- if (c2 != '"' || c1 != '\\')
+ skip_white (infile);
+ if ((c = getc (infile)) != '\"')
{
#ifdef DEBUG
fprintf (stderr, "## non-docstring in %s (%s)\n",
@@ -1078,34 +1098,10 @@
else if (! strcmp (buffer, "autoload"))
{
type = 'F';
- c = getc (infile);
- if (c == '\'')
- read_lisp_symbol (infile, buffer);
- else
- {
- if (c != '(')
- {
- fprintf (stderr, "## unparsable name in autoload in %s\n",
- filename);
- continue;
- }
- read_lisp_symbol (infile, buffer);
- if (strcmp (buffer, "quote"))
- {
- fprintf (stderr, "## unparsable name in autoload in %s\n",
- filename);
- continue;
- }
- read_lisp_symbol (infile, buffer);
- c = getc (infile);
- if (c != ')')
- {
- fprintf (stderr,
- "## unparsable quoted name in autoload in %s\n",
- filename);
- continue;
- }
- }
+
+ if (read_quoted_lisp_symbol (infile, buffer, filename, "autoload"))
+ continue;
+
skip_white (infile);
if ((c = getc (infile)) != '\"')
{
@@ -1117,13 +1113,10 @@
skip_white (infile);
if (saved_string == 0)
- {
- /* If the next three characters aren't `dquote bslash newline'
- then we're not reading a docstring. */
- if ((c = getc (infile)) != '"'
- || (c = getc (infile)) != '\\'
- || ((c = getc (infile)) != '\n' && c != '\r'))
- {
+ {
+ skip_white (infile);
+ if ((c = getc (infile)) != '\"')
+ {
#ifdef DEBUG
fprintf (stderr, "## non-docstring in %s (%s)\n",
buffer, filename);
@@ -1152,8 +1145,8 @@
dynamic doc string in saved_string
or gobble a doc string from the input file.
- In the latter case, the opening quote (and leading
- backslash-newline) have already been read. */
+ In the latter case, the opening quote has already been
+ read. */
putc (037, outfile);
putc (type, outfile);
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-14 3:11 ` Richard Stallman
@ 2002-02-14 15:13 ` Tak Ota
0 siblings, 0 replies; 28+ messages in thread
From: Tak Ota @ 2002-02-14 15:13 UTC (permalink / raw)
Cc: jasonr, eliz, lektu, emacs-devel, andrewi
Wed, 13 Feb 2002 20:11:53 -0700 (MST): Richard Stallman <rms@gnu.org> wrote:
> I see my recollection was mistaken: make-docfile reads the binary
> files directly. Sorry if I caused any confusion.
I want to withdraw the previous several attempts of make-docfile.c
modification. I now prostrate myself before the old wisdom. We
should leave those elc files for make-docfile as elc. The effort to
make make-docfile.c a true lisp interpreter does not seem to pay
off. It is redundant as well as unnecessary.
I think the (lisp) variable definition below should be reverted.
2001-11-30 Andrew Innes <andrewi@gnu.org>
* makefile.w32-in (FACE_SUPPORT):
(MOUSE_SUPPORT):
(FLOAT_SUPPORT):
(WINNT_SUPPORT):
(lisp): Reference .el files instead of .elc files, to simplify
bootstrapping.
($(DOC)): Change dependency to just `make-docfile'.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-14 7:36 ` Tak Ota
@ 2002-02-15 10:36 ` Richard Stallman
2002-02-15 20:36 ` Tak Ota
0 siblings, 1 reply; 28+ messages in thread
From: Richard Stallman @ 2002-02-15 10:36 UTC (permalink / raw)
Cc: jasonr, eliz, lektu, emacs-devel, andrewi
What is the reason for proposing these changes?
What problem are you trying to solve?
Is there no simpler solution?
A major change in make-docfile has substantial costs, but it won't
benefit users. So if it isn't necessary, we shouldn't do it.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
* Re: lost argument and doc string
2002-02-15 10:36 ` Richard Stallman
@ 2002-02-15 20:36 ` Tak Ota
0 siblings, 0 replies; 28+ messages in thread
From: Tak Ota @ 2002-02-15 20:36 UTC (permalink / raw)
Cc: jasonr, eliz, lektu, emacs-devel, andrewi
Fri, 15 Feb 2002 03:36:33 -0700 (MST): Richard Stallman <rms@gnu.org> wrote:
> What is the reason for proposing these changes?
> What problem are you trying to solve?
> Is there no simpler solution?
The reason was to recover the lost arguments and doc string on NT
platform. However I have withdrawn the proposal. I now think the
Makefile should be corrected instead of make-docfile.c.
> A major change in make-docfile has substantial costs, but it won't
> benefit users. So if it isn't necessary, we shouldn't do it.
I completely agree with you that we shouldn't do it. Sorry for the
confusion.
-Tak
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel
^ permalink raw reply [flat|nested] 28+ messages in thread
end of thread, other threads:[~2002-02-15 20:36 UTC | newest]
Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-10 6:59 lost argument and doc string Tak Ota
2002-02-10 17:08 ` Eli Zaretskii
2002-02-10 17:32 ` Pavel Janík
2002-02-10 23:28 ` Tak Ota
2002-02-11 5:48 ` Pavel Janík
2002-02-11 5:48 ` Eli Zaretskii
2002-02-11 16:34 ` Juanma Barranquero
2002-02-11 19:37 ` Eli Zaretskii
2002-02-12 2:32 ` Tak Ota
2002-02-12 8:35 ` Eli Zaretskii
2002-02-12 14:23 ` Tak Ota
2002-02-12 18:57 ` Jason Rumney
2002-02-12 19:48 ` Tak Ota
2002-02-13 5:43 ` Eli Zaretskii
2002-02-13 6:01 ` Tak Ota
2002-02-13 13:40 ` Andreas Schwab
2002-02-13 14:23 ` Eli Zaretskii
2002-02-13 19:50 ` Jason Rumney
2002-02-13 20:22 ` Tak Ota
2002-02-13 21:02 ` Jason Rumney
2002-02-14 7:36 ` Tak Ota
2002-02-15 10:36 ` Richard Stallman
2002-02-15 20:36 ` Tak Ota
2002-02-13 21:00 ` Tak Ota
2002-02-14 3:11 ` Richard Stallman
2002-02-14 15:13 ` Tak Ota
2002-02-13 15:37 ` Richard Stallman
2002-02-11 18:48 ` Richard Stallman
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).