Commit 762b15be authored by Eli Zaretskii's avatar Eli Zaretskii

Fallout from resurrecting doprnt.

 src/doc.c (get_doc_string): Improve the format passed to `error'.
 src/doprnt.c (doprnt): Improve commentary.
 src/term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
 src/Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
 them with etags.
 src/makefile.w32-in (TAGS): Depend on $(CURDIR)/m/intel386.h and
 $(CURDIR)/s/ms-w32.h.
 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
parent f1052e5d
2011-04-24 Eli Zaretskii <eliz@gnu.org>
* doc.c (get_doc_string): Improve the format passed to `error'.
* doprnt.c (doprnt): Improve commentary.
* term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
* Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
them with etags.
* makefile.w32-in (globals.h): Add a dummy recipe, to make any
changes in globals.h immediately force recompilation.
(TAGS): Depend on $(CURDIR)/m/intel386.h and
$(CURDIR)/s/ms-w32.h.
(TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
* character.c (Fchar_direction): Function deleted.
(syms_of_character): Don't defsubr it.
......
......@@ -748,10 +748,10 @@ extraclean: distclean
ctagsfiles1 = [xyzXYZ]*.[hcm]
ctagsfiles2 = [a-wA-W]*.[hcm]
TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2)
TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) $(M_FILE) $(S_FILE)
../lib-src/etags --include=TAGS-LISP --include=$(lwlibdir)/TAGS \
--regex='/[ ]*DEFVAR_[A-Z_ (]+"\([^"]+\)"/' \
$(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2)
$(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) $(M_FILE) $(S_FILE)
frc:
TAGS-LISP: frc
$(MAKE) -f $(lispdir)/Makefile TAGS-LISP ETAGS=../lib-src/etags
......
......@@ -253,7 +253,9 @@ get_doc_string (Lisp_Object filepos, int unibyte, int definition)
else if (c == '_')
*to++ = 037;
else
error ("Invalid data in documentation file -- ^A followed by code 0%o", c);
error ("\
Invalid data in documentation file -- %c followed by code %03o",
1, (unsigned)c);
}
else
*to++ = *from++;
......
/* Output like sprintf to a buffer of specified size.
Also takes args differently: pass one pointer to an array of strings
in addition to the format string which is separate.
Also takes args differently: pass one pointer to the end
of the format string in addition to the format string itself.
Copyright (C) 1985, 2001-2011 Free Software Foundation, Inc.
This file is part of GNU Emacs.
......@@ -18,6 +18,35 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* If you think about replacing this with some similar standard C function of
the printf family (such as vsnprintf), please note that this function
supports the following Emacs-specific features:
. For %c conversions, it produces a string with the multibyte representation
of the (`int') argument, suitable for display in an Emacs buffer.
. For %s and %c, when field width is specified (e.g., %25s), it accounts for
the diplay width of each character, according to char-width-table. That
is, it does not assume that each character takes one column on display.
. If the size of the buffer is not enough to produce the formatted string in
its entirety, it makes sure that truncation does not chop the last
character in the middle of its multibyte sequence, producing an invalid
sequence.
. It accepts a pointer to the end of the format string, so the format string
could include embedded null characters.
. It signals an error if the length of the formatted string is about to
overflow MOST_POSITIVE_FIXNUM, to avoid producing strings longer than what
Emacs can handle.
OTOH, this function supports only a small subset of the standard C formatted
output facilities. E.g., %u and %ll are not supported, and precision is
largely ignored except for converting floating-point values. However, this
is okay, as this function is supposed to be called from `error' and similar
functions, and thus does not need to support features beyond those in
`Fformat', which is used by `error' on the Lisp level. */
#include <config.h>
#include <stdio.h>
......
......@@ -330,7 +330,7 @@ cleanall: clean
##
## This works only with GNU Make.
TAGS: $(OBJ0) $(OBJ1) $(OBJ2)
TAGS: $(OBJ0) $(OBJ1) $(OBJ2) $(CURDIR)/m/intel386.h $(CURDIR)/s/ms-w32.h
$(MAKE) $(MFLAGS) TAGS-$(MAKETYPE)
TAGS-LISP: $(OBJ0) $(OBJ1) $(OBJ2)
......@@ -344,7 +344,7 @@ TAGS-gmake:
$(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ1))
../lib-src/$(BLD)/etags.exe -a --regex=@../nt/emacs-src.tags \
$(patsubst $(BLD)%.$(O),$(CURDIR)%.c,$(OBJ2)) \
$(CURDIR)/*.h
$(CURDIR)/*.h $(CURDIR)/m/intel386.h $(CURDIR)/s/ms-w32.h
TAGS-nmake:
echo This target is not supported with NMake
......
......@@ -3121,7 +3121,7 @@ init_tty (const char *name, const char *terminal_type, int must_succeed)
terminal = create_terminal ();
#ifdef MSDOS
if (been_here > 0)
maybe_fatal (1, 0, "Attempt to create another terminal %s", "",
maybe_fatal (0, 0, "Attempt to create another terminal %s", "",
name, "");
been_here = 1;
tty = &the_only_display_info;
......@@ -3627,7 +3627,7 @@ vfatal (const char *str, va_list ap)
/* Auxiliary error-handling function for init_tty.
Delete TERMINAL, then call error or fatal with str1 or str2,
respectively, according to MUST_SUCCEED. */
respectively, according to whether MUST_SUCCEED is zero or not. */
static void
maybe_fatal (int must_succeed, struct terminal *terminal,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment