1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-27 10:54:40 +00:00
Commit Graph

36349 Commits

Author SHA1 Message Date
Eli Zaretskii
253428c4fb src/dispnew.c (adjust_decode_mode_spec_buffer): Use 'int' instead of 'ssize_t'.
Suggested by Paul Eggert <eggert@cs.ucla.edu>.
2014-10-02 18:33:55 +03:00
Stefan Monnier
d7f413b893 Merge from emacs-24 2014-10-02 11:13:05 -04:00
Dmitry Antipov
8eb61e5261 * alloc.c (mark_overlay): Assume that overlay boundaries are
always markers.  Add comment.
* lread.c (read_internal_start): Use convenient validate_subarray.
Adjust docstring.
(Fread_from_string): Adjust docstring.
2014-10-02 18:01:27 +04:00
Stefan Monnier
b861616a6c * src/lisp.h: Fix up compilation for USE_STACK_LISP_OBJECTS=false. 2014-10-02 08:27:19 -04:00
Stefan Monnier
31300bee24 Consolidate management/ownership of selections.
* lisp/select.el (gui-get-selection-alist): New method.
(gui-get-selection): Use it.  Rename from x-get-selection.
(x-get-selection): Define as obsolete alias.
(x-get-clipboard): Mark obsolete.
(gui-get-primary-selection): New function.
(x-get-selection-value): Mark obsolete.
(gui-own-selection-alist, gui-disown-selection-alist)
(gui-selection-owner-p-alist): New methods.
(gui-set-selection): Use them.  Rename from x-set-selection.
(x-set-selection): Define as obsolete alias.
(gui--valid-simple-selection-p): Rename from
x-valid-simple-selection-p.
* lisp/w32-common-fns.el (gui-own-selection, gui-disown-selection)
(gui-selection-owner-p, gui-get-selection): Define for w32.
(w32-get-selection-value): Rename from x-get-selection-value.
Use the new gui-last-selected-text.
* lisp/term/x-win.el (x-get-selection-value): Remove.
(x-clipboard-yank): Declare obsolete.
(gui-own-selection, gui-disown-selection, gui-get-selection)
(gui-selection-owner-p): Define for x.
* lisp/term/w32-win.el (w32-win-suspend-error): Rename from
x-win-suspend-error.
* lisp/term/pc-win.el (w16-get-selection-value): Rename from
x-get-selection-value.
(w16-selection-owner-p): Rename from x-selection-owner-p.
(gui-own-selection, gui-disown-selection, gui-get-selection)
(gui-selection-owner-p): Define for pc.
(w16--select-text): New function.
* lisp/term/ns-win.el (gui-own-selection, gui-disown-selection)
(gui-get-selection, gui-selection-owner-p): Define for ns.
* lisp/term.el (term-mouse-paste):
* lisp/mouse.el (mouse-yank-primary): Use gui-get-primary-selection.
* src/nsselect.m (ns-own-selection-internal, ns-disown-selection-internal):
Rename from the "x-" prefix.
2014-10-01 23:19:32 -04:00
Glenn Morris
801e7c232c ChangeLog whitespace trivia 2014-10-01 17:26:16 -07:00
Stefan Monnier
850fe806f2 Commit forgotten ChangeLog files 2014-10-01 18:14:43 -04:00
Stefan Monnier
a8b36b953e Consolidate x-select-text.
* lisp/frame.el (gui-method, gui-method-define, gui-method-declare)
(gui-call): New macros.
(gui-method--name): New function.
(frame-creation-function-alist): Use gui-method-declare.
(make-frame): Use gui-method.
* lisp/select.el (gui-select-enable-clipboard): Rename from
x-select-enable-clipboard and move here.
(x-select-enable-clipboard): Define as obsolete alias.
(gui-last-selected-text): New var, to replace x-last-selected-text.
(gui-select-text): New GUI method.
(gui-select-text): New function.
(x-select-text): Define as obsolete alias.
* lisp/term/common-win.el (x-select-enable-clipboard, x-select-text):
Move to select.el.
* lisp/simple.el (interprogram-cut-function): Change default to
x-select-text.
(interprogram-paste-function): Change default to `ignore'.
* lisp/w32-common-fns.el (interprogram-cut-function): Don't modify.
* lisp/term/x-win.el (interprogram-cut-function): Don't modify.
(gui-select-text): Add method for x.
* lisp/term/w32-win.el (gui-select-text): Add method for w32.
* lisp/term/pc-win.el (x-last-selected-text): Remove, use
gui-last-selected-text instead.
(msdos-initialize-window-system): Don't set interprogram-cut-function.
(gui-select-text): Add method for pc.
* lisp/term/ns-win.el (ns-last-selected-text): Remove, use
gui-last-selected-text instead.
(gui-select-text): Add method for ns.
(x-setup-function-keys): Don't change interprogram-cut-function.
* lisp/loadup.el ("startup"): Load after "frame".
* lisp/subr.el (package--builtin-versions, package--description-file):
Move from startup.el.
* lisp/startup.el (package--builtin-versions, package--description-file):
Move to subr.el.
(handle-args-function-alist, window-system-initialization-alist):
Use gui-method-declare.
(command-line): Use gui-method.
* src/xselect.c (selection-converter-alist): Fix docstring.
2014-10-01 18:13:11 -04:00
Jan Djärv
335e9627ca * xfaces.c (Finternal_set_lisp_face_attribute): Added FIXME comment. 2014-10-01 20:10:21 +02:00
Jan Djärv
e2e773b9e6 * xfaces.c (Finternal_set_lisp_face_attribute): Don't try to
make a font_object from a tty frame.

Fixes: debbugs:18573
2014-10-01 19:41:18 +02:00
Eli Zaretskii
f94ec2f3c8 Don't modify the process's command name passed to start-process on MS-Windows.
src/w32proc.c (sys_spawnve): Avoid modification of the CMDNAME
 argument passed by the caller, when we mirror all slashes into
 backslashes.
2014-10-01 18:18:16 +03:00
Eli Zaretskii
151b7f6cc2 Revert the changes in 2014-10-01T02:25:40Z!eggert@cs.ucla.edu. 2014-10-01 17:58:54 +03:00
Dmitry Antipov
a5bc0a276b * gtkutil.c (xg_set_toolkit_horizontal_scroll_bar_thumb):
Resurrect old code and fix compilation with GTK < 2.13.6.
2014-10-01 17:21:08 +04:00
Paul Eggert
27900ac72a Use AUTO_CONS instead of SCOPED_CONS, etc.
* doc/lispref/internals.texi (Stack-allocated Objects):
Adjust to match the revised, less error-prone macros.
* src/frame.h (AUTO_FRAME_ARG): Rename from FRAME_PARAMETER.
* src/lisp.h (AUTO_CONS): Rename from scoped_cons.
(AUTO_LIST1): Rename from scoped_list1.
(AUTO_LIST2): Rename from scoped_list2.
(AUTO_LIST3): Rename from scoped_list3.
(AUTO_LIST4): Rename from scoped_list4.
(AUTO_STRING): Rename from SCOPED_STRING.
* src/frame.h (AUTO_FRAME_ARG):
* src/lisp.h (AUTO_CONS, AUTO_LIST1, AUTO_LIST2, AUTO_LIST3)
(AUTO_LIST4, AUTO_STRING):
Prepend a new argument 'name'.
Declare a variable instead of yielding a value.
All uses changed.
* src/lisp.h (STACK_CONS, AUTO_CONS_EXPR): New internal macros.
2014-09-30 20:28:16 -07:00
Paul Eggert
cebe0e6894 * dispnew.c (adjust_decode_mode_spec_buffer): Prefer ptrdiff_t
to ssize_t since we're not using ssize_t-related syscalls here.
2014-09-30 19:25:40 -07:00
Stefan Monnier
07bec0fc67 Merge from emacs-24 2014-09-30 19:19:31 -04:00
Paul Eggert
6aed001ad3 * alloc.c: Remove now-unnecessary check.
Suggested by Dmitry Antipov in:
http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00891.html
2014-09-30 13:17:36 -07:00
Paul Eggert
fe0a52e6e6 * xterm.c (x_term_init): Allocate temps on stack, not on heap. 2014-09-30 08:31:18 -07:00
Paul Eggert
699aeb00d4 * frame.c (x_set_frame_parameters): Port --enable-gcc-warnings
to Ubuntu 14.04.1 x86-64.
2014-09-30 08:20:03 -07:00
Eli Zaretskii
572fe798cd Fix creation of frames on MS-Windows: don't cons Lisp objects in input thread.
src/w32fns.c (w32_createwindow): Accept an additional argument, an
 array of 2 values specifying the coordinates of the frame's
 top-left corner.  Use these values instead of calling x_get_arg,
 which can cons Lisp objects, and therefore cannot be called except
 from the main thread.  Remove redundant tests for the default
 values.
 (my_create_window): Move the calculation of the coordinates of the
 frame's top-left edge here.  Pass them to the input thread via the
 second parameter of the WM_EMACS_CREATEWINDOW message.  See
 http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00892.html
 for the details.
2014-09-30 16:53:24 +03:00
Paul Eggert
42d4302f24 Spelling fix. 2014-09-29 22:02:13 -07:00
Paul Eggert
dc4525691c Simplify stack-allocated Lisp objects, and make them more portable.
The build_local_string macro was used in two ways: (1) string
literals for which scoped allocation suffices, and (2) file name
components, where it's not safe in general to assume bounded-size
ASCII data.  Simplify by defining a new macro SCOPED_STRING that
allocates a block-scope string, and by using SCOPED_STRING for (1)
and build_string for (2).  Furthermore, actually use stack
allocation only for objects known to have sufficient alignment.
This simpler implementation means Emacs can make
USE_STACK_LISP_OBJECTS the default unless GC_MARK_STACK !=
GC_MAKE_GCPROS_NOOPS.
* lisp.h (GCALIGNED): Align even if !USE_STACK_LISP_OBJECTS,
for fewer differences among implementations.
(struct Lisp_String): Now GCALIGNED.
(USE_STACK_LISP_OBJECTS): Default to true, since the
implementation no longer insists on a nonempty GCALIGNED.
But make it false if GC_MARK_STACK != GC_MAKE_GCPROS_NOOPS.
(SCOPED_CONS_INITIALIZER): Remove, since it's no longer needed
separately.  Move definiens to scoped_cons.  The old definition
was incorrect when GCALIGNED was defined to be empty.
(union Aligned_String): New type.
(USE_STACK_CONS, USE_STACK_STRING): New constants, so that the
implementation ports to compilers that don't align strictly enough.
Don't worry about the union sizes; it's not worth bothering about.
(scoped_cons, scoped_list1, scoped_list3, scoped_list4):
Rewrite using USE_STACK_CONS.
(scoped_cons): Assume the use of union Aligned_Cons.
(lisp_string_size, make_local_string, build_local_string): Remove.
Unless otherwise specified, all callers of build_local_string
changed to use SCOPED_STRING.
(SCOPED_STRING): New macro.
* data.c (wrong_choice):
* menu.c (single_menu_item):
* process.c (Fformat_network_address):
Hoist use of SCOPED_STRING out of a scope, so that its returned
object lives long enough.
* fileio.c (Fexpand_file_name): Use build_string, not SCOPED_STRING,
as the string might be long or might not be ASCII.
2014-09-29 19:43:23 -07:00
Eli Zaretskii
2b3d968a02 Follow-up to renaming v24.5 to 25.1.
README: Bump version to 25.0.50.
 configure.ac (AC_INIT): Bump version to 25.0.50.

 nt/makefile.w32-in (VERSION): Bump version to 25.0.50.
 nt/emacsclient.rc: Bump version to 25.0.50.
 nt/emacs.rc: Bump version to 25.0.50.
 nt/config.nt (VERSION): Bump version to 25.0.50.

 msdos/sed2v2.inp: Bump version to 25.0.50.

 etc/refcards/ru-refcard.tex: Bump version to 25.0.50.
 etc/refcards/emacsver.tex: Bump version to 25.0.50.

 src/msdos.c (internal_terminal_init): Bump version to 25.

 doc/man/emacs.1: Bump version to 25.0.50.

 doc/emacs/emacsver.texi (EMACSVER): Bump to 20.0.50.
2014-09-29 22:49:44 +03:00
Eli Zaretskii
5bb6d037f0 Fix bug #18545 with lack of scrolling a window when point goes out of view.
src/xdisp.c (cursor_row_fully_visible_p): Update commentary.
 (redisplay_window): Treat the frame's frozen_window_starts flag
 the same way as the optional_new_start flag for the window: only
 obey it if the glyph row showing point will be fully visible.
 Likewise when the window start is in a continuation line.  If,
 after trying everything under the 'force_start' label, point is
 still not fully visible, give up and scroll the window.  Add
 debugging traces.
 src/window.c (Frecenter): Set the window's redisplay flag.
2014-09-29 22:10:28 +03:00
Stefan Monnier
cbdc06f3be Rename 24.5 to 25.1
Except where we expect to backport the corresponding change.
2014-09-29 14:14:08 -04:00
Dmitry Antipov
71a72686e3 Keep stack-allocated Lisp objects fast rather than versatile.
* configure.ac (HAVE_STATEMENT_EXPRESSIONS): Remove.
For USE_STACK_LISP_OBJECTS, we always assume __GNUC__.
* lisp.h (union Aligned_Cons) [!GCALIGNED]: Define as such.
(SCOPED_CONS_INITIALIZER): New macro.
(scoped_cons) [USE_STACK_LISP_OBJECTS]: Use it.
(USE_LOCAL_ALLOCA): Remove.
(local_cons, local_list1, local_list2, local_list3, local_list4):
Remove.  Stack overflow checking makes them too slow.
(make_local_vector): Likewise.  Also we just don't have enough
users for it.
(enum LISP_STRING_OVERHEAD): Remove.
(local_string_init, local_vector_init): Remove prototypes.
(make_local_string, build_local_string): Redesign to target short
compile-time string constants, fall back to regular string allocation
where appropriate.
(lisp_string_size): New function.
(verify_ascii) [ENABLE_CHECKING]: Add prototype.
* alloc.c (local_string_init, local_vector_init): Remove.
(verify_ascii) [ENABLE_CHECKING]: New function.
* buffer.c, charset.c, chartab.c, data.c, editfns.c, emacs.c, fileio.c:
* fns.c, font.c, fontset.c, frame.c, keyboard.c, keymap.c, lread.c:
* menu.c, minibuf.c, process.c, textprop.c, xdisp.c, xfns.c, xfont.c:
* xselect.c, xterm.c: All related users changed.
2014-09-29 10:44:31 +04:00
Ken Brown
c3301e3c7f * src/sheap.c (bss_sbrk_buffer_beg): Remove redundant variable.
* src/gmalloc.c [CYGWIN]: Adapt to change in sheap.c.
2014-09-28 18:31:59 -04:00
Ken Brown
6c300919bc Fix implementation of HYBRID_MALLOC on Cygwin.
* src/sheap.c (bss_sbrk_buffer_end): Cast to void *.
(bss_sbrk_buffer_beg): New variable.  Use it...
* src/gmalloc.c (ALLOCATED_BEFORE_DUMPING) [CYGWIN]: ...here, to fix
  incorrect definition.
2014-09-27 16:58:05 -04:00
Stefan Monnier
19e0f0af6d * lisp/subr.el (track-mouse): New macro.
* lisp/emacs-lisp/cconv.el (cconv-convert, cconv-analyse-form):
Remove track-mouse case.
* lisp/emacs-lisp/bytecomp.el (byte-compile-track-mouse): Remove.
* src/keyboard.c (track-mouse): Rename to internal--track-mouse.
Make it into a function and change arg to be a function.
2014-09-27 11:52:28 -04:00
Stefan Monnier
e6cfa098ae Introduce global-eldoc-mode. Move Elisp-specific code to elisp-mode.el.
* lisp/emacs-lisp/eldoc.el (global-eldoc-mode): New minor mode.
(eldoc-schedule-timer): Obey it.
(eldoc-documentation-function): Default to nil.
(eldoc-mode): Don't enable if eldoc-documentation-function is not set.
(eldoc-documentation-function-default, eldoc-get-fnsym-args-string)
(eldoc-highlight-function-argument, eldoc-get-var-docstring)
(eldoc-last-data-store, eldoc-docstring-first-line)
(eldoc-docstring-format-sym-doc, eldoc-fnsym-in-current-sexp)
(eldoc-beginning-of-sexp, eldoc-current-symbol)
(eldoc-function-argstring): Move to elisp-mode.el.
(eldoc-symbol-function): Remove, unused.
* lisp/progmodes/elisp-mode.el: New file.  Rename all "eldoc-*" to "elisp--*".
(elisp-completion-at-point): Rename from lisp-completion-at-point.
(elisp--preceding-sexp): Rename from preceding-sexp.
* lisp/loadup.el: Load new file progmodes/elisp-mode.
* lisp/ielm.el (inferior-emacs-lisp-mode): Set eldoc-documentation-function.
* lisp/emacs-lisp/lisp.el (lisp--local-variables-1, lisp--local-variables)
(lisp--local-variables-completion-table, lisp--expect-function-p)
(lisp--form-quoted-p, lisp--company-doc-buffer)
(lisp--company-doc-string, lisp--company-location)
(lisp-completion-at-point): Move to elisp-mode.el.
* lisp/emacs-lisp/lisp-mode.el (lisp--mode-syntax-table): New syntax-table,
extracted from emacs-lisp-mode-syntax-table.
(emacs-lisp-mode-abbrev-table, emacs-lisp-mode-syntax-table): Move to
elisp-mode.el.
(lisp-imenu-generic-expression): Add comments to document what comes
from which Lisp dialect.
(emacs-lisp-mode-map, emacs-lisp-byte-compile)
(emacs-lisp-byte-compile-and-load, emacs-lisp-mode-hook)
(emacs-lisp-mode, emacs-list-byte-code-comment-re)
(emacs-lisp-byte-code-comment)
(emacs-lisp-byte-code-syntax-propertize, emacs-lisp-byte-code-mode)
(lisp-interaction-mode-map, lisp-interaction-mode)
(eval-print-last-sexp, last-sexp-setup-props)
(last-sexp-toggle-display, prin1-char, preceding-sexp)
(eval-last-sexp-1, eval-last-sexp-print-value)
(eval-last-sexp-fake-value, eval-sexp-add-defvars, eval-last-sexp)
(eval-defun-1, eval-defun-2, eval-defun): Move to elisp-mode.el.
* src/lisp.mk (lisp): Add elisp-mode.elc.
2014-09-26 23:57:41 -04:00
Paul Eggert
1f9f052c6d * xfns.c (x_default_scroll_bar_color_parameter):
Use USE_LOCAL_ALLOCA only if USE_TOOLKIT_SCROLL_BARS,
to pacify --enable-gcc-warnings in non-scrollbar builds.
2014-09-26 09:49:10 -07:00
Ken Brown
2416926025 src/w32term.h (ALIGN_STACK): Fix the cpp condition. 2014-09-26 10:06:35 +03:00
Eli Zaretskii
686b21966f Don't use USE_STACK_LISP_OBJECTS on Windows with GCC older than 4.2.
src/lisp.h (USE_STACK_LISP_OBJECTS): Default to false for 32-bit
 MinGW builds that use GCC before 4.2.

Fixes: debbugs:18559
2014-09-25 20:49:02 +03:00
Eli Zaretskii
39234ddb3e src/w32term.h (ALIGN_STACK): Fix a typo in last commit.
Fixes: debbugs:18559
2014-09-25 20:28:48 +03:00
Dmitry Antipov
90b6baabea * xterm.c (x_new_font): Fix typo introduced by the recent dead code removal. 2014-09-25 15:16:25 +04:00
Dmitry Antipov
730c89f90f * lisp.h (toplevel): Adjust comment around USE_STACK_LISP_OBJECTS. 2014-09-25 14:24:57 +04:00
Eli Zaretskii
db61bdb139 Default to stack objects on DOS_NT platforms as well.
src/w32term.h (ALIGN_STACK) [__GNUC__]: Define to
 __attribute__((force_align_arg_pointer)) for GCC 4.2 and later.
 src/lisp.h (USE_STACK_LISP_OBJECTS): Remove the !DOS_NT condition.
 src/w32proc.c (enum_locale_fn, enum_codepage_fn): Add the
 ALIGN_STACK attribute.
 src/w32fns.c (w32_monitor_enum): Add the ALIGN_STACK attribute.
 src/w32uniscribe.c (add_opentype_font_name_to_list): Add the
 ALIGN_STACK attribute.
 src/w32font.c (add_font_name_to_list, add_font_entity_to_list)
 (add_one_font_entity_to_list): Add the ALIGN_STACK attribute.
2014-09-25 12:34:53 +03:00
Martin Rudalics
340e4cce7a Remove code left dead after 2014-07-27 changes.
* frame.c (frame_inhibit_resize):
* widget.c (EmacsFrameResize):
* window.c (resize_frame_windows, Fset_window_configuration):
* xdisp.c (expose_frame):
* xfns.c (x_change_tool_bar_height):
* xmenu.c (update_frame_menubar):
* xterm.c (handle_one_xevent, x_new_font, x_set_window_size_1):
Remove code left dead after 2014-07-27 changes.
2014-09-25 09:01:35 +02:00
Paul Eggert
10381f5894 Fix local_cons etc. to not exhaust the stack when in a loop.
Problem reported in:
http://lists.gnu.org/archive/html/emacs-devel/2014-09/msg00696.html
* buffer.c (Fother_buffer, other_buffer_safely, init_buffer):
* charset.c (load_charset_map_from_file, Ffind_charset_region)
(Ffind_charset_string):
* chartab.c (uniprop_encode_value_numeric, uniprop_table):
* data.c (wrong_range):
* editfns.c (Fpropertize, format2):
* emacs.c (init_cmdargs, decode_env_path):
* fileio.c (auto_save_error):
* fns.c (Fyes_or_no_p):
* font.c (font_style_to_value, font_parse_xlfd)
(font_parse_family_registry, font_delete_unmatched)
(font_add_log):
* fontset.c (Fset_fontset_font):
* frame.c (x_get_arg):
* keyboard.c (echo_dash, safe_run_hooks_error, parse_menu_item)
(read_char_minibuf_menu_prompt):
* keymap.c (silly_event_symbol_error, describe_vector):
* lread.c (load_warn_old_style_backquotes):
* menu.c (single_menu_item):
* minibuf.c (Fread_buffer):
* process.c (status_message, Fformat_network_address)
(server_accept_connection):
* textprop.c (copy_text_properties):
* xdisp.c (Fcurrent_bidi_paragraph_direction):
* xfns.c (x_default_scroll_bar_color_parameter):
* xfont.c (xfont_open):
* xselect.c (x_clipboard_manager_error_1):
* xterm.c (x_term_init):
Put USE_LOCAL_ALLOCA at the start of the function.
* fns.c (maybe_resize_hash_table): Use build_string instead of
build_local_string, since we'd otherwise need a conditional
USE_LOCAL_ALLOCA here, but this is just debugging output and is
not worth the bother of optimization.
* font.c (font_delete_unmatched): Remove by-hand code that
observed MAX_ALLOCA limit, since it's now done automatically.
* keymap.c (Fsingle_key_description): Put USE_SAFE_ALLOCA at top,
since build_local_string needs its sa_alloc.
* lisp.h (lisp_word_count): New function.
(SAFE_ALLOCA_LISP): Use it.
(USE_LOCAL_ALLOCA): New macro.
(local_cons, make_local_vector, make_local_string):
Observe the MAX_ALLOCA limit.
(LISP_STRING_OVERHEAD): New constant.
(make_local_string): Use it.
2014-09-24 19:01:14 -07:00
Paul Eggert
59355ea9ce Default to stack objects on non-GNU/Linux, non-DOS_NT platforms.
* lisp.h (USE_STACK_LISP_OBJECTS): Also default to true
if !defined DOS_NT && !defined GNU_LINUX.  I've tested this on AIX
and Solaris and it's likely to work on similar platforms.
2014-09-24 13:54:25 -07:00
Paul Eggert
203a9eb0ec Avoid signed integer overflow when converting Time to ptrdiff_t.
* keyboard.c (INPUT_EVENT_POS_MAX, INPUT_EVENT_POS_MIN):
New macros.
(position_to_Time, Time_to_position): New functions.
(gen_help_event, kbd_buffer_get_event): Use them.
* systime.h (Time) [emacs && !HAVE_X_WINDOWS]:
Go back to plain 'unsigned long', so that 'Time' is the same
for both X and non-X builds; this is less likely to cause surprise.
* termhooks.h: Remove compile-time check that Time and ptrdiff_t
are the same size; this is no longer required.
2014-09-24 13:30:28 -07:00
Paul Eggert
cd812613c8 * keyboard.c (make_lispy_event): Avoid unnecessary tests
of bit 28 and of whether an unsigned value is negative.
This simplifies the code a bit, and pacifies clang 3.4.
2014-09-24 11:25:04 -07:00
Ken Brown
cb61706445 * lisp.h (toplevel) [!USE_STACK_LISP_OBJECTS]: Fix poorly nested
conditions (Bug#18544).
2014-09-24 17:42:42 +04:00
Dmitry Antipov
e9a86416c6 * lisp.h (USE_STACK_LISP_OBJECTS): Enable by default if GNU_LINUX
&& __GNUC__ && !__clang__.  Mention known problems.  Adjust comment.
2014-09-24 15:59:13 +04:00
Dmitry Antipov
c0b1b03715 * chartab.c (uniprop_encode_value_numeric):
* font.c (font_style_to_value): Use make_local_vector.
(font_delete_unmatched): Use local_cons but respect MAX_ALLOCA.
* keymap.c (append_key): Use scoped_list1.
2014-09-24 15:11:14 +04:00
Eli Zaretskii
d4dfe4ea85 Fix fallout on MinGW64 from the previous commit.
src/systime.h (Time): Define as size_t, to be consistent with 64-bit
 Windows builds, where 'long' is a 32-bit type.
 src/w32inevt.h (w32_console_mouse_position): Update the argument
 types to use 'Time'.
 src/w32term.c (w32_mouse_position)
 (x_horizontal_scroll_bar_report_motion)
 (x_scroll_bar_report_motion): Update the argument types to use
 'Time'.
2014-09-24 13:06:53 +03:00
Eli Zaretskii
a45a7f5d1a Fix bug #18528 with crashes at startup during frameset restoration.
src/w32term.c (w32_read_socket): Don't use frame dimensions for
 resizing if GetClientRect returned an empty (0, 0, 0, 0)
 rectangle.  Check the return value of GetClientRect, and don't use
 the results if it didn't succeed.
 src/dispnew.c (change_frame_size_1): Recompute the frame dimensions
 in columns and lines after correcting the pixel dimensions in
 check_frame_size.
 (adjust_decode_mode_spec_buffer): Add assertion to avoid passing
 negative values to xrealloc.
2014-09-24 10:31:11 +03:00
Dmitry Antipov
4b930ccbb4 * termhooks.h (enum scroll_bar_part): Begin from 0 to allow...
(struct input_event): ...unsigned bitfields.  Likewise for
`event_kind' member.  Prefer unsigned for `code' and 'modifiers'.
Use `timestamp' for HELP_EVENT position.  Add compile-time assert.
* keyboard.c (gen_help_event, kbd_buffer_store_help_event)
(kbd_buffer_get_event): Adjust users.
(scroll_bar_parts): Add Qnil to match scroll_bar_nowhere.
(make_scroll_bar_position): New function, refactored out of...
(make_lispy_event): ...adjusted user.
* nsterm.h (EmacsScroller): Use enum for `last_hit_part' member.
* nsterm.m (ns_mouse_position, mouseUp):
* term.c (term_mouse_position):
* w32inevt.c (w32_console_mouse_position):
* w32term.c (w32_mouse_position):
* xterm.c (XTmouse_position): Use scroll_bar_above_handle.
(x_send_scroll_bar_event, xm_scroll_callback, xg_scroll_callback):
Prefer enum and explicit enum members to integers and numeric values.
2014-09-24 11:17:51 +04:00
Paul Eggert
4620e6bccd Fix some slow uses and misuses of strcat.
* doc.c (get_doc_string):
* gtkutil.c (get_utf8_string):
* xsmfns.c (x_session_initialize):
Avoid recomputation of string length.
* ftfont.c (ftfont_spec_pattern):
* xfns.c (xic_create_fontsetname):
Don't assume output buffer is initially zero.
2014-09-23 21:12:37 -07:00
Paul Eggert
97914756e8 * lisp.h (lispstpcpy): Rename from lispstrcpy, and act like stpcpy.
All callers changed.
* xterm.c (x_term_init): Use new functionality to avoid two needs
to compute a string length.
2014-09-23 10:03:48 -07:00