Eli Zaretskii [Sun, 24 Apr 2011 09:00:03 +0000 (12:00 +0300)]
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.
Eli Zaretskii [Sun, 24 Apr 2011 07:11:56 +0000 (10:11 +0300)]
Delete char-direction-table and char-direction.
See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00675.html
for the reasons.
src/character.c (Fchar_direction): Function deleted.
(syms_of_character): Don't defsubr it.
<char-direction-table>: Deleted.
etc/NEWS: Document the removal.
Eli Zaretskii [Sat, 23 Apr 2011 10:33:28 +0000 (13:33 +0300)]
Fix doprnt so it could be used safely in `verror'. (Bug#8435)
src/doprnt.c: Include limits.h.
(SIZE_MAX): New macro.
(doprnt): Return a size_t value. 2nd arg is now size_t. Many
local variables are now size_t instead of int or unsigned.
Improve overflow protection. Support `l' modifier for integer
conversions. Support %l conversion. Don't assume an EMACS_INT
argument for integer conversions and for %c.
src/lisp.h (doprnt): Restore prototype.
src/makefile.w32-in ($(BLD)/callint.$(O)): Depend on
$(SRC)/character.h.
src/Makefile.in (base_obj): Add back doprnt.o.
src/deps.mk (doprnt.o): Add back prerequisites.
(callint.o): Depend on character.h.
src/eval.c (internal_lisp_condition_case): Include the handler
representation in the error message.
(verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
when breaking from the loop.
src/xdisp.c (vmessage): Call doprnt instead of vsnprintf.
src/callint.c (Fcall_interactively): When displaying error message
about invalid control letter, pass the character's codepoint, not
a pointer to its multibyte form. Improve display of the character
in octal and display also its hex code.
src/character.c (char_string): Use %x to display the (unsigned)
codepoint of an invalid character, to avoid displaying a bogus
negative value.
src/font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
`error', not SYMBOL_NAME itself.
src/coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
character arguments to `error'.
src/charset.c (check_iso_charset_parameter): Fix incorrect argument
to `error' in error message about FINAL_CHAR argument. Make sure
FINAL_CHAR is a character, and use %c when it is passed as
argument to `error'.
gnus-registry.el (gnus-registry-ignore-group-p): Test specifically for the case where `gnus-registry-ignored-groups' is a list of lists, and don't call `gnus-parameter-registry-ignore' otherwise.
* emacs-lisp/package.el (package--builtins, package-alist)
(package-load-descriptor, package-built-in-p, package-activate)
(define-package, package-installed-p)
(package-compute-transaction, package-buffer-info)
(package--push): Doc fix. Distinguish more clearly between
version strings and version lists.
nnimap.el (nnimap-user): New backend variable.
(nnimap-open-connection-1): Use it.
(nnimap-credentials): Accept user parameter so it's explicit what user name is desired.
gnus-sum.el (gnus-extra-headers): Add Keywords, Cc, and Gcc to default.
gnus-registry.el: Mention in comments how to modify `gnus-extra-headers' for proper recipient tracking and that it may already have To and Cc recently, which it does as of this commit.
gnus.el (gnus-registry-ignored-groups): Provide default in gnus.el, not gnus-registry.el.
gnus-registry.el (gnus-registry-ignored-groups): Remove defcustom. Explain why in comments.
(gnus-registry-action): Fix data-header reference to use the extra headers. Explain in package commentary how to add To and Cc headers to the gnus-extra-headers.
(gnus-registry-ignored-groups): Adjust defaults to match the parameter.
(gnus-registry-ignore-group-p): Adjust to take either a group/topic parameter list or a string list in `gnus-registry-ignored-groups'. Fix logic error.
Stefan Monnier [Wed, 20 Apr 2011 22:31:06 +0000 (19:31 -0300)]
* lisp/shell.el: Use lexical-binding and std completion UI.
(shell-filter-ctrl-a-ctrl-b): Work as a preoutput filter.
(shell-mode): Put shell-filter-ctrl-a-ctrl-b on
comint-preoutput-filter-functions rather than on
comint-output-filter-functions.
(shell-command-completion, shell--command-completion-data)
(shell-filename-completion, shell-environment-variable-completion)
(shell-c-a-p-replace-by-expanded-directory): New functions.
(shell-dynamic-complete-functions, shell-dynamic-complete-command)
(shell-dynamic-complete-filename, shell-replace-by-expanded-directory)
(shell-dynamic-complete-environment-variable): Use them.
(shell-dynamic-complete-as-environment-variable)
(shell-dynamic-complete-as-command): Remove.
(shell-match-partial-variable): Match past point.
* lisp/comint.el: Clean up use of completion-at-point-functions.
(comint-completion-at-point): New function.
(comint-mode): Use it completion-at-point-functions.
(comint-dynamic-complete): Make it obsolete.
(comint-replace-by-expanded-history-before-point): Add dry-run arg.
(comint-c-a-p-replace-by-expanded-history): New function.
(comint-dynamic-complete-functions)
(comint-replace-by-expanded-history): Use it.
* lisp/minibuffer.el (completion-table-with-terminator): Allow dynamic
termination strings. Try harder to avoid second try-completion.
(completion-in-region-mode-map): Disable bindings that don't work yet.
gnus-registry.el (gnus-registry--split-fancy-with-parent-internal): Fix loop bugs.
(gnus-registry-ignored-groups): New variable.
(gnus-registry-ignore-group-p): Use it.
(gnus-registry-handle-action): Use `gnus-registry-ignore-group-p' and set the destination group to nil (same as delete) if it's ignored.
* lisp/vc/vc.el (vc-diff-build-argument-list-internal)
(vc-version-ediff, vc-ediff): New functions.
(vc-version-diff): Use vc-diff-build-argument-list-internal.
* doc/emacs/maintaining.texi (Old Revisions): Add paragraph on new function
vc-ediff.
* etc/NEWS: Document new function `vc-ediff'.
* lisp/calendar/solar.el (solar-horizontal-coordinates):
Use the longitude argument rather than `calendar-longitude' (15yr old bug).
(solar-date-next-longitude): Remove unused locals.
Stefan Monnier [Tue, 19 Apr 2011 15:33:34 +0000 (12:33 -0300)]
* lisp/progmodes/octave-mod.el (octave-in-comment-p, octave-in-string-p)
(octave-not-in-string-or-comment-p): Use syntax-ppss so it works with
multi-line comments as well.
Eli Zaretskii [Tue, 19 Apr 2011 10:48:30 +0000 (13:48 +0300)]
Support buffers > 2GB on 64-bit hosts.
src/insdel.c (make_gap_larger): Remove limitation of buffer size
to <= INT_MAX.
src/syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
gl_state.e_property when gl_state.object is Qt.
Allow glyphless-char-display to distinguish between X and text terminals.
Use this for Tabulated List mode.
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-mode): Use a custom
glyphless-char-display table.
(tabulated-list-glyphless-char-display): New var.
* src/term.c (produce_glyphless_glyph): Handle cons cell entry in
glyphless-char-display.
* src/xdisp.c (lookup_glyphless_char_display)
(produce_glyphless_glyph): Handle cons cell entry in
glyphless-char-display.
(Vglyphless_char_display): Document it.
* lisp/calendar/diary-lib.el (diary-sexp-entry):
* lisp/calendar/holidays.el (holiday-sexp):
Set debug-on-error rather than the removed stack-trace-on-error.
Eli Zaretskii [Sat, 16 Apr 2011 18:26:30 +0000 (21:26 +0300)]
Fix regex.c, syntax.c and friends for buffers > 2GB.
src/syntax.h (struct gl_state_s): Declare character position members
EMACS_INT.
src/syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
src/textprop.c (verify_interval_modification, interval_of): Declare
arguments EMACS_INT.
src/intervals.c (adjust_intervals_for_insertion): Declare arguments
EMACS_INT.
src/intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
src/indent.c (Fvertical_motion): Local variable it_start is now
EMACS_INT.
src/regex.c (re_match, re_match_2, re_match_2_internal)
(bcmp_translate, regcomp, regexec, print_double_string)
(group_in_compile_stack, re_search, re_search_2, regex_compile)
(re_compile_pattern, re_exec): Declare arguments and local
variables `size_t' and `ssize_t' and return values `regoff_t', as
appropriate.
(POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
(CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
<compile_stack_type>: `size' and `avail' are now `size_t'.
src/regex.h <regoff_t>: Use ssize_t, not int.
(re_search, re_search_2, re_match, re_match_2): Arguments that
specify buffer/string position and length are now ssize_t and
size_t. Return type is regoff_t.
Paul Eggert [Sat, 16 Apr 2011 15:24:20 +0000 (08:24 -0700)]
* xterm.c: Fix problems found by static analysis with other toolkits.
(toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
(x_dispatch_event): Declare static only if !USE_GTK && USE_X_TOOLKIT.
Define if USE_GTK || (HAVE_MENUS && USE_X_TOOLKIT); USE_MOTIF need
not be part of this test.
(SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
* xterm.h (x_dispatch_event): Use USE_GTK, not USE_MOTIF, when testing
whether to declare.
* xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only if
defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
Paul Eggert [Sat, 16 Apr 2011 08:25:42 +0000 (01:25 -0700)]
Modernize to C89, for better static checking.
* Activate.c (XMenuActivate): Callback's first arg is readonly.
* AddPane.c (XMenuAddPane): Label is readonly. Rename local
to avoid shadowing.
* AddSel.c (XMenuAddSelection): Help arg is readonly. Rename local.
* Create.c (atoi, atof): Remove decls; include <stdlib.h>.
(MAX_INACT_PNUM, TILE_BUF_SIZE): Remove; unused.
(x_get_resource_string): Args are readonly.
(XAllocDisplayColor): colorName is readonly.
(XMenuCreate): def_env is readonly. Remove unused locals. Avoid
"else;".
* Destroy.c (XMenuDestroy): Return void.
* Error.c (XMenuError): Remove const pointer.
* EvHand.c (XMenuEventHandler): Return void.
* FindPane.c, FindSel.c: Include <string.h>.
* InsPane.c (XMenuInsertPane): Rename local to avoid shadowing.
* InsSel.c (XMenuInsertSelection): Likewise.
* Internal.c (toggle_color, BUFFER_SIZE): Remove; unused.
(_XMErrorList): Now const.
(_XMWinQueInit, _XMRecomputeGlobals, _XMTransToOrigin, _XMRefreshPane):
(_XMRefreshSelection): Return void.
(_XMWinQueFlush, _XMRefreshSelection): Rename locals to avoid
shadowing.
(_XMWinQueFlush): Use stack, not heap. Don't use uninitialized var.
* SetAEQ.c (XMenuSetAEQ): Now returns void.
* SetFrz.c (XMenuSetFreeze): Likewise.
* X10.h (XAssoc): Use void * for generic pointer.
* XDelAssoc.c: Include XMenuInt.h rather than duplicating part of it.
* XDestAssoc.c, XMakeAssoc.c: Likewise.
* XDestAssoc.c (XDestroyAssocTable): Return void.
* XMakeAssoc.c (XMakeAssoc): Use void * for generic pointer.
* XMenu.h, XMenuInt.h: Adjust to signature changes. Use const
for pointers to readonly storage.
* insque.c: Include XMenuInt.h, to check our own signature.
(emacs_insque, emacs_remque): Use void * for generic pointers.
registry.el (registry-reindex): New method to recreate the secondary registry indices.
gnus-registry.el (gnus-registry-fixup-registry): Use it if the tracked field changes.
(gnus-registry-unfollowed-addresses, gnus-registry-track-extra)
(gnus-registry-action, gnus-registry-spool-action)
(gnus-registry-handle-action)
(gnus-registry--split-fancy-with-parent-internal)
(gnus-registry-split-fancy-with-parent)
(gnus-registry-register-message-ids): Add recipient tracking on spool, move, and delete actions, and for fancy splitting with parent.
(gnus-registry-extract-addresses)
(gnus-registry-fetch-recipients-fast)
(gnus-registry-fetch-header-fast): Convenience functions.
(gnus-registry-misc-test): ERT test of `gnus-registry-extract-addresses'.