Martin Rudalics [Thu, 26 Jul 2012 08:32:25 +0000 (10:32 +0200)]
In mouse-drag-line don't exit tracking prematurely (Bug#12006).
* mouse.el (popup-menu): Fix doc-string and re-indent code.
(mouse-drag-line): Don't exit tracking when a switch-frame or
switch-window event occurs (Bug#12006).
Paul Eggert [Thu, 26 Jul 2012 08:12:03 +0000 (01:12 -0700)]
Simplify export of symbols to GDB; fix related .gdbinit bugs.
* etc/emacs-buffer.gdb ($tagmask, $valmask): Remove.
(ygetptr): Adjust to recent changes in lisp.h and emacs.c,
by using VALMASK instead of $valmask, CHECK_LISP_OBJECT_TYPE
instead of gdb_use_union, and DATA_SEG_BITS instead of
gdb_data_seg_bits. Also, use $ptr.i rather than $ptr.u.val.
* src/.gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
$bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
(xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
Adjust to changes in lisp.h and emacs.c, by using
CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
instead of gdb_valbits.
(xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
instead of gdb_array_mark_flag.
(xboolvector): Get size from $->size, not $->header.size.
Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
(xreload, hook-run, hookpost-run): Remove.
* src/emacs.c: Include <verify.h>.
(gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
(gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
Remove.
(gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
(gdb_USE_LSB_TAG): New enum constants.
(CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
Also define these as enum constants, so they're visible to GDB.
(ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
(ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
as constants, so they're visible to GDB.
* src/lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
(PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
Now enum constants, not macros, so they're visible to GDB.
(CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
more convenient now. All uses changed.
(VALMASK) [USE_LSB_TAG]: Also define in this case.
* src/mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
Stefan Monnier [Thu, 26 Jul 2012 01:27:33 +0000 (21:27 -0400)]
Autoload more carefully from Lisp. Follow aliases for function properties.
* lisp/subr.el (autoloadp): New function.
(symbol-file): Use it.
(function-get): New function.
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Use function-get and
autoload-do-load.
* lisp/emacs-lisp/lisp-mode.el (lisp-font-lock-syntactic-face-function)
(lisp-indent-function):
* lisp/emacs-lisp/gv.el (gv-get):
* lisp/emacs-lisp/edebug.el (get-edebug-spec, edebug-basic-spec):
* lisp/emacs-lisp/byte-opt.el (byte-optimize-form):
* lisp/emacs-lisp/bytecomp.el (byte-compile-arglist-warn):
* lisp/emacs-lisp/autoload.el (make-autoload, autoload-print-form):
Use function-get.
* lisp/emacs-lisp/cl.el: Don't propagate function properties any more.
* src/eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
add argument, tune behavior, and adjust all callers.
Paul Eggert [Wed, 25 Jul 2012 22:47:42 +0000 (15:47 -0700)]
Use typedef for EMACS_INT, EMACS_UINT.
* lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
than macros. This simplifies debugging in the usual case, since
it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
and it allows expressions involving EMACS_INT casts.
* .gdbinit (xreload): Simplify by using EMACS_INT cast.
Adjust buffer text indirection counters at the end of Fkill_buffer.
* buffer.c (Fkill_buffer): Adjust indirection counters when the
buffer is definitely dead. This should really fix an issue reported
by Christoph Scholtes again. (Bug#12007).
(init_buffer_once): Initialize indirection counters of
buffer_defaults and buffer_local_symbols (for sanity and safety).
Eli Zaretskii [Tue, 24 Jul 2012 16:34:15 +0000 (19:34 +0300)]
Fix display of tooltips damaged by enhancements for bug #11832.
src/xdisp.c (init_iterator): Don't compute dimensions of truncation
and continuation glyphs on tooltip frames, leave them at zero.
Avoids displaying continued lines in tooltips.
Eli Zaretskii [Mon, 23 Jul 2012 17:27:41 +0000 (20:27 +0300)]
Fix displaying the user name in error message about no home directory.
lisp/startup.el (command-line): Don't display an empty user name in
the error message about non-existent home directory, when
init-file-user was set to an empty string. See
http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00835.html
for the details and context.
Eli Zaretskii [Mon, 23 Jul 2012 16:57:20 +0000 (19:57 +0300)]
Fix bug #12025 with a crash when displaying tooltips.
src/print.c (print_object): Don't crash when a frame's name is nil
or invalid.
src/window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
it signals an error when a tooltip frame is being created.
Swap buffer text indirection counters in Fbuffer_swap_text.
* buffer.c (Fbuffer_swap_text): Swap indirections too.
This avoids crash reported by Christoph Scholtes at
http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
Vincent Belaïche [Sun, 22 Jul 2012 21:14:12 +0000 (23:14 +0200)]
* ses.el (ses-cell-formula-aset): New macro.
(ses-cell-references-aset): New macro.
(ses-cell-p): New function.
(ses-rename-cell): Do no longer rely on complex operations like
ses-cell-set-formula or ses-set-cell to change the cell and handle
the undo at the same time, but rather use lower level new macros
`ses-cell-formula-aset' and `ses-cell-references-aset' and handle
the undo directly. Refresh the mode line.
Jan Djärv [Sun, 22 Jul 2012 16:35:15 +0000 (18:35 +0200)]
* nsmenu.m (Popdown_data): New struct.
(pop_down_menu): p->pointer is Popdown_data. Release the pool and
free Popdown_data.
(ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
(initWithContentRect): Make imgView and contentView non-static
and autorelease them. Also autorelease img and matrix.
(dealloc): Remove (Bug#1995-05-29T20:16:10Z!kwzh@gnu.org).
Adjust consing_since_gc when objects are explicitly freed.
* alloc.c (GC_DEFAULT_THRESHOLD): New macro.
(Fgarbage_collect): Use it. Change minimum to 1/10 of default.
(free_cons, free_misc): Subtract object size from consing_since_gc.
Simplify and cleanup markers positioning code.
* marker.c (attach_marker): More useful eassert.
(live_buffer, set_marker_internal): New function.
(Fset_marker, set_marker_restricted): Use set_marker_internal.
(set_marker_both, set_marker_restricted_both): Use live_buffer.
Eli Zaretskii [Sat, 21 Jul 2012 14:11:33 +0000 (17:11 +0300)]
Bind language-change in special-event-map.
src/keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
in special-event-map. See the discussion at
http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
for the reasons.
Eli Zaretskii [Sat, 21 Jul 2012 13:33:32 +0000 (16:33 +0300)]
Fix data type casting when setting up menus on Windows.
src/w32menu.c (add_menu_item): Cast to UINT_PTR when assigning
info.dwItemData. Fixes crashes on 64-bit Windows. Suggested by
Fabrice Popineau <fabrice.popineau@supelec.fr>.
Add indirection counting to speed up Fkill_buffer.
* buffer.h (struct buffer): New member.
* buffer.c (Fget_buffer_create): Set indirection counter to 0.
(Fmake_indirect_buffer): Set indirection counter to -1, increment
base buffer indirection counter.
(compact_buffer): If ENABLE_CHECKING, verify indirection counters.
(Fkill_buffer): Adjust indirection counters as needed, don't walk
through buffer list if indirection counter is 0.
Extend the value returned by Fgarbage_collect with heap statistics.
* alloc.c (Qheap): New symbol.
(syms_of_alloc): DEFSYM it.
(Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
(Fmemory_free): Remove.
(syms_of_alloc): Don't defsubr it.
* buffer.c (Fcompact_buffer): Remove.
(syms_of_buffer): Don't defsubr it.
* lisp/term/x-win.el (x-menu-bar-open): Use `frame-parameter'
to check whether menu-bar is shown or not. If not shown,
show the menu-bar as a popup menu instead of using tmm.
* lisp/mouse.el (popup-menu): Accept `point' as `position' argument.
* lisp/progmodes/ruby-mode.el (ruby-parse-partial): No error when end
up inside string symbol literal.
* test/automated/ruby-mode-tests.el: New file with one test.
Eli Zaretskii [Fri, 20 Jul 2012 10:29:32 +0000 (13:29 +0300)]
Fix display of Hebrew tutorial title on splash screen.
lisp/startup.el (fancy-startup-text): Read the whole tutorial, not
just its first 256 bytes. Prevents gibberish in display of the
tutorial title.
etc/tutorials/TUTORIAL.he: Make the first sentence display correctly
in a left-to-right paragraph, such as what is shown on the fancy
splash screen, by using directional control characters.
Simple wrapper for make_unibyte_string, adjust font_open_by_name.
* src/lisp.h (build_unibyte_string): New function.
* src/dosfns.c, src/fileio.c, src/fns.c, src/ftfont.c, src/process.c:
* src/sysdep.c, src/w32fns.c, src/xfns.c: Use it.
* src/font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
of type Lisp_Object to avoid redundant calls to make_unibyte_string.
Adjust users accordingly.
* src/font.h (font_open_by_name): Adjust prototype.
* admin/coccinelle/unibyte_string.cocci: Semantic patch to convert from
make_unibyte_string to build_unibyte_string where appropriate.
Paul Eggert [Thu, 19 Jul 2012 22:35:58 +0000 (15:35 -0700)]
* buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
(FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
'for_each_per_buffer_object_at'.
All uses changed. It's better to use upper-case for macros that
cannot be implemented as functions, to give the reader a clue
that they're special.
Stefan Monnier [Thu, 19 Jul 2012 11:39:38 +0000 (07:39 -0400)]
* lisp/emacs-lisp/chart.el: Use lexical-binding.
(chart-emacs-storage): Don't hardcode the list of entries.
* src/alloc.c (Fgarbage_collect): Tweak docstring.
Tweak the value returned from Fgarbage_collect again.
* src/alloc.c (Fgarbage_collect): New return value, as confirmed in
http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
Adjust documentation.
(total_vector_bytes): Rename to total_vector_slots, adjust
accounting.
(total_free_vector_bytes): Rename to total_free_vector_slots,
adjust accounting.
(Qstring_bytes, Qvector_slots): New symbols.
(syms_of_alloc): DEFSYM them.
* lisp/emacs-lisp/chart.el (chart-emacs-storage): Adjust again.
Andreas Schwab [Wed, 18 Jul 2012 21:33:37 +0000 (14:33 -0700)]
Fix bug that created negative-length intervals.
* intervals.c (merge_interval_right, merge_interval_left):
Do not zero out this interval if it is absorbed by its children,
as this interval's total length doesn't change in that case. See
<http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
* progmodes/python.el: Enhancements to eldoc support.
(python-info-current-symbol): New function.
(python-eldoc-at-point): Use python-info-current-symbol.
(python-info-current-defun): Fix cornercase on first defun scan.
(python-eldoc--get-doc-at-point): Use python-info-current-symbol
and signal error when no inferior python process is available.
Paul Eggert [Wed, 18 Jul 2012 17:26:43 +0000 (10:26 -0700)]
Remove some struct layout assumptions in bool vectors.
* alloc.c (bool_header_size): New constant.
(header_size, word_size): Move earlier, as they're now used earlier.
Use 'word_size' in a few more places, where it's appropriate.
(Fmake_bool_vector, sweep_vectors): Don't assume that there is no
padding before the data member of a bool vector.
(sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
than doing the check by hand with an abort ().
* vc/vc-git.el (vc-git-state): Don't call `vc-git-registered',
assume it's always t.
(vc-git-registered): Remove caching, the function is only called
once.
(vc-git-branches): Use `vc-git--call' instead of `call-process'.
Stefan Monnier [Wed, 18 Jul 2012 13:20:59 +0000 (09:20 -0400)]
* src/lisp.h (last_undo_boundary): Declare new var.
* src/keyboard.c (command_loop_1): Set it.
* src/cmds.c (Fself_insert_command): Use it to only remove boundaries that
were auto-added by the command loop.
Fix sweep_vectors to handle large bool vectors correctly.
* alloc.c (sweep_vectors): Account total_vector_bytes for
bool vectors larger than VBLOCK_BYTES_MAX.
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.