1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-29 16:41:45 -08:00
Commit graph

35140 commits

Author SHA1 Message Date
Jan Djärv
a9f8deecce * emacs.c (main): On Cocoa, if GUI session and 0 is not a tty,
chdir to HOME.

Fixes: debbugs:15607
2013-10-20 18:47:42 +02:00
Jan Djärv
d4816ab3aa * src/nsterm.m (ns_get_color): Make selection color work for GNUStep also. 2013-10-20 11:55:25 +02:00
Jan Djärv
aca5fcdc4c Fix GNUStep specific menu items.
* lisp/menu-bar.el: Move GNUStep specific menus...

* lisp/term/ns-win.el (ns-initialize-window-system): ... to here.

* src/nsterm.m (Qcocoa, Qgnustep): New variables.
(syms_of_nsterm): Defsym Qcocoa, Qgnustep.  Fprovide appropriate one.
2013-10-20 10:50:34 +02:00
Eli Zaretskii
c4e3099ff4 Fix clicks on the menu bar when GPM mouse is in use.
src/keyboard.c (make_lispy_event): Remove GPM-specific code that
 handles mouse clicks.  Instead, let GPM use the same code as all
 the other mice use.  See the discussion starting at
 http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00521.html
 for the details of the problem with the menu bar this fixes.
2013-10-18 16:33:25 +03:00
Dmitry Antipov
d141d70112 Remove port-specific display name lists to avoid extra
complexity and data duplication with display info lists.
* xterm.h (x_display_name_list): Remove declaration.
* xterm.c (x_display_name_list): Remove.
(x_term_init, x_delete_display, syms_of_xterm): Adjust users.
* xfns.c (x_display_info_for_name, Fx_display_list):
Likewise.  Use x_display_list where appropriate.
* w32term.h (w32_display_name_list): Remove declaration.
* w32term.c (w32_display_name_list): Remove.
(w32_initialize_display_info, x_delete_display, syms_of_w32term):
Adjust users.
* w32fns.c (x_display_info_for_name, Fx_display_list):
Likewise.  Use x_display_list where appropriate.
* nsterm.h (ns_display_name_list): Remove declaration.
* nsterm.m (ns_display_name_list): Remove.
(ns_term_init, syms_of_nsterm): Adjust users.
* nsfns.m (ns_display_info_for_name, Fx_display_list):
Likewise.  Use x_display_list where appropriate.
* termhooks.h (TERMINAL_FONT_CACHE): New macro.
* alloc.c (toplevel) [HAVE_WINDOW_SYSTEM]: Include TERM_HEADER.
(mark_terminals): Mark per-terminal font cache.
2013-10-18 16:57:44 +04:00
Barry O'Reilly
ef56692035 Don't run timers in input-pending-p. Its new check-timers param
provides the prior behavior..
* src/keyboard.c (Finput_pending_p): Accept optional check-timers
param.
* lisp/subr.el (sit-for): Call (input-pending-p t) so as to behave
as before.
* test/automated/timer-tests.el: New file.  Tests that (sit-for 0)
allows another timer to run.

Fixes: debbugs:15045
2013-10-18 00:27:34 -04:00
Paul Eggert
3d798ba7db Make some functions static in non-Microsoft builds.
On my platform (Fedora 19 x86-64), this shrinks the
Emacs executable (text+data) by 0.25%.
* dispextern.h (erase_phys_cursor) [!WINDOWSNT]:
(load_color) [!MSDOS]:
* gnutls.h (emacs_gnutls_transport_set_errno) [!WINDOWSNT]:
* keyboard.h (make_ctrl_char) [!WINDOWSNT]:
* lisp.h (check_existing):
* process.h (conv_sockaddr_to_lisp, network_interface_list)
(network_interface_info) [!WINDOWSNT]:
* termhooks.h (encode_terminal_code) [!WINDOWSNT]:
Remove extern decls.
* fileio.c (check_existing):
* keyboard.c (make_ctrl_char) [!WINDOWSNT]:
* process.c (conv_sockaddr_to_lisp, network_interface_list)
(network_interface_info) [!WINDOWSNT]:
* term.c (encode_terminal_code) [!WINDOWSNT]:
* xdisp.c (erase_phys_cursor) [!WINDOWSNT]:
* xfaces.c (load_color) [!MSDOS]:
Now static.
* fileio.c (check_existing, check_executable, check_writable):
* process.c (network_interface_list, network_interface_info):
Move earlier, so that we don't need forward decls.
* gnutls.c (fn_gnutls_transport_set_errno)
(emacs_gnutls_transport_set_errno) [!WINDOWNT]:
Remove; unused.
* w32.c (init_environment): Use faccessat rather than
check_existing, partly for consistency with the rest of the code
in this file, partly so that check_existing can be static.
2013-10-16 23:42:21 -07:00
Paul Eggert
bb9937df2d Make VALMASK visible to GDB even if clang is used.
* emacs.c (MAIN_PROGRAM): New macro.
* lisp.h (DEFINE_GDB_SYMBOL_BEGIN, DEFINE_GDB_SYMBOL_END): New macros.
(ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Use them.

Fixes: debbugs:15574
2013-10-16 20:08:59 -07:00
Paul Eggert
f2752e013d bool vector int width fixes
* data.c (bool_vector_spare_mask, Fbool_vector_count_matches)
(Fbool_vector_count_matches_at):
Use EMACS_INT, not ptrdiff_t, to record bit counts, as a bit count
can exceed PTRDIFF_MAX, at least in theory.
(Fbool_vector_count_matches_at):
Use int, not ptrdiff_t, to record a value that can't exceed INT_MAX.
2013-10-16 18:02:32 -07:00
Paul Eggert
0a2b8e3c26 * process.h (conv_sockaddr_to_lisp): New decl, for newly-extern func.
(struct sockaddr): Add forward decl, for platforms that lack it.
2013-10-16 10:36:04 -07:00
Jan Djärv
2318fccaa6 * nsselect.m (ns_string_from_pasteboard): Remove Fquit, just return
Qnil.

Fixes: debbugs:15628
2013-10-16 18:55:45 +02:00
Eli Zaretskii
3dffe39591 Implement network-interface-* functions for MS-Windows (bug #15610).
src/w32.c (network_interface_get_info, network_interface_list)
 (network_interface_info): New functions.
 (GetAdaptersInfo_Proc): New typedef.
 (get_adapters_info): New wrapper function.
 (globals_of_w32): Initialize g_b_init_get_adapters_info.
 src/process.h (network_interface_list, network_interface_info): New
 prototypes.
 src/process.c (conv_sockaddr_to_lisp): Now externally-visible.
 (Fnetwork_interface_list, Fnetwork_interface_info): Define for
 all systems.  Return non-nil for systems that HAVE_NET_IF_H and
 for WINDOWSNT.  Doc fix.
 (syms_of_process): Defsubr Snetwork_interface_list and
 Snetwork_interface_info unconditionally.
2013-10-16 18:44:02 +03:00
Eli Zaretskii
b911a94d79 Fix bug #15629 with GUI menus on NS.
src/menu.c (have_boxes): Fix redundant simulation of radio buttons
 in NS GUI sessions.
2013-10-16 18:07:36 +03:00
Dmitry Antipov
17b9dc45a7 * fns.c (Fstring_as_unibyte): Fix last change. 2013-10-16 13:56:36 +04:00
Dmitry Antipov
04d47595b9 * fns.c (Fstring_as_unibyte): Use xlispstrdup. 2013-10-16 13:30:30 +04:00
Paul Eggert
5e15c624f9 * print.c (print_object): Print " ..." when truncating bool vectors. 2013-10-15 14:03:00 -07:00
Eli Zaretskii
5d64d7704e Support mouse wheel on MS-Windows text-mode console.
src/w32inevt.c (do_mouse_event): Support mouse wheel and all the 5
 standard mouse buttons.
 src/termhooks.h (struct input_event): Remove incorrect commentary.
2013-10-15 21:38:26 +03:00
Paul Eggert
454e2fb9b9 Disallow bool vector operations on mixed-length operands.
The old behavior left garbage in the result vector sometimes,
and didn't seem to be useful.
* data.c (Qwrong_length_argument): New static var.
(wrong_length_argument): New function.
(bool_vector_binop_driver): Check that args agree in length.
2013-10-15 09:38:36 -07:00
Paul Eggert
c911772ee8 * keyboard.c, keyboard.h (all_kboards): Now static. 2013-10-15 06:57:37 -07:00
Xue Fuqiao
57f623e268 Add usage note of buffer-invisibility-spec.
* src/buffer.c (syms_of_buffer) <buffer-invisibility-spec>: Add usage
note from the lispref.
2013-10-15 20:47:57 +08:00
Paul Eggert
ffb3f67aae Space after comma in ChangeLogs. 2013-10-14 23:36:43 -07:00
Dmitry Antipov
47c4d1e97e * nsterm.h (struct ns_display_info): Remove set-but-unused
member image_cache (image caches are per-terminal anyway).
(FRAME_X_IMAGE_CACHE): Remove.
* nsterm.m (ns_initialize_display_info): Adjust user.
2013-10-15 06:45:03 +04:00
Eli Zaretskii
279066b2b3 Attempt to fix time_t related problems with MinGW 4.0 runtime.
nt/inc/mingw_time.h: New file.
 nt/inc/ms-w32.h: Include mingw_time.h instead of doing its job.

 src/w32proc.c: Include mingw_time.h.
 src/w32.c: Include mingw_time.h.
2013-10-14 19:23:10 +03:00
Eli Zaretskii
ccd4a7833f Implement scrolling of TTY menus when the screen is too short.
src/term.c (tty_menu_display): Accept an additional argument, the
 menu item from which to start displaying the menu.  Account for
 the value of Y when limiting the menu to the number of available
 screen lines.
 (mi_result): New enumeration.
 (read_menu_input): Return enumerated value.  When the y coordinate
 hits min_y or max_y, return scroll indication instead of wrapping
 around the menu.
 (tty_menu_activate): Handle the scrolling indications from
 read_menu_input.  Compute the first menu item to display and pass
 it to tty_menu_display.

 lisp/menu-bar.el (tty-menu-navigation-map): Bind shifted mouse clicks
 to commands that scroll the menu.
2013-10-14 18:37:12 +03:00
Dmitry Antipov
77e3b1b709 * termhooks.h (FRAME_MUST_WRITE_SPACES, FRAME_LINE_INS_DEL_OK)
(FRAME_CHAR_INS_DEL_OK, FRAME_SCROLL_REGION_OK)
(FRAME_SCROLL_REGION_COST, FRAME_MEMORY_BELOW_FRAME):
Adjust to match the change described below.
(struct terminal): Move must_write_spaces, line_ins_del_ok,
char_ins_del_ok, scroll_region_ok, scroll_region_cost and
memory_below_frame members to...
* termchar.h (struct tty_display_info): ...here because they're
relevant only on TTYs.  Prefer unsigned bitfield where appropriate.
* term.c (init_tty):
* nsterm.m (ns_create_terminal):
* w32term.c (w32_create_terminal):
* xterm.c (x_create_terminal): Adjust users.
* dispnew.c (line_hash_code, line_draw_cost): Pass frame arg
to filter out non-TTY frames.  Adjust comment.
(scrolling): Adjust user.  Prefer eassert for debugging check.
2013-10-14 16:19:21 +04:00
Dmitry Antipov
e558436b77 * xfaces.c (PT_PER_INCH): Remove unused macro.
* termhooks.h (struct terminal): Remove set-but-unused
member fast_clear_end_of_line.
(FRAME_FAST_CLEAR_END_OF_LINE): Remove.
* nsterm.m (ns_create_terminal):
* term.c (init_tty):
* w32term.c (w32_create_terminal):
* xterm.c (x_create_terminal): Adjust users.
2013-10-14 14:55:24 +04:00
Paul Eggert
1c0a74936b * lisp.h (bool_vector_size): New function.
All uses of XBOOL_VECTOR (x)->size changed to bool_vector_size (x).
* data.c (bool_vector_spare_mask, bool_vector_binop_driver)
(Fbool_vector_not, Fbool_vector_count_matches_at):
Remove uses of 'eassume' that should no longer be needed,
because they are subsumed by the 'eassume' in bool_vector_size.
2013-10-14 00:12:49 -07:00
Glenn Morris
e903c210b6 ChangeLog fixes prompted by M-x authors 2013-10-12 17:28:30 -07:00
Eli Zaretskii
567f95ecac Avoid compilation warnings in image.c.
src/image.c (GIFLIB_MAJOR, GIFLIB_MINOR, GIFLIB_RELEASE): Move back
 after inclusion of gif_lib.h, thus fixing compiler warnings caused
 by 2013-10-10T19:15:33Z!eggert@cs.ucla.edu.
2013-10-12 11:48:31 +03:00
Eli Zaretskii
abe0202013 Support frame dimension changes while TTY menus are displayed.
src/xdisp.c (deep_copy_glyph_row): Handle the case that FROM and TO
 have different dimensions.
 src/dispnew.c (fill_up_frame_row_with_spaces): Now has external
 visibility.
 src/dispextern.h (fill_up_frame_row_with_spaces): Add prototype.

Fixes: debbugs:15575
2013-10-11 18:42:06 +03:00
Dmitry Antipov
9428abbf51 * term.c (tty_menu_show): Never return with unbalanced
specpdl.  Use eassert for debugging check.  Adjust style.
2013-10-11 19:30:21 +04:00
Eli Zaretskii
052bac0bf1 Menu item selection on TTYs is now cyclical.
src/term.c (read_menu_input): Make selection of menu items
 cyclical.  Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
 (tty_menu_activate): Fix off-by-one error when computing max_y.
2013-10-11 17:42:05 +03:00
Ted Zlatanov
e1f9f9e3d8 Support GnuTLS v3 and set up its audit logging properly.
* configure.ac: Define HAVE_GNUTLS3 if GnuTLS v3 is found.

* src/gnutls.c (gnutls_audit_log_function): Add function for GnuTLS
audit logging (only used with GnuTLS 3.x) and enable it.
2013-10-11 09:47:35 -04:00
Dmitry Antipov
7d563e363c * dispnew.c (redraw_frame): Remove useless #ifdef because
FRAME_MSDOS_P is a compile-time zero everywhere except MS-DOS.
Also, move TTY fflush to...
* term.c (tty_update_end): ...this function.
2013-10-11 15:11:28 +04:00
Eli Zaretskii
48621e6906 Fix bug #15575 with crashes in TTY menus.
src/xdisp.c (display_tty_menu_item): Make sure we never write beyond
 the end of the frame's glyph matrix.
 src/term.c (tty_menu_display): Don't move cursor while overwriting
 frame's glyphs with menu items.  Limit the number of items
 displayed to what can be shown on the available screen lines,
 excluding the echo area.
 (tty_menu_activate): Limit the Y coordinate allowed by
 read_menu_input to the last screen line used for menu display.
2013-10-11 14:01:48 +03:00
Paul Eggert
b9ff995e4c * lisp.h (eassume): New macro.
Also, include <verify.h>, for 'assume'.
* alloc.c (bool_vector_payload_bytes, Fmake_bool_vector)
(vroundup, vector_nbytes):
* data.c (bool_vector_spare_mask, bool_vector_binop_driver)
(Fbool_vector_not, Fbool_vector_count_matches)
(Fbool_vector_count_matches_at):
Use eassume, not eassert.
* casetab.c (set_identity, shuffle):
* composite.c (composition_gstring_put_cache):
* dispnew.c (update_frame_1):
* ftfont.c (ftfont_shape_by_flt):
* image.c (gif_load):
* intervals.c (offset_intervals):
* macfont.m (macfont_shape):
Remove calls to 'assume' that are no longer needed, because
--enable-gcc-warnings no longer generates bogus warnings
when these calls are removed.
2013-10-10 23:32:29 -07:00
Dmitry Antipov
33ac026599 * xdisp.c (deep_copy_glyph_row): Remove unused locals. 2013-10-11 07:55:26 +04:00
Stefan Monnier
ee041f2d07 * src/fileio.c (Fsubstitute_in_file_name): Use substitute-env-in-file-name.
(Qsubstitute_env_in_file_name): New var.
(syms_of_fileio): Define it.
* lisp/env.el (substitute-env-in-file-name): New function.
(substitute-env-vars): Extend the meaning of the optional arg.
2013-10-10 17:42:38 -04:00
Eli Zaretskii
00036e1dd2 Attempt to fix crashes per bug #15575.
src/xdisp.c (deep_copy_glyph_row): Assert that the 'used' counts of
 FROM and TO are identical.  Copy only the glyphs of TEXT_AREA.
 src/term.c (save_and_enable_current_matrix): Don't allocate and
 don't save margin areas.
 (restore_desired_matrix): Don't restore margin areas.
 (free_saved_screen): Don't free margin areas.
2013-10-10 22:26:13 +03:00
Paul Eggert
991496253a * image.c: Pacify --enable-gcc-warnings.
(GIFLIB_MAJOR, GIFLIB_MINOR, GIFLIB_RELEASE, fn_GifErrorString):
#define only if used.
2013-10-10 12:15:33 -07:00
Eli Zaretskii
a5dab1594a MS-Windows follow-up to 2013-10-10T01:03:11Z!rgm@gnu.org: support giflib 5.x.
src/image.c (GIFLIB_MAJOR): Define to 4 if undefined.
 (GIFLIB_MINOR, GIFLIB_RELEASE): Define to zero if undefined.
 (GifErrorString) [GIFLIB_MAJOR >= 5]: Define a function pointer.
 (gif_load): For giflib v5.x and later, display the error message
 produced by giflib when its functions fail.
 (syms_of_image) <Qlibgif_version> [HAVE_NTGUI]: New DEFSYM.

 lisp/term/w32-win.el (dynamic-library-alist): Define separate lists
 of GIF DLLs for versions before and after 5.0.0 of giflib.

Fixes: debbugs:15531
2013-10-10 18:30:21 +03:00
Dmitry Antipov
6bbe6da82d * keyboard.c (last_event_timestamp): Remove. For X selection and
GTK popup menus, it may be obtained from per-frame X display info.
(kbd_buffer_store_event_hold, kbd_buffer_get_event)
(process_special_events): Adjust users.
* keyboard.h (last_event_timestamp): Remove declaration.
* xmenu.c (xmenu_show, create_and_show_popup_menu): Lost last arg.
Use FRAME_DISPLAY_INFO (f)->last_user_time for gtk_menu_popup.
* menu.h (xmenu_show): Adjust prototype.
* menu.c (Fx_popup_menu): Adjust user.
* xselect.c (x_own_selection, x_get_foreign_selection)
(Fx_disown_selection_internal): Use dpyinfo->last_user_time.
2013-10-10 14:06:17 +04:00
Dmitry Antipov
1afcba638a * keyboard.c (init_kboard): Now static. Add arg
to denote window system.  Adjust comment.
(init_keyboard): Adjust user.
(allocate_kboard): New function.
(syms_of_keyboard):
* nsterm.m (ns_term_init):
* term.c (init_tty):
* w32term.c (w32_create_terminal):
* xterm.c (x_term_init): Use it.
* keyboard.h (init_kboard): Remove prototype.
(allocate_kboard): Add prototype.
2013-10-10 10:48:42 +04:00
Barry Fishman
f3606ef766 Handle giflib 5 changes (tiny change)
* configure.ac: Update for giflib 5. 

* src/image.c (GIFLIB_MAJOR): Ensure it's defined.
(DGifOpen, DGifOpenFileName): Handle giflib 5 syntax.  (Bug#15531)
2013-10-09 20:37:44 -04:00
Paul Eggert
e20bb24948 * fns.c (sxhash_bool_vector): Fix buffer read overrun. 2013-10-09 15:39:57 -07:00
Eli Zaretskii
9f6a18d27e Fix minor problems in text-mode menu display.
src/term.c (tty_menu_activate): Flush the output stream after
 showing the cursor, and don't mark the frame garbaged at exit from
 the function.  Fixes redisplay glitches when moving from one menu
 to another.
2013-10-09 23:18:38 +03:00
Jan Djärv
0486beac54 * nsfns.m (Fns_convert_utf8_nfd_to_nfc): Check input for valid UTF-8
or throw error.

Fixes: debbugs:15570
2013-10-09 20:50:14 +02:00
Paul Eggert
ab7ce97832 * intervals.c (temp_set_point_both): Move test into 'eassert',
for speed.
2013-10-09 10:56:58 -07:00
Paul Eggert
0d5d30295a * lisp.h (eassert): Don't use 'assume'.
Sometimes 'assume' wins in performance, and sometimes it loses,
so it shouldn't be used all the time.  Perhaps we need two
flavors of 'eassert', one for where 'assume' is far more likely
to help or to hurt; but that can be done later.
Problem reported by Dmitry Andipov in
<http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00276.html>.
Also, don't include <verify.h>; no longer needed.
2013-10-09 10:52:38 -07:00
Glenn Morris
fa02290953 Doc tweaks for cond
* doc/lispref/control.texi (Conditionals): Copyedits.

* src/eval.c (Fcond): Doc tweak.
2013-10-09 13:17:20 -04:00