Ulrich Müller [Sat, 31 Aug 2013 19:54:17 +0000 (12:54 -0700)]
* configure.ac: Allow for --with-sound=voxware that will enable
sound but otherwise disable ALSA. This will use the OSS device,
typically /dev/dsp, for sound output.
Stefan Monnier [Thu, 29 Aug 2013 21:00:18 +0000 (17:00 -0400)]
* lisp/textmodes/css-mode.el: Use SMIE.
(css-smie-grammar): New var.
(css-smie--forward-token, css-smie--backward-token)
(css-smie-rules): New functions.
(css-mode): Use them.
(css-navigation-syntax-table): Remove var.
(css-backward-sexp, css-forward-sexp, css-indent-calculate-virtual)
(css-indent-calculate, css-indent-line): Remove functions.
Stefan Monnier [Thu, 29 Aug 2013 19:55:58 +0000 (15:55 -0400)]
Misc changes to reduce use of `(lambda...); and other cleanups.
* lisp/cus-edit.el: Use lexical-binding.
(customize-push-and-save, customize-apropos)
(custom-buffer-create-internal): Use closures.
* lisp/progmodes/bat-mode.el (bat-mode-syntax-table): "..." are strings.
* lisp/progmodes/ada-xref.el: Use setq.
* lisp/net/tramp.el (with-tramp-progress-reporter): Avoid setq.
* lisp/dframe.el: Use lexical-binding.
(dframe-frame-mode): Fix calling convention for hooks. Use a closure.
* lisp/speedbar.el (speedbar-frame-mode): Adjust call accordingly.
* lisp/descr-text.el: Use lexical-binding.
(describe-text-widget, describe-text-sexp, describe-property-list):
Use closures.
* lisp/comint.el (comint-history-isearch-push-state): Use a closure.
* lisp/calculator.el: Use lexical-binding.
(calculator-number-to-string): Make it work with lexical-binding.
(calculator-funcall): Same and use cl-letf.
Stefan Monnier [Thu, 29 Aug 2013 19:18:16 +0000 (15:18 -0400)]
* lisp/emacs-lisp/lisp.el (lisp--company-doc-buffer)
(lisp--company-doc-string, lisp--company-location): New functions.
(lisp-completion-at-point): Use them to improve Company support.
Stefan Monnier [Thu, 29 Aug 2013 18:06:46 +0000 (14:06 -0400)]
* lisp/progmodes/ruby-mode.el (ruby-smie-grammar): Add rule for formal
params of lambda expressions.
(ruby-smie--implicit-semi-p): Refine rule.
(ruby-smie--opening-pipe-p): New function.
(ruby-smie--forward-token, ruby-smie--backward-token): Handle Ruby
symbols and matched |...| for formal params.
(ruby-smie-rules): Don't let the formal params of a "do" prevent it
from being treated as hanging. Handle "rescue".
Eli Zaretskii [Thu, 29 Aug 2013 15:32:04 +0000 (18:32 +0300)]
A possible fix for bug #14333 with hanging at exit on MS-Windows.
src/w32.c (term_winsock): Call release_listen_threads before calling
WSACleanup.
(_sys_wait_accept): Wait for accept event in a loop with a finite
timeout, instead of waiting indefinitely. Will hopefully avoid
hanging during exit because WSACleanup deadlocks waiting for the
event object to be released.
src/w32proc.c (release_listen_threads): New function, signals all
the reader threads that listen for connections to stop waiting.
src/w32.h (release_listen_threads): Add prototype.
Dmitry Antipov [Thu, 29 Aug 2013 07:03:18 +0000 (11:03 +0400)]
Hook scanning and indentation functions to find_newline. This helps
to avoid duplicated code and renders more respect to newline cache.
* lisp.h (scan_newline): Prefer ptrdiff_t to EMACS_INT.
* cmds.c (Fforward_line):
* indent.c (scan_for_column, Fcurrent_indentation, indented_beyond_p):
Use find_newline and avoid unnecessary point movements.
* search.c (scan_newline): Implement on top of find_newline.
Stefan Monnier [Thu, 29 Aug 2013 03:49:10 +0000 (23:49 -0400)]
* lisp/emacs-lisp/cl-macs.el (cl-defsubst): Make it clear that args
are immutable. Don't use `unsafe' any more.
(cl--defsubst-expand): Don't substitute at the same time as keeping
a residual unused let-binding. Don't use `unsafe' any more.
Stefan Monnier [Wed, 28 Aug 2013 20:24:18 +0000 (16:24 -0400)]
* lisp/progmodes/cc-mode.el: Minor cleanup of var declarations.
(c-define-abbrev-table): Add `doc' argument.
(c-mode-abbrev-table, c++-mode-abbrev-table)
(objc-mode-abbrev-table, java-mode-abbrev-table)
(idl-mode-abbrev-table, pike-mode-abbrev-table)
(awk-mode-abbrev-table): Use it.
(c-mode-syntax-table, c-mode-map, c++-mode-syntax-table)
(c++-mode-map, objc-mode-syntax-table, objc-mode-map)
(java-mode-syntax-table, java-mode-map, idl-mode-syntax-table)
(idl-mode-map, pike-mode-syntax-table, pike-mode-map, awk-mode-map):
Move initialization into the declaration; and remove any
autoload cookie.
Juri Linkov [Wed, 28 Aug 2013 16:39:51 +0000 (19:39 +0300)]
* lisp/isearch.el (isearch-reread-key-sequence-naturally): Use non-nil
arg DONT-DOWNCASE-LAST of `read-key-sequence'.
(isearch-other-meta-char): Handle an undefined shifted printing
character by downshifting it.
Jan Djärv [Wed, 28 Aug 2013 16:20:15 +0000 (18:20 +0200)]
* nsterm.m (last_window): New variable.
(EV_TRAILER2): New macro.
(EV_TRAILER): Call EV_TRAILER2.
(mouseMoved:): Add support for mouse-autoselect-window
on nextstep.
Stefan Monnier [Wed, 28 Aug 2013 01:37:13 +0000 (21:37 -0400)]
Try to reduce redundancy in doc/misc/Makefile.in.
* configure.ac (DOCMISC_W32): New var to replace DOCMISC_*_W32.
* doc/misc/Makefile.in (DOCMISC_W32): New var to replace DOCMISC_*_W32.
(TARGETS): New intermediate variable.
(DVI_TARGETS, HTML_TARGETS, PDF_TARGETS, PS_TARGETS): Use it.
Paul Eggert [Tue, 27 Aug 2013 19:36:28 +0000 (12:36 -0700)]
Simplify SELECT_TYPE-related code.
Like EMACS_TIME, this portability layer is no longer needed, since
Emacs has been using fd_set as a portability layer for some time.
* sysselect.h (FD_SETSIZE): Rename from MAXDESC. All uses changed.
(SELECT_TYPE): Remove. All uses changed to fd_set.
(fd_set) [!FD_SET]: New typedef.
Paul Eggert [Tue, 27 Aug 2013 18:47:55 +0000 (11:47 -0700)]
Simplify EMACS_TIME-related code.
This portability layer is no longer needed, since Emacs has been
using struct timespec as a portability layer for some time.
Merge from gnulib, incorporating:
2013-08-27 timespec: new convenience constants and function
* src/atimer.h, src/buffer.h, src/dispextern.h, src/xgselect.h:
Include <time.h> rather than "systime.h"; that's all that's needed now.
* src/dispnew.c: Include <timespec.h> rather than "systime.h";
that's all that's needed now.
* src/systime.h (EMACS_TIME): Remove. All uses changed to struct timespec.
(EMACS_TIME_RESOLUTION): Remove. All uses changed to
TIMESPEC_RESOLUTION.
(LOG10_EMACS_TIME_RESOLUTION): Remove. All uses changed to
LOG10_TIMESPEC_RESOLUTION.
(EMACS_SECS, emacs_secs_addr): Remove. All uses changed to tv_sec.
(EMACS_NSECS): Remove. All uses changed to tv_nsec.
(make_emacs_time): Remove. All used changed to make_timespec.
(invalid_timespec): Rename from invalid_emacs_time. All uses changed.
(current_timespec): Rename from current_emacs_time. All uses changed.
(add_emacs_time): Remove. All uses changed to timespec_add.
(sub_emacs_time): Remove. All uses change dot timespec_sub.
(EMACS_TIME_SIGN): Remove. All uses changed to timespec_sign.
(timespec_valid_p): Rename from EMACS_TIME_VALID_P. All uses changed.
(EMACS_TIME_FROM_DOUBLE): Remove. All uses changed to dtotimespec.
(EMACS_TIME_TO_DOUBLE): Remove. All uses changed to timespectod.
(current_timespec): Rename from current_emacs_time. All uses changed.
(EMACS_TIME_EQ, EMACS_TIME_LT, EMACS_TIME_LE): Remove. All uses
changed to timespec_cmp.
* src/xgselect.c: Include <timespec.h>, since our .h files don't.
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;'.