Here, we use the generic window-system configuration system we just
implemented to support the w32 window-system in the mainline build
under Cygwin. (Previously, the w32 window system could only be
compiled as part of the NT-native Emacs build process.)
The changes in this patch need to be applied atomically in order to
avoid breaking Emacs. The changes include:
- Changes throughout the Lisp and C code to not assume that
NT Emacs and the w32 window system are synonymous.
- Wiring up the regular select(2) event loop to Windows messages
- Cleaning up the w32 drag-and-drop receiving code.
- Exposing Cygwin path conversion functions to elisp.
- Unicode file dialog support when compiling for Cygwin.
- Splitting the w32 term lisp initialization code into code
applicable to any w32 window-system and code specific to
system-type windows-nt.
- Integrating the old and new w32 code into the build system.
Juri Linkov [Sun, 2 Sep 2012 09:31:45 +0000 (12:31 +0300)]
Toggle whitespace matching mode with M-s SPC.
http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00008.html
* lisp/isearch.el (search-whitespace-regexp): Doc fix.
Remove cons cell customization.
(isearch-mode-map): Bind "\M-s " to isearch-toggle-lax-whitespace.
(isearch-lax-whitespace, isearch-regexp-lax-whitespace):
New variables.
(isearch-forward, isearch-forward-regexp): Doc fix.
(isearch-toggle-lax-whitespace): New command.
(search-forward-lax-whitespace, search-backward-lax-whitespace)
(re-search-forward-lax-whitespace)
(re-search-backward-lax-whitespace): New functions.
(isearch-whitespace-regexp): Remove function.
(isearch-query-replace): Let-bind replace-search-function and
replace-re-search-function.
(isearch-occur): Let-bind search-spaces-regexp according to the
value of isearch-lax-whitespace and isearch-regexp-lax-whitespace.
(isearch-quote-char): Check isearch-regexp-lax-whitespace in the
condition for C-q SPC.
(isearch-search-fun-default): Use new functions mentioned above.
(isearch-search-forward, isearch-search-backward): Remove functions.
(isearch-search): Don't let-bind search-spaces-regexp.
(isearch-lazy-highlight-space-regexp): Remove variable.
(isearch-lazy-highlight-lax-whitespace)
(isearch-lazy-highlight-regexp-lax-whitespace): New variables.
(isearch-lazy-highlight-new-loop): Use them.
(isearch-lazy-highlight-search): Don't let-bind search-spaces-regexp.
* lisp/term.el: (term-mode-map): Use easymenu for In/Out, Complete menus.
(term-pager-break-map): Initialize in the defvar.
(term-terminal-menu, term-signals-menu): Define with easymenu.
(term-terminal-menu): Also show it in line-mode.
(term-pager-menu): New, extracted from term-process-pager.
(term-mode, term-char-mode, term-process-pager): Use easymenu-add.
(term-update-mode-line): Propertize line/char and page items.
(term-process-pager): Move keymap initialization elsewhere.
Paul Eggert [Sat, 1 Sep 2012 18:54:38 +0000 (11:54 -0700)]
* configure.ac (_FORTIFY_SOURCE): Define only when optimizing.
This ports to glibc 2.15 or later, when configured with
--enable-gcc-warnings. See Eric Blake in
<http://lists.gnu.org/archive/html/bug-grep/2012-09/msg00000.html>.
Martin Rudalics [Sat, 1 Sep 2012 16:47:09 +0000 (18:47 +0200)]
Rewrite switch-to-prev-/next-buffer and quit-window; add display-buffer-below-selected.
* window.el (switch-to-prev-buffer): Handle additional values of
BURY-OR-KILL argument. Don't switch in minibuffer window.
(switch-to-next-buffer): Don't switch in minibuffer window.
(quit-restore-window): New function based on quit-window.
Handle additional values of former KILL argument.
(quit-window): Call quit-restore-window with appropriate
interpretation of KILL argument.
(display-buffer-below-selected): New buffer display action
function.
Eli Zaretskii [Sat, 1 Sep 2012 13:54:27 +0000 (16:54 +0300)]
Further fix for bug #11860 with Arabic display on Windows.
src/w32uniscribe.c (uniscribe_shape): Handle correctly the case of
more than one grapheme cluster passed to the shaper: compute the
offset adjustment values separately for each cluster.
Eli Zaretskii [Sat, 1 Sep 2012 09:29:17 +0000 (12:29 +0300)]
Fix last changes related to w32 and Cygwin.
src/image.c: Restore mistakenly removed inclusion of w32.h. Without
it, GCC doesn't see prototypes of w32_delayed_load, and complains
about implicit conversions from integer to pointer.
This change streamlines the window system selection code in
configure.in and moves many common function declarations from
window-specific headers to frame.h. It introduces a new TERM_HEADER
macro in config.h: we set this macro to the right header to use for
the window system for which we're compiling Emacs and have source
files include it indirectly. This way, we don't have to teach every
file about every window system.
Paul Eggert [Sat, 1 Sep 2012 01:04:26 +0000 (18:04 -0700)]
Better seed support for (random).
* doc/lispref/numbers.texi (Random Numbers): Document new behavior of
the calls (random) and (random STRING).
* etc/NEWS: Document new behavior of (random), (random "string").
* lisp/play/5x5.el, lisp/play/animate.el, lisp/play/cookie1.el:
* lisp/play/dissociate.el, lisp/play/doctor.el, lisp/play/dunnet.el:
* lisp/play/gomoku.el, lisp/play/landmark.el, lisp/play/mpuz.el:
* lisp/play/tetris.el, lisp/play/zone.el:
* lisp/calc/calc-comb.el (math-init-random-base):
* lisp/play/blackbox.el (bb-init-board):
* lisp/play/life.el (life):
* lisp/server.el (server-use-tcp):
* lisp/type-break.el (type-break):
Remove unnecessary call to (random t).
* lisp/net/sasl.el (sasl-unique-id-function):
Change (random t) to (random), now that the latter is more random.
* lisp/play/life.el (life-initialized): Remove no-longer-needed var.
* lisp/gnus/gnus-sync.el (gnus-sync-lesync-setup):
* lisp/gnus/message.el (message-canlock-generate, message-unique-id):
Change (random t) to (random), now that the latter is more random.
* lisp/org/org-id.el (org-id-uuid):
Change (random t) to (random), now that the latter is more random.
* src/emacs.c (main): Call init_random.
* src/fns.c (Frandom): Set the seed from a string argument, if given.
Remove long-obsolete Gentzel cruft.
* src/lisp.h, src/sysdep.c (seed_random): Now takes address and size, not long.
(init_random): New function.
Dmitry Antipov [Fri, 31 Aug 2012 10:53:19 +0000 (14:53 +0400)]
Remove mark_ttys function and fix tty_display_info initialization.
* lisp.h (mark_ttys): Remove prototype.
* alloc.c (Fgarbage_collect): Remove redundant (and the only) call
to mark_ttys because all possible values of 'top_frame' slot are
the frames which are reachable from Vframe_list.
* term.c (mark_ttys): Remove.
(init_tty): Safely initialize 'top_frame' slot with Qnil.
Dmitry Antipov [Fri, 31 Aug 2012 04:40:52 +0000 (08:40 +0400)]
Change struct frame bitfields from unsigned char to unsigned.
* frame.h (struct frame): Change type of 'display_preempted',
'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
bitfields from unsigned char to unsigned.
Glenn Morris [Thu, 30 Aug 2012 00:47:33 +0000 (20:47 -0400)]
init_lread fix for bug#12302
* src/lread.c (init_lread): For out-of-tree builds, only add the
source directory's site-lisp dir to the load-path if it exists,
consistent with in-tree builds.
Stefan Monnier [Wed, 29 Aug 2012 15:11:51 +0000 (11:11 -0400)]
* lisp/files.el (read-only-mode): New minor mode.
(toggle-read-only): Use it and mark obsolete.
(find-file--read-only):
* lisp/vc/vc.el (vc-next-action, vc-checkout):
* lisp/vc/vc-cvs.el (vc-cvs-checkout):
* lisp/obsolete/vc-mcvs.el (vc-mcvs-update):
* lisp/ffap.el (ffap--toggle-read-only): Update callers.
Michael Albinus [Wed, 29 Aug 2012 12:49:44 +0000 (14:49 +0200)]
* eshell/esh-ext.el (eshell-external-command): Do not examine
remote shell scripts. See
<https://bugs.launchpad.net/ubuntu/+source/emacs23/+bug/1035790>.
* net/tramp-sh.el (tramp-remote-path): Add "/sbin" and
"/usr/local/sbin".
Jan Djärv [Tue, 28 Aug 2012 16:05:17 +0000 (18:05 +0200)]
Improve NS dialogs. Add close button, remove ugly casts.
* nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
button_values to NULL. Call setStykeMask so dialogs get a close button.
(windowShouldClose:): Set window_closed.
(dealloc): New member, free button_values.
(process_dialog:): Make member function. Remove window argument,
replace window with self. Count buttons and allocate and store values
in button_values.
(addButton:value:row:): value is int with the name tag. Call setTag
with tag. Remove return self, declare return value as void.
(addString:row:): Remove return self, declare return value as void.
(addSplit): Remove return self, declare return value as void.
(clicked:): Remove return self, declare return value as void.
Set dialog_return to button_values[seltag]. Code formatting change.
(initFromContents:isQuestion:): Adjust call to process_dialog.
Code formatting change.
(timeout_handler:): Set timer_fired to YES.
(runDialogAt:): Set timer_fired to NO.
Handle click on close button as quit.
* nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
Add window_closed and button_values. Add void as return value for
add(Button|String|Split). addButton takes int instead of Lisp_Object.
Add process_dialog as new member.
Dmitry Antipov [Tue, 28 Aug 2012 10:59:17 +0000 (14:59 +0400)]
Do not allow to set major mode for a dead buffer.
* buffer.c (Fset_buffer_major_mode): Signal an error
if the buffer is dead.
(Fother_buffer, other_buffer_safely): Remove redundant
nested declaration.
Paul Eggert [Tue, 28 Aug 2012 00:33:56 +0000 (17:33 -0700)]
* dispnew.c: Use bool for boolean.
(frame_garbaged, display_completed, delayed_size_change)
(fonts_changed_p, add_window_display_history)
(add_frame_display_history, verify_row_hash)
(adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
(row_equal_p, realloc_glyph_pool)
(allocate_matrices_for_frame_redisplay)
(showing_window_margins_p)
(adjust_frame_glyphs_for_frame_redisplay)
(build_frame_matrix_from_leaf_window, make_current)
(mirrored_line_dance, mirror_line_dance, update_frame)
(update_window_tree, update_single_window)
(check_current_matrix_flags, update_window, update_text_area)
(update_window_line, set_window_update_flags, scrolling_window)
(update_frame_1, scrolling, buffer_posn_from_coords)
(do_pending_window_change, change_frame_size)
(change_frame_size_1, sit_for):
Use bool for boolean.
(clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
and remove last int (actually boolean) argument, which was always 0.
All callers changed.
* dispextern.h, frame.h, lisp.h: Reflect above API changes.
* dispextern.h (struct composition_it): Use bool for boolean.
(struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
(struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
* dired.c (file_name_completion):
Use bool for boolean. (This was missed in an earlier change.)
Jan Djärv [Mon, 27 Aug 2012 18:53:10 +0000 (20:53 +0200)]
* nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
dialog_return.
(windowShouldClose:): Use stop instead of stopModalWithCode.
(clicked:): Ditto, and also set dialog_return.
(timeout_handler:): Use stop instead of abortModal. Send a dummy
event.
(runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
modal loop returns.
* nsterm.h (NSPanel): New class variable dialog_return.
Martin Rudalics [Mon, 27 Aug 2012 08:31:19 +0000 (10:31 +0200)]
Address two problems in Fset_window_configuration (Bug#8789) and (Bug#12208).
* window.c (Fset_window_configuration): Record any window's old
buffer if it's replaced (see Bug#8789). If the new current
buffer doesn't appear in the selected window, go to its old
point (Bug#12208).
Dmitry Antipov [Mon, 27 Aug 2012 04:15:33 +0000 (08:15 +0400)]
Special MEM_TYPE_SPARE to denote reserved memory.
* alloc.c (enum mem_type): New memory type.
(refill_memory_reserve): Use new type for spare memory.
This prevents live_cons_p and live_string_p from incorrect
detection of uninitialized objects from spare memory as live.
Chong Yidong [Sun, 26 Aug 2012 13:42:18 +0000 (21:42 +0800)]
Make special-display-* and display-buffer-reuse-frames obsolete.
* lisp/window.el (special-display-regexps, special-display-frame-alist)
(special-display-buffer-names, special-display-function)
(display-buffer-reuse-frames): Mark as obsolete.
* lisp/progmodes/compile.el: Don't use display-buffer-reuse-frames.
Chong Yidong [Sun, 26 Aug 2012 09:16:48 +0000 (17:16 +0800)]
Clean up gdb-mi's usage of display-buffer.
* progmodes/gdb-mi.el (gdb-display-buffer-other-frame-action): New
variable, replacing gdb-frame-parameters.
(gdb-frame-io-buffer, gdb-frame-breakpoints-buffer)
(gdb-frame-threads-buffer, gdb-frame-memory-buffer)
(gdb-frame-disassembly-buffer, gdb-frame-stack-buffer)
(gdb-frame-locals-buffer, gdb-frame-registers-buffer): Use it.
(def-gdb-frame-for-buffer): Macro deleted. It is easier to define
the functions directly with gdb-display-buffer-other-frame-action.
(gdb-display-breakpoints-buffer, gdb-display-threads-buffer)
(gdb-display-memory-buffer, gdb-display-disassembly-buffer)
(gdb-display-stack-buffer, gdb-display-locals-buffer)
(gdb-display-registers-buffer): Define directly.
(def-gdb-display-buffer): Macro deleted.
(gdb-display-buffer): Remove second and third args, callers don't
use them. Defer to the default display-buffer behavior, apart
from making windows dedicated.
(gdb-setup-windows): Don't call display-buffer unnecessarily.
* window.el (display-buffer-pop-up-frame): Handle a
pop-up-frame-parameters alist entry.
(display-buffer): Document it.
* progmodes/gud.el (gud-display-line): Just use display-buffer.
Paul Eggert [Sun, 26 Aug 2012 05:21:04 +0000 (22:21 -0700)]
* lisp.h (ASET): Remove attempt to detect side effects.
It was meant to be temporary and it often doesn't work,
because when IDX has side effects the behavior of IDX==IDX
is undefined. See Stefan Monnier in
<http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
Chong Yidong [Sun, 26 Aug 2012 03:57:55 +0000 (11:57 +0800)]
Make ordinary isearch obey search-whitespace-regexp too.
* lisp/isearch.el (search-whitespace-regexp): Make string and nil
values apply to both ordinary and regexp search. Allow a cons
cell value to distinguish between the two.
(isearch-whitespace-regexp, isearch-search-forward)
(isearch-search-backward): New functions.
(isearch-occur, isearch-search-fun-default, isearch-search)
(isearch-lazy-highlight-new-loop): Use them.
(isearch-forward, isearch-forward-regexp): Doc fix.
Paul Eggert [Sat, 25 Aug 2012 20:31:04 +0000 (13:31 -0700)]
* xgselect.c (xg_select): Use auto storage for the GPollFD buffer
as that's faster and simpler than static storage. Don't bother
with the g_main_context_query overhead if g_main_context_pending
says no events are pending.
(gfds, gfds_size): Remove these static vars.
(xgselect_initialize): Remove; no longer needed.
All uses and decls removed.
Martin Rudalics [Sat, 25 Aug 2012 14:52:02 +0000 (16:52 +0200)]
Handle evening window heights more correctly (Bug#11880) and (Bug#12091).
* window.el (window--even-window-heights): Even heights when
WINDOW and the selected window form a vertical combination.
(display-buffer-use-some-window): Provide that window used gets
sized back by quit-window. (Bug#11880) and (Bug#12091)