Dmitry Antipov [Tue, 27 Aug 2013 04:23:54 +0000 (08:23 +0400)]
* xterm.h (FONT_TYPE_FOR_UNIBYTE, FONT_TYPE_FOR_MULTIBYTE:)
* nsterm.h (FONT_TYPE_FOR_UNIBYTE, FONT_TYPE_FOR_MULTIBYTE):
Remove the leftovers.
* gtkutil.c (toplevel): Do not declare Qxft but include
font.h to do so.
* image.c (toplevel): Do not declare Vlibrary_cache because
it's already done in lisp.h.
Paul Eggert [Mon, 26 Aug 2013 18:10:30 +0000 (11:10 -0700)]
Fix unlikely core dump in init_tty, and simplify terminfo case.
* term.c (init_tty) [TERMINFO]: Fix check for buffer overrun.
The old version incorrectly dumped core if malloc returned a
buffer containing only non-NUL bytes.
(init_tty): Do not allocate or free termcap buffers; the
struct does that for us now.
* termchar.h (TERMCAP_BUFFER_SIZE) [!TERMINFO]: New constant.
(struct tty_display_info): Define members termcap_term_buffer and
termcap_strings_buffer only if !TERMINFO, since terminfo doesn't
use them. Allocate them directly in struct rather than indirectly
via a pointer, to simplify init_tty.
Dmitry Antipov [Mon, 26 Aug 2013 14:00:55 +0000 (18:00 +0400)]
* lisp.h (Mouse_HLInfo): Drop set-but-unused members
mouse_face_beg_y and mouse_face_end_y.
* xdisp.c (note_tool_bar_highlight, mouse_face_from_buffer_pos)
(mouse_face_from_string_pos, note_mode_line_or_margin_highlight):
Adjust users and update comment where appropriate.
Michael Albinus [Mon, 26 Aug 2013 13:17:22 +0000 (15:17 +0200)]
* minibuffer.el: Revert change from 2013-08-20.
* net/tramp.el (tramp-find-method, tramp-find-user): Mark result
with text property `tramp-default', if appropriate.
(tramp-check-proper-host): New defun.
(tramp-dissect-file-name): Do not check hostname. Revert change
of 2013-03-18.
(tramp-backtrace): Make VEC-OR-PROC optional.
Dmitry Antipov [Mon, 26 Aug 2013 09:33:37 +0000 (13:33 +0400)]
* window.h (struct window): Replace last_cursor with last_cursor_vpos
because this is the only last cursor data we need to keep and consult.
* window.c (replace_window, set_window_buffer, Fsplit_window_internal):
* xdisp.c (mark_window_display_accurate_1, try_cursor_movement):
Adjust users.
Dmitry Antipov [Mon, 26 Aug 2013 05:32:47 +0000 (09:32 +0400)]
Fix recovering from possible decompression error. Since
insert_from_gap doesn't always move point, we can't use PT as
the position where the partially decompressed data ends, and
should count how may bytes was produced so far.
* decompress.c (struct decompress_unwind_data): Add nbytes member.
(unwind_decompress): Really delete partially uncompressed data.
(Fzlib_decompress_region): Take decompressed data size into account.
Dmitry Antipov [Mon, 26 Aug 2013 05:20:59 +0000 (09:20 +0400)]
* syntax.c (init_syntax_once): Adjust comment and do an early
initialization of Qchar_table_extra_slots just once...
* casetab.c (init_casetab_once):
* category.c (init_category_once):
* character.c (syms_of_character):
* coding.c (syms_of_coding):
* xdisp.c (syms_of_xdisp): ...and omit it here.
Eli Zaretskii [Sat, 24 Aug 2013 12:59:13 +0000 (15:59 +0300)]
Fix bug #15175 with cursor on boxed characters from display tables.
src/xdisp.c (get_next_display_element): Don't apply to characters
from a display vector the logic of setting it->end_of_box_run_p
suitable for characters from a buffer.
Paul Eggert [Sat, 24 Aug 2013 02:23:34 +0000 (19:23 -0700)]
System-dependent integer overflow fixes.
* process.c (Fset_process_window_size): Signal an error if
the window size is outside the range supported by the lower level.
* sysdep.c (set_window_size): Return negative on error,
nonnegative on success, rather than -1, 0, 1 on not in system,
failure, success. This is simpler. Caller changed.
(serial_configure): Remove unnecessary initialization of local.
(procfs_get_total_memory) [GNU_LINUX]: Don't assume system memory
size fits in unsigned long; this isn't true on some 32-bit hosts.
Avoid buffer overrun if some future version of /proc/meminfo has a
variable name longer than 20 bytes.
(system_process_attributes) [__FreeBSD__]:
Don't assume hw.availpages fits in 'int'.
Paul Eggert [Fri, 23 Aug 2013 17:57:07 +0000 (10:57 -0700)]
Don't let very long directory names overrun the stack.
Fix some related minor problems involving "//", vfork.
* callproc.c (encode_current_directory): New function.
(call_process): Don't append "/"; not needed.
* fileio.c (file_name_as_directory_slop): New constant.
(file_name_as_directory): Allow SRC to be longer than SRCLEN;
this can save the caller having to alloca.
(Ffile_name_as_directory, Fdirectory_file_name, Fexpand_file_name):
Use SAFE_ALLOCA, not alloca.
(directory_file_name, Fexpand_file_name): Leave leading "//"
alone, since it can be special even on POSIX platforms.
* callproc.c (call_process):
* process.c (Fformat_network_address):
* sysdep.c (sys_subshell):
Use encode_current_directory rather than rolling our own.
(create_process): No need to encode directory; caller does that now.
* process.h (encode_current_directory): New decl.
* sysdep.c (sys_subshell): Work even if vfork trashes saved_handlers.
Rework to avoid 'goto xyzzy;'.
Stefan Monnier [Fri, 23 Aug 2013 15:21:19 +0000 (11:21 -0400)]
* lisp/calc/calc-keypd.el (calc-keypad-execute): `x-flush-mouse-queue' doesn't
exist any more.
(calc-keypad-redraw): Remove unused var `pad'.
(calc-keypad-press): Remove unused var `menu'.
Martin Rudalics [Fri, 23 Aug 2013 06:52:19 +0000 (08:52 +0200)]
In display-buffer-pop-up-frame make BUFFER current (Bug#15133).
* window.el (display-buffer-pop-up-frame): Call pop-up-frame-function
with BUFFER current so `make-frame' will use it as the new frame's
buffer (Bug#15133).
Dmitry Antipov [Fri, 23 Aug 2013 04:03:25 +0000 (08:03 +0400)]
Minor cleanup for redisplay interface and few related functions.
* frame.h (enum text_cursor_kinds): Move from here...
* dispextern.h (enum text_cursor_kinds): ...to here.
(toplevel): Drop unnecessary declarations.
(struct redisplay_interface): Use bool and enum text_cursor_kinds
in update_window_end_hook and draw_window_cursor functions.
(display_and_set_cursor, x_update_cursor): Adjust prototypes.
* nsterm.m (ns_update_window_end, ns_draw_window_cursor):
* w32term.c (x_update_window_end,w32_draw_window_cursor):
* xterm.c (x_update_window_end, x_draw_window_cursor):
* xdisp.c (display_and_set_cursor, update_window_cursor)
(update_cursor_in_window_tree, x_update_cursor): Use bool and
enum text_cursor_kinds where appropriate.
This improves on the patch already installed, by quoting options
that contain spaces and suchlike systematically, so that
EMACS_CONFIG_OPTIONS is no longer ambiguous when options contain
these characters.
Stefan Monnier [Thu, 22 Aug 2013 04:06:45 +0000 (00:06 -0400)]
* lisp/erc/erc.el: Use lexical-binding.
(erc-user-full-name): Minor CSE simplification.
(erc-mode-map): Assume command-remapping is available.
(erc-once-with-server-event): Replace `forms' arg with a function arg.
(erc-once-with-server-event-global): Remove.
(erc-ison-p): Adjust to change in erc-once-with-server-event.
(erc-get-buffer-create): Remove arg `proc'.
(iswitchb-make-buflist-hook): Declare.
(erc-setup-buffer): Use pcase; avoid ((lambda ..) ..).
(read-passwd): Assume it exists.
(erc-display-line, erc-cmd-IDLE): Avoid add-to-list, adjust to change
in erc-once-with-server-event.
(erc-cmd-JOIN, erc-set-channel-limit, erc-set-channel-key)
(erc-add-query): Minor CSE simplification.
(erc-cmd-BANLIST, erc-cmd-MASSUNBAN): Adjust to change
in erc-once-with-server-event.
(erc-echo-notice-in-user-and-target-buffers): Avoid add-to-list.
* lisp/erc/erc-track.el: Use lexical-binding.
(erc-make-mode-line-buffer-name): Use closures instead of `(lambda...).
(erc-faces-in): Avoid add-to-list.
* lisp/erc/erc-notify.el: Use lexical-binding.
(erc-notify-timer): Adjust to change in erc-once-with-server-event.
(erc-notify-QUIT): Use a closure instead of `(lambda...).
* lisp/erc/erc-list.el: Use lexical-binding.
(erc-list-install-322-handler, erc-cmd-LIST): Adjust to change in
erc-once-with-server-event.
* lisp/erc/erc-button.el: Use lexical-binding.
(erc-button-next-function): Use a closure instead of `(lambda...).