Return more descriptive data from Fgarbage_collect.
Suggested by Stefan Monnier in
http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
* src/alloc.c (bounded_number): New function.
(total_buffers, total_vectors): New variable.
(total_string_size): Rename to total_string_bytes, adjust users.
(total_vector_size): Rename to total_vector_bytes, adjust users.
(sweep_vectors): Account total_vectors and total_vector_bytes.
(Fgarbage_collect): New return value. Adjust documentation.
(gc_sweep): Account total_buffers.
(Fmemory_free, Fmemory_use_counts): Use bounded_number.
(VECTOR_SIZE): Remove.
* src/data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
(Qinterval, Qmisc): New symbols.
(syms_of_data): Initialize them.
* src/lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
(Qcons, Qbuffer): New declarations.
* lisp/emacs-lisp/chart.el (chart-emacs-storage): Change to
reflect new format of data returned by Fgarbage_collect.
New utility functions + python-info-ppss-context fix.
* progmodes/python.el (python-info-beginning-of-block-statement-p)
(python-info-ppss-comment-or-string-p): New functions.
(python-info-ppss-context): Small fix for string check.
Juri Linkov [Tue, 17 Jul 2012 18:40:15 +0000 (21:40 +0300)]
* lisp/dired-aux.el (dired-do-async-shell-command): Doc fix.
(dired-do-async-shell-command): Don't add `*' at the end of the
command (Bug#11815).
(dired-do-shell-command): Doc fix.
(dired-shell-stuff-it): Strip the trailing "&" and ";" if any.
Join the individual commands using either "&" or ";" as the
separator depending on the values of these trailing characters.
At the end re-add the trailing "&". (Bug#10598)
* lisp/simple.el (async-shell-command): Sync the interactive spec with
`shell-command'. Doc fix.
(shell-command): Doc fix.
Final renames and doc fixes for movement commands.
* progmodes/python.el (python-nav-beginning-of-statement): Rename
from python-nav-statement-start.
(python-nav-end-of-statement): Rename from
python-nav-statement-end.
(python-nav-beginning-of-block): Rename from
python-nav-block-start.
(python-nav-end-of-block): Rename from python-nav-block-end.
Restore old code in allocate_string_data to avoid Faset breakage.
Reported by Julien Danjou <julien@danjou.info> in
http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
* alloc.c (allocate_string_data): Restore old code with minor
adjustments, fix comment to explain this subtle issue.
Stefan Monnier [Tue, 17 Jul 2012 08:15:06 +0000 (04:15 -0400)]
Misc minor changes.
* lisp/xt-mouse.el (xterm-mouse-translate-1, xterm-mouse-event-read):
Use read-event since we don't really want to read chars but bytes.
* lisp/emacs-lisp/macroexp.el (macroexp-let2): Use more informative names
for uninterned vars.
Stefan Monnier [Tue, 17 Jul 2012 08:11:31 +0000 (04:11 -0400)]
* lisp/textmodes/tex-mode.el (tex-font-lock-keywords-1): Highlight not only
$$..$$ but also $..$ using regexps.
Use tex-verbatim for \url and \path.
(tex-font-lock-keywords): Define as defconst like the others.
(tex-common-initialization): Don't use font-lock-syntax-table any more.
* test/indent/latex-mode.tex: New file.
Cleanup overlays checking.
* buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
* buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
eassert and OVERLAYP.
(sort_overlays): Change to use OVERLAYP.
Paul Eggert [Tue, 17 Jul 2012 02:09:58 +0000 (19:09 -0700)]
Fix regression with pthread_sigmask on FreeBSD.
* configure.ac: Configure gnulib at the end, not before running
pkg-config. This restores the behavior before 2012-06-22, when
higher-resolution time stamps were added, and fixes a bug whereby
LIB_PTHREAD was not used and gnulib's part of 'configure'
therefore incorrectly assumed that pthread_sigmask wasn't working.
Fix the problem with -lrt and clock_gettime a different way.
This should complete the fix for Bug#11884.
(pre_PKG_CONFIG_CFLAGS, pre_PKG_CONFIG_LIBS): New shell vars.
Eli Zaretskii [Sun, 15 Jul 2012 14:41:08 +0000 (17:41 +0300)]
Fix bug #11943 with slow redisplay in large paragraphs full of weak characters.
src/bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
(bidi_paragraph_init): Use it to limit search forward for a strong
directional character in abnormally large paragraphs full of
neutral or weak characters.
* src/gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
the toolbar.
(xg_make_tool_item): Give the widget event box a transparent background.
* xt-mouse.el: Implement extended mouse coordinates.
(xterm-mouse-translate): Move code into xterm-mouse-translate-1.
(xterm-mouse-translate-extended, xterm-mouse-translate-1)
(xterm-mouse--read-event-sequence-1000)
(xterm-mouse--read-event-sequence-1006): New functions. For old
mouse protocol, handle M-mouse-X events correctly.
(xterm-mouse-event): New arg specifying mouse protocol.
(turn-on-xterm-mouse-tracking-on-terminal)
(turn-off-xterm-mouse-tracking-on-terminal): Send DEC 1006
sequence to toggle extended coordinates on newer XTerms. This
appears to be harmless on terminals which do not support this.
Eli Zaretskii [Sat, 14 Jul 2012 10:46:56 +0000 (13:46 +0300)]
Don't use FILE_SYSTEM_CASE in MS-DOS, or anywhere else.
src/s/msdos.h (FILE_SYSTEM_CASE): Don't define.
src/fileio.c (FILE_SYSTEM_CASE): Don't define.
(Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
Fixes problems on MS-DOS with Vtemp_file_name_pattern when
call-process-region passes it through expand-file-name.
src/dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
admin/CPP-DEFINES: Remove FILE_SYSTEM_CASE.
Eli Zaretskii [Sat, 14 Jul 2012 10:08:14 +0000 (13:08 +0300)]
Adapt the MS-DOS build to the latest configury changes.
msdos/sed1v2.inp: In the recipe for $(leimdir)/leim-list.el, edit the
prerequisites to be "temacs$(EXEEXT) $(BOOTSTRAPEMACS)", to avoid
the need to rebuild $(bootstrap_exe), which requires a Unixy shell
via lisp/Makefile.in's "update-subdirs" command.
msdos/sedlibmk.inp (am_libgnu_a_OBJECTS): Adjust the removal of
careadlinkat.$(OBJEXT) to the changes in lib/Makefile.in.
msdos/sed2v2.inp (DATA_START, GC_SETJMP_WORKS, HAVE_MENUS)
(HAVE_MOUSE): Edit for DJGPP, according to what was previously
done on src/s/msdos.h.
msdos/gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
src/s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
(HAVE_MENUS): Don't define, defined by editing config.in with
msdos/sed2v2.inp.
(GMALLOC_INHIBIT_VALLOC): Don't define.
(MODE_LINE_BINARY_TEXT): Remove, not used anymore.
Jan Djärv [Fri, 13 Jul 2012 18:03:10 +0000 (20:03 +0200)]
Remove compiler warnings in objective-C files.
* nsfns.m (x_set_icon_name, ns_set_name_internal)
(ns_set_name_as_filename, ns_implicitly_set_icon_type)
(x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
(Fns_get_resource, Fns_set_resource, Fx_open_connection)
(Fns_font_name, Fns_perform_service)
(Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
(Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
(ns_set_name): Remove unused variable view.
(x_set_menu_bar_lines): Remove unused variable olines.
(x_set_tool_bar_lines): Remove unused variable root_window.
(Fns_list_colors): Put () around assignment in while statement.
(Fns_perform_service): Remove unused variable len.
(Fns_display_usable_bounds): Remove unused variable top.
(syms_of_nsfns): Remove unused variable i.
* nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
(ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
where appropriate.
(ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
around assignment in loop statement.
(nsfont_open): Remove unused variable i.
(nsfont_open): Remove unused variable len.
(nsfont_draw): Remove unused variable cs.
* nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
appropriate.
(setXBMColor): Remove unused variable len.
(setPixmapData): Put () around assignment in loop statement.
* nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
(initFromContents): Use SSDATA where appropriate.
(ns_update_menubar): Add braces to ambigous if-else.
(initWithTitle): Put () around assignment in if statement.
(ns_menu_show): Remove unused variables window and keymap.
(update_frame_tool_bar): Remove unused variable selected_p.
(initWithContentRect): Remove unused variable this_cmd_name.
* nsterm.h (menuDown): Add id as type to argument sender.
(ns_display_info_for_name): Add Lisp_Object argument.
(ns_term_init): Add Lisp_Object argument.
(ns_map_event_to_object): Add void argument.
(ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
prototype with arguments and only declare if __OBJC__.
(nxatoms_of_nsselect): Add void argument.
(ns_lisp_to_cursor_type): Add Lisp_Object argument.
(ns_alloc_autorelease_pool): Add void argument.
(ns_release_autorelease_pool): Add void* argument.
(ns_get_defaults_value): Add const char* argument.
* nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
(x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
(ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
(ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
where appropriate.
(ns_exec_path, ns_load_path, changeFont): Put () around assignment used
as boolean expression.
(x_set_window_size): Remove unused variable toolbar.
(ns_get_color_default, ns_mod_to_lisp): Remove.
(ns_mouse_position): Remove unused variables xchar and ychar.
(ns_compute_glyph_string_overhangs): Remove unused variable face.
(ns_set_vertical_scroll_bar): Remove unused variable count.
(ns_delete_terminal): Remove unused variable i.
(ns_term_init): Remove unused variables r, g and b.
(mouseDown): Remove unused variable window.
(windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
(initFrameFromEmacs): Remove unused variable vbextra.
(mouseEntered): Remove unused variables p and dpyinfo.
(mouseExited): Remove unused variables p and r.
(ns_define_frame_cursor, ns_clear_frame_area)
(ns_draw_window_cursor, ns_initialize_display_info): Make static.
(menuDown): Assign [sender tag] to variable and cast the variable.
* src/s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
(HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
Set here, not in nt/config.nt.
Eli Zaretskii [Fri, 13 Jul 2012 10:11:37 +0000 (13:11 +0300)]
Fix bs-show when the right fringe is off.
src/xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
cursor overflow into the last glyph on display line when the right
fringe is off. (Bug#11832)
Clarify the documentation of toggle-read-only, and audit the code tree
for uses of toggle-read-only; where appropriate, switch to setting the
variable buffer-read-only or calling toggle-read-only with a (new)
second arg.
* lisp/files.el (toggle-read-only): Doc fix and code cleanup. New arg
to allow printing the message when called from Lisp.
* lisp/bindings.el (mode-line-toggle-read-only):
* lisp/dired.el (dired-toggle-read-only):
* lisp/ibuffer.el (ibuffer-do-toggle-read-only): Call toggle-read-only
with non-nil second arg.
* lisp/bs.el (bs-toggle-readonly):
* lisp/buff-menu.el (Buffer-menu-toggle-read-only): Remove
with-no-warnings around toggle-read-only.
* lisp/ffap.el (ffap--toggle-read-only): Accept a list of buffers.
Remove with-no-warnings around toggle-read-only.
(ffap-read-only, ffap-read-only-other-window)
(ffap-read-only-other-frame): Callers changed.
* lisp/help-mode.el: Don't require view package.
(help-mode-finish): Set buffer-read-only instead of calling
toggle-read-only.
* lisp/emacs-lisp/eieio-custom.el (eieio-customize-object):
* lisp/vc/ediff.el (ediff-set-read-only-in-buf-A): Set buffer-read-only
directly.
* lisp/gnus/smime.el (smime-certificate-info): Set buffer-read-only directly,
instead of calling toggle-read-only with a (bogus) argument.
* doc/lispref/buffers.texi (Read Only Buffers): Document toggle-read-only
changes. Reword to account for the fact that read-only is currently not
supported in overlay properties.
Do not unconditionally define HAVE_XRMSETDATABASE on some systems
* src/s/gnu-linux.h, src/s/hpux10-20.h:
Do not unconditionally define HAVE_XRMSETDATABASE.
Maybe there was a time when this made sense, but in the current tree
it is totally illogical. This is only used in xterm.c. If it is set
we call XrmSetDatabase, if not we do something else. Configure tests
for XrmSetDatabase and sets HAVE_XRMSETDATABASE accordingly. The only
possibility that is not totally nonsensical is that the system does in
fact have XrmSetDatabase but configure failed to find it (I don't see
how this could happen though...); in which case we should fix the
configure test rather than force the results. But this is not what
the (vague) comments say was happending.
The gnu-linux piece dates from 1995, the hpux one from 2000.
https://groups.google.com/forum/?fromgroups#!topic/gnu.emacs.bug/H24wEM8Vp9A
From: rainer@displaytech.com (Rainer Malzbender)
Subject: Compiling emacs 20.4 on HP-UX 10.20 with gcc
Date: 2000/02/01
Newsgroups: gnu.emacs.bug
Eli Zaretskii [Thu, 12 Jul 2012 19:55:01 +0000 (22:55 +0300)]
Improve fix for bug #11832 with truncated/continued lines w/o margins.
src/xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
memmove call that removes glyphs covered by the left truncation
glyph. Improve commentary.
(display_line): Fix display of continuation glyphs on GUI frames
when the right fringe is turned off and variable-size fonts are
used in the window. Move the code that appends a stretch glyph to
produce_special_glyphs, so that it could be used for truncation
and continuation glyphs alike.
(produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
glyph of a suitably computed width, to align the special glyphs at
the window margin. Code moved from display_line.
Paul Eggert [Thu, 12 Jul 2012 16:58:37 +0000 (09:58 -0700)]
Fix typos that broke OS X build.
Reported by Randal L. Schwartz in
<http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
* nsterm.m (ns_timeout): Add missing local decl.
(ns_get_color): snprintf -> sprintf, to fix typo.