Chong Yidong [Wed, 20 Jun 2012 08:34:21 +0000 (16:34 +0800)]
Fixes to window size calculations in term.el.
* term.el (term-window-width): Handle the case of a missing right
fringe.
(term-check-size): Use window-text-height.
(term-mode): Use define-derived-mode. Minor cleanups.
Dmitry Antipov [Tue, 19 Jun 2012 16:56:28 +0000 (20:56 +0400)]
* alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
* font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
* print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
access to `contents' member of Lisp_Vector objects with AREF and ASET
where appropriate.
Kevin Gallagher [Tue, 19 Jun 2012 07:05:44 +0000 (15:05 +0800)]
In EDT emulator, allow updating of menu-bar Buffers menu.
* lisp/emulation/edt.el (edt-default-menu-bar-update-buffers)
(edt-user-menu-bar-update-buffers): New functions.
(edt-default-emulation-setup, edt-user-emulation-setup): Use them.
Chong Yidong [Tue, 19 Jun 2012 06:49:50 +0000 (14:49 +0800)]
Preserve tty top-frames under various window-changing operations.
* subr.el (with-selected-window): Preserve the selected window's
terminal's top-frame.
* window.el (save-selected-window): Likewise.
* frame.c (delete_frame): When selecting a frame on a different
text terminal, do not alter the terminal's top-frame.
* term.c (Ftty_top_frame): New function.
* xdisp.c (format_mode_line_unwind_data): Record the target
frame's selected window and its terminal's top-frame.
(unwind_format_mode_line): Restore them.
(x_consider_frame_title, display_mode_line, Fformat_mode_line):
Callers changed.
(x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
since tty frames can be explicitly named.
(prepare_menu_bars): Likewise.
Stefan Monnier [Mon, 18 Jun 2012 15:57:41 +0000 (11:57 -0400)]
Fix return value of `defun' and un-define it.
* src/data.c (Fdefalias): Return `symbol'.
* doc/lispref/functions.texi (Defining Functions):
* doc/lispref/macros.texi (Defining Macros): Un-define the return value of
`defun', `defmacro' and `defalias'.
Martin Rudalics [Mon, 18 Jun 2012 07:20:19 +0000 (09:20 +0200)]
Handle cases where buffer gets killed while running Fkill_buffer (Bug#11665).
* buffer.c (Fkill_buffer): Don't throw an error when the buffer
gets killed during executing of this function (Bug#11665). Try
to always return Qt when the buffer has been actually killed.
(Vkill_buffer_query_functions): In doc-string say that functions
run by this hook should not change the current buffer.
Paul Eggert [Mon, 18 Jun 2012 06:58:00 +0000 (23:58 -0700)]
Fix recently-introduced process.c problems found by static checking.
* process.c (write_queue_push, write_queue_pop, send_process):
Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
(write_queue_pop): Fix pointer signedness problem.
(send_process): Remove unused local.
Troels Nielsen [Sun, 17 Jun 2012 09:00:37 +0000 (17:00 +0800)]
Ensure correct ordering of process writes.
* process.c (make_process): Initialize write_queue.
(write_queue_push, write_queue_pop): New functions.
(send_process): Use them to maintain correct ordering of process writes.
Paul Eggert [Sun, 17 Jun 2012 08:21:25 +0000 (01:21 -0700)]
* lisp.h (eassert): Assume C89 or later.
This removes the need for CHECK.
(CHECK): Remove. Its comments about always evaluating its
argument were confusing, as 'eassert' typically does not evaluate
its argument.
Alp Aker [Sun, 17 Jun 2012 00:32:36 +0000 (20:32 -0400)]
Implement wave-style variant of underlining.
* doc/lispref/display.texi: Document new face attribute.
* lisp/cus-face.el (custom-face-attributes): Add wave-style underline
attribute.
* lisp/faces.el (set-face-attribute): Update docstring.
* src/dispextern.h (face_underline_type): New enum.
(face): Add field for underline type.
* src/nsterm.m (ns_draw_underwave): New function.
(ns_draw_text_decoration): Use it.
* src/w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
New functions.
(x_draw_glyph_string): Use them.
* src/xfaces.c (Qline, Qwave): New Lisp objects.
(check_lface_attrs, merge_face_ref)
(Finternal_set_lisp_face_attribute, realize_x_face): Handle
wave-style underline face attributes.
* src/xterm.c (x_draw_underwave): New function.
(x_draw_glyph_string): Use it.
Eli Zaretskii [Sat, 16 Jun 2012 13:17:14 +0000 (16:17 +0300)]
Fix "make dist" on MS-Windows.
nt/makefile.w32-in (install-addpm): New target.
(dist): Depend on it.
(install-shortcuts): Depend on install-addpm instead of copying
addpm.exe as part of the recipe. See
http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00171.html
for the related problem and discussions.
Eli Zaretskii [Sat, 16 Jun 2012 09:57:56 +0000 (12:57 +0300)]
Fix bug #11653 with cursor positioning in a row that has only strings.
src/xdisp.c (set_cursor_from_row): Don't dereference glyphs_end. If
all the glyphs of the glyph row came from strings, and we have no
cursor positioning clues, put the cursor on the first glyph of the
row.
Stefan Monnier [Fri, 15 Jun 2012 03:18:14 +0000 (23:18 -0400)]
* lisp/emacs-lisp/cl-lib.el (cl--defsubst-expand): Autoload inliner.
* lisp/emacs-lisp/macroexp.el (macroexp--compiler-macro): New function.
(macroexp--expand-all): Use it.
Andreas Schwab [Thu, 14 Jun 2012 14:22:37 +0000 (16:22 +0200)]
Fixes: debbugs:11708
* play/doctor.el (doctor-doc): Remove parameter and use
doctor-sent instead of sent.
(doctor-read-print): Use doctor-sent instead of sent.
Paul Eggert [Thu, 14 Jun 2012 02:27:39 +0000 (19:27 -0700)]
Simplify lisp.h in minor ways that should not affect code.
* lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
(LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
(LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
(INTTYPEBITS): New macro, for clarity.
(INTMASK, MOST_POSITIVE_FIXNUM): Use it.
(LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P): Simplify
now that USE_LSB_TAG is always defined.
(TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
(make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
Andreas Schwab [Wed, 13 Jun 2012 13:40:48 +0000 (15:40 +0200)]
Use a simple struct to implement compile time checks for the Lisp_Object type
* configure.in: Rename --enable-use-lisp-union-type to
--enable-check-lisp-object-type and define CHECK_LISP_OBJECT_TYPE
instead of USE_LISP_UNION_TYPE.
* admin/make-emacs: Rename --union-type to --check-lisp-type. Define
CHECK_LISP_OBJECT_TYPE insted of USE_LISP_UNION_TYPE.
* admin/CPP-DEFINES (DEBUG_LISP_OBJECT_TYPE): Renamed from
USE_LISP_UNION_TYPE.
* src/lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
instead of union.
(XLI, XIL): Define.
(XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG): Use
them.
* src/emacs.c (gdb_use_struct): Renamed from gdb_use_union.
* src/.gdbinit: Check gdb_use_struct instead of gdb_use_union.
* src/alloc.c (widen_to_Lisp_Object): Removed.
(mark_memory): Use XIL instead of widen_to_Lisp_Object.
* src/frame.c (delete_frame): Remove outdated comment.
* src/w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
USE_LISP_UNION_TYPE.
(Fw32_unregister_hot_key): Likewise.
(Fw32_toggle_lock_key): Likewise.
* src/w32menu.c (add_menu_item): Likewise.
(w32_menu_display_help): Use XIL instead of checking
USE_LISP_UNION_TYPE.
* src/w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
(init_heap): Likewise.
* src/w32term.c (w32_read_socket): Update comment.
Chong Yidong [Wed, 13 Jun 2012 07:33:38 +0000 (15:33 +0800)]
In the Package Menu, indicate packages that are newly-available.
* lisp/emacs-lisp/package.el (list-packages): Compute a list of
packages that are newly-available since the last list-packages
invocation.
(package-menu--new-package-list): New var.
(package-menu--generate, package-menu--print-info)
(package-menu--status-predicate, package-menu-mark-install):
Handle new status label "new".
Glenn Morris [Wed, 13 Jun 2012 02:32:49 +0000 (22:32 -0400)]
* src/s/gnu.h (POSIX_SIGNALS): Remove (again).
This was added in 2012-01 in response to http://debbugs.gnu.org/10552 .
However, this issue had already been fixed in the trunk two years
earlier, by removing POSIX_SIGNALS altogether. Ref:
* alloc.c (make_number) [!defined make_number]:
Remove, as lisp.h always defines this now.
(mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
(roundup_size): Verify that it is a power of 2.
* data.c (Fmake_variable_buffer_local, Fmake_local_variable):
* ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
* lisp.h (USE_LSB_TAG): Allow the builder to compile with
-DUSE_LSB_TAG=0, to override the automatically-selected default.
USE_LSB_TAG now is always defined to be either 0 or 1.
All uses changed.
(union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
code works fine either way, and efficiency is not a concern here,
as the union type is for debugging, not for production.
(LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
Use an inline function on all platforms when using the union type,
since this is simpler and 'static inline' can be used portably
within Emacs now.
(LISP_INITIALLY_ZERO): New macro.
(XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
(XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.