1. 30 Jun, 2013 9 commits
    • Michal Nazarewicz's avatar
      Add `remember-notes' function to store random notes across Emacs · ef099a94
      Michal Nazarewicz authored
      * remember.el (remember-data-file): Add :set callback to affect
      notes buffer (if any).
      (remember-notes): New command.
      (remember-notes-buffer-name, bury-remember-notes-on-kill):
      New defcustoms for the `remember-notes' function.
      (remember-notes-save-and-bury-buffer): New command.
      (remember-notes-mode-map): New variable.
      (remember-mode): New minor mode.
      (remember-notes--kill-buffer-query): New function.
      * lisp/startup.el (initial-buffer-choice): Add notes to custom type.
      * src/buffer.c (FKill_buffer): Run `kill-buffer-query-functions'
      before checking whether buffer is modified.  This lets
      `kill-buffer-query-functions' cancel killing of the buffer or save
      its content before `kill-buffer' asks user the "Buffer %s
      modified; kill anyway?" question.
      * remember.el (remember-append-to-file):
      Don't mix `find-buffer-visiting' and `get-file-buffer'.
      * lisp/files.el (find-file-noselect): Simplify conditional expression.
    • Jan Djärv's avatar
      * nsfns.m (handlePanelKeys): Don't process Command+Function keys. · 9d3f2fc2
      Jan Djärv authored
      Let the super performKeyEquivalent deal with them.
      Fixes: debbugs:14747
    • Paul Eggert's avatar
      Fix minor problems found by static checking. · 1d71c1d9
      Paul Eggert authored
      * lwlib/lwlib-Xaw.h (xaw_update_one_value, xaw_popup_menu):
      * lwlib/lwlib-Xlw.h (xlw_update_one_value, xlw_pop_instance):
      * lwlib/lwlib.h (lw_allow_resizing, lw_set_main_areas) [!USE_MOTIF]:
      Now const.
      * src/widget.c (resize_cb): Remove unused local.
    • Paul Eggert's avatar
      Remove duplicate ChangeLog entry. · 16b6e7f2
      Paul Eggert authored
    • Paul Eggert's avatar
      Do not use GTK 3 if it exists but cannot be compiled. · 8f5f35cc
      Paul Eggert authored
      * configure.ac: Leave GTK_OBJ and term_header alone if GTK 3
      exists but cannot be compiled.
      * src/xmenu.c (x_menu_wait_for_event) [!USE_GTK]:
      * src/xterm.c (x_error_handler) [!USE_GTK]:
      Do not use GTK 3.
    • Paul Eggert's avatar
      * intervals.c (get_local_map): Actually clip POSITION · e6c6c8c7
      Paul Eggert authored
      Fixes: debbugs:14753
    • Paul Eggert's avatar
      Spelling fixes. · adc5dbce
      Paul Eggert authored
    • Eli Zaretskii's avatar
      A possible fix for bug #14753 with aborts in get_local_map. · 5d1c3286
      Eli Zaretskii authored
       src/intervals.c (get_local_map): Instead of aborting, clip POSITION
       to the valid range of values.
    • Eli Zaretskii's avatar
      Don't call sit-for in right-char and left-char for visual cursor motion. · 0ba54312
      Eli Zaretskii authored
       src/xdisp.c (Fmove_point_visually): Invalidate the cursor position
       when moving point by using the current glyph matrix.  This avoids
       the need to force redisplay when this function is called in a
       lisp/bindings.el (right-char, left-char): Don't call sit-for, this is
       no longer needed.  Use arithmetic comparison only for numerical
  2. 29 Jun, 2013 4 commits
    • Juanma Barranquero's avatar
      Fix typos in ChangeLogs. · c1ea3abf
      Juanma Barranquero authored
    • Eli Zaretskii's avatar
      Fix typo in src/ChangeLog. · 671796d3
      Eli Zaretskii authored
    • Paul Eggert's avatar
      Fix minor problems found by static checking. · 9c90cc06
      Paul Eggert authored
      * coding.c (encode_inhibit_flag, inhibit_flag): New functions.
      Redo the latter's body to sidestep GCC parenthesization warnings.
      (setup_coding_system, detect_coding, detect_coding_system): Use them.
      * coding.c (detect_coding, detect_coding_system):
      * coding.h (struct undecided_spec):
      Use bool for boolean.
      * image.c (QCmax_width, QCmax_height): Now static.
      * xdisp.c (Fmove_point_visually): Remove unused local.
    • Eli Zaretskii's avatar
      Implement visual-order cursor motion. · 4c672a0f
      Eli Zaretskii authored
       src/xdisp.c (Fmove_point_visually): New function.
       lisp/bindings.el (visual-order-cursor-movement): New defcustom.
       (right-char, left-char): Provide visual-order cursor motion by
       calling move-point-visually.  Update the doc strings.
       doc/emacs/basic.texi (Moving Point): Document visual-order-cursor-movement
       and its effect on right-char and left-char.
       doc/lispref/display.texi (Bidirectional Display): Document move-point-visually.
       etc/NEWS: Document the new feature.
  3. 28 Jun, 2013 7 commits
  4. 27 Jun, 2013 1 commit
    • Paul Eggert's avatar
      Do not tickle glib SIGCHLD handling if Cygwin. · dae2f5ef
      Paul Eggert authored
      This mostly consists of undoing recent changes.
      * callproc.c (Fcall_process):
      * process.c (create_process):
      Do not worry about catching SIGCHLD here, undoing previous change.
      * nsterm.m (ns_term_init): Re-catch SIGCHLD, undoing previous change.
      * process.c, process.h (catch_child_signal):
      No longer extern if !NS_IMPL_GNUSTEP, undoing 06-22 change.
      * process.c (catch_child_handler): Don't worry about being called
      lazily and do not assume caller has blocked SIGCHLD, undoing
      previous change.  Move first-time stuff back to
      init_process_emacs, undoing 06-22 change.  If CYGWIN, do not
      tickle glib, as that causes Cygwin bootstrap to fail.  Do not
      set lib_child_handler if it's already initialized, which may
      help avoid problems on GNUStep.
  5. 24 Jun, 2013 1 commit
    • Paul Eggert's avatar
      A more-conservative workaround for Cygwin SIGCHLD issues. · fa55d2aa
      Paul Eggert authored
      * callproc.c (Fcall_process):
      * process.c (create_process):
      Make sure SIGCHLD is caught before we fork,
      since Emacs startup no arranges to catch SIGCHLD.
      * process.c (lib_child_handler): Initialize to null, not to
      (catch_child_signal): Allow self to be called lazily.
      Do nothing if it's already been called.
      Assume caller has blocked SIGCHLD (all callers do now).
      * emacs.c (main): Do not catch SIGCHLD here; defer it until
      just before it's really needed.
      * nsterm.m (ns_term_init): No need to re-catch SIGCHLD here,
      since it hasn't been caught yet.
      Fixes: debbugs:14569
  6. 23 Jun, 2013 2 commits
    • Lars Magne Ingebrigtsen's avatar
      Implement :max-width/:max-height for (ImageMagic) images · f3f9606c
      Lars Magne Ingebrigtsen authored
      * doc/lispref/display.texi (ImageMagick Images): Mention :max-width and
      * lisp/net/shr.el (shr-rescale-image): Use the new
      :max-width/:max-height functionality.
      * src/image.c (compute_image_size): New function to implement
      :max-width and :max-height.
      (imagemagick_load_image): Use it.
    • Paul Eggert's avatar
      Try to avoid malloc SEGVs on Cygwin. · c7041908
      Paul Eggert authored
      * callproc.c, process.h (block_child_signal, unblock_child_signal):
      Now extern.
      * emacs.c (main): Catch SIGCHLD just before initializing gfilenotify.
      * process.c (catch_child_signal): Block SIGCHLD while futzing with
      the SIGCHLD handler, since the code is not atomic and (due to glib)
      signals may be arriving now.
      * sysdep.c (init_signals): Do not catch child signals here;
      'main' now does that later, at a safer time.
      Fixes: debbugs:14569
  7. 22 Jun, 2013 2 commits
    • Paul Eggert's avatar
      Clean up SIGCHLD handling a bit. · 0dfeed58
      Paul Eggert authored
      * process.c, process.h (catch_child_signal):
      Now always extern, even if !NS_IMPL_GNUSTEP.
      * process.c (catch_child_signal): Move glib tickler here from
      init_process_emacs, so that it's done earlier in Emacs
      initialization.  Also move the noninteractive && !initialized
      check here from init_process_emacs.  This is all a bit cleaner for
      GNUish platforms, and I hope it works around the Cygwin bug.
      * sysdep.c (init_signals): Invoke catch_child_signal here, so
      that glib signal handling is tickled before glib creates threads.
      Fixes: debbugs:14569
    • Paul Eggert's avatar
      * process.c (wait_reading_process_output): Avoid int overflow · f86852b4
      Paul Eggert authored
      when reading more than 2 GiB total from a process.
  8. 21 Jun, 2013 3 commits
    • Paul Eggert's avatar
      * process.c (create_process): Handle a couple more cases, · cbd6509c
      Paul Eggert authored
      i.e., work even if new_argv and wait_child_setup[i] are cached.
      Use Fcall_process's style for volatile vars.
    • Andreas Schwab's avatar
    • Paul Eggert's avatar
      Use C99-style flexible array members if available. · fbe9e0b9
      Paul Eggert authored
      This avoids some subtle aliasing issues, which typically
      aren't a problem with GCC but may be a problem elsewhere.
      * lib-src/ebrowse.c (struct member, struct alias, struct sym):
      (add_sym, add_member, make_namespace, register_namespace_alias):
      Use offsetof (struct, flex_array_member), not sizeof (struct), as
      that ports better to pre-C99 non-GCC.
      * src/alloc.c (sdata): New typedef, replacing the old struct sdata.
      It is a struct if GC_CHECK_STRING_BYTES, a union otherwise.
      In either case, it uses a flexible array member rather than
      the old struct hack.  All uses changed.
      (SDATA_NBYTES, sweep_strings) [!GC_CHECK_STRING_BYTES]:
      Adjust to sdata reorganization.
      * src/alloc.c (VBLOCK_BYTES_MIN, allocate_vectorlike, Fgarbage_collect):
      Use offsetof (struct, flex_array_member), not sizeof (struct), as
      that ports better to pre-C99 non-GCC.
      * src/chartab.c (Fmake_char_table, make_sub_char_table, copy_char_table):
      Use CHAR_TABLE_STANDARD_SLOTS rather than its definition,
      as the latter has changed.
      * src/conf_post.h (FLEXIBLE_ARRAY_MEMBER): Move here from w32.c,
      and port better to pre-C99 GCC.
      * src/image.c (struct xpm_cached_color):
      * src/lisp.h (struct Lisp_Vector, struct Lisp_Bool_Vector)
      (struct Lisp_Char_Table, struct Lisp_Sub_Char_Table):
      * src/lisp.h (string_bytes) [GC_CHECK_STRING_BYTES]:
      Move decl to top level so it gets checked against implementation.
      (CHAR_TABLE_STANDARD_SLOTS): Adjust to struct Lisp_Char_Table change.
      * src/w32.c (FLEXIBLE_ARRAY_MEMBER): Move to conf_post.h.
  9. 20 Jun, 2013 5 commits
    • Paul Eggert's avatar
      * syntax.c: Integer cleanups. · 1fc71008
      Paul Eggert authored
      (SYNTAX_FLAGS_COMMENT_STYLEC): Return a boolean, not 0-or-2.
      All uses that need 0-or-2 changed to:
      (SYNTAX_FLAGS_COMMENT_STYLEC2): New macro, with the same semantics
      (struct lisp_parse_state, syntax_prefix_flag_p, update_syntax_table)
      (char_quoted, prev_char_comend_first, back_comment)
      (Finternal_describe_syntax_value, skip_chars, skip_syntaxes)
      (in_classes, forw_comment, scan_lists, scan_sexps_forward):
      Use bool for boolean.
      (update_syntax_table, skip_chars, skip_syntaxes):
      Prefer int to unsigned when either will do.
      (back_comment): Return boolean success flag, like forw_comment,
      instead of positive-or-minus-1 (which might have overflowed int anyway).
      Don't stuff ptrdiff_t into int.
      (syntax_spec_code, syntax_code_spec): Now const.
      (Fmatching_paren, scan_lists, scan_sexps_forward):
      Use enum syntaxcode for syntax code.
      (Fmatching_paren): Check that arg is a character, not just an integer.
      (Fstring_to_syntax): Don't assume 0377 fits in enum syntaxcode.
      (Finternal_describe_syntax_value): Omit no-longer-needed
      comparison to 0.
      (skip_chars): Use char, not unsigned char, when the distinction
      doesn't matter.
      (forw_comment, scan_lists): Prefer A |= B to A = A || B when B's cheap.
      * bytecode.c (exec_byte_code):
      * syntax.c (syntax_spec_code, Fchar_syntax)
      (Finternal_describe_syntax_value, skip_chars, skip_syntaxes)
      * syntax.h (SYNTAX_WITH_FLAGS):
      Omit unnecessary casts.
    • Eli Zaretskii's avatar
      Yet another attempt at fixing bugs #14602, 14630, 14669. · b932cad7
      Eli Zaretskii authored
       src/w32fns.c (w32_wnd_proc): Don't compute the header line and mode
       line dimensions here, to avoid race conditions with the main
       src/w32term.c (w32_draw_window_cursor): Compute the header line and
       mode line dimensions here.
       <w32_system_caret_window, w32_system_caret_hdr_height>:
       <w32_system_caret_mode_height>: New variables.
       src/w32term.h: Declare them.
    • Paul Eggert's avatar
      * alloc.c (die): Move "assertion failed" string here ... · 5013fc08
      Paul Eggert authored
      * lisp.h (eassert): ... from here.  Also, suppress evaluation of
      COND when SUPPRESS_CHECKING.  This shrinks the executable text
      size by 0.8% to 2.2% when configured with --enable-checking,
      depending on optimization flags (GCC 4.8.1 x86-64).
    • Paul Eggert's avatar
      Add log2 support and make log10 obsolete for consistency. · 89561f72
      Paul Eggert authored
      * configure.ac (log2): Check for this function.
      * doc/lispref/numbers.texi (Math Functions): Remove obsolete function log10.
      * lisp/subr.el (log10): Move here from C code, and declare as obsolete.
      All uses of (log10 X) replaced with (log X 10).
      * src/floatfns.c (Flog) [HAVE_LOG2]: Use log2 if available and if the
      base is 2; this is more accurate.
      (Flog10): Move to Lisp (marked obsolete there).
    • Paul Eggert's avatar
      * floatfns.c: Add commentary re C99 and C11. · 33cbd259
      Paul Eggert authored
  10. 19 Jun, 2013 4 commits
    • Juanma Barranquero's avatar
      Fix typos in ChangeLogs. · 4f405069
      Juanma Barranquero authored
    • Juanma Barranquero's avatar
      src/sound.c: Silence some warnings. · 983aeb9a
      Juanma Barranquero authored
      (string_default): Move to !WINDOWSNT section.
      (Fplay_sound_internal) [WINDOWSNT]: Remove i_result to avoid warning.
    • Paul Eggert's avatar
      * sound.c: Integer cleanups. · bbc51b15
      Paul Eggert authored
      Remove unnecessary forward decls.
      (struct sound_device): The 'file' member is now a Lisp_Object, not
      a char *, so that we needn't invoke alloca on a huge size.
      (Fplay_sound_internal): Adjust to this.
      (string_default): New function.
      (vox_open, vox_init, alsa_open, alsa_configure, alsa_init):
      Use it to adjust to the struct sound_device change.
      (parse_sound, wav_init, au_init, alsa_init): Use bool for booleans.
      (be2hs) [0]: Remove.
    • Paul Eggert's avatar
      * syntax.c (skip_chars): Don't use uninitialized storage · 178ba3e6
      Paul Eggert authored
      when searching a multibyte buffer for characters that are not in a
      unibyte string that contains non-ASCII characters.
  11. 18 Jun, 2013 2 commits