1. 07 Jul, 2013 1 commit
    • Paul Eggert's avatar
      Fix openp errno handling. · 5f86adcd
      Paul Eggert authored
      * callproc.c (Fcall_process): Preserve openp errno around close.
      * lread.c (openp): Set errno when returning -1, as some callers
      expect this.
      5f86adcd
  2. 06 Jul, 2013 4 commits
    • Jan Djärv's avatar
      * lisp/files.el (write-file): Do not display confirm dialog for NS, · 1afb1d07
      Jan Djärv authored
      it does its own dialog, which can't be cancelled.
      
      * src/nsfns.m: Remove panelOK.
      (ns_fd_data): New.
      (ns_run_file_dialog): New function.
      (Fns_read_file_name): Fill in ns_fd_data, post an event and start the
      event loop, so file dialog is popped up by ns_run_file_dialog, called
      by sendEvent (Bug#14578).
      (EmacsSavePanel, EmacsOpenPanel): Remove ok and cancel methods.
      
      * src/nsterm.h (NSSavePanel): Update comment.
      (NSAPP_DATA2_RUNFILEDIALOG): Define.
      (ns_run_file_dialog): Declare.
      
      * src/nsterm.m (sendEvent:): Handle NSAPP_DATA2_RUNFILEDIALOG.
      1afb1d07
    • Eli Zaretskii's avatar
      Fix bug #14771 with scroll-step = 1 and non-nil line-spacing. · fdda0220
      Eli Zaretskii authored
       src/xdisp.c (default_line_pixel_height): New function.
       (pos_visible_p, move_it_vertically_backward, try_scrolling)
       (try_cursor_movement, redisplay_window, try_window)
       (try_window_id): Use it instead of FRAME_LINE_HEIGHT.  (Bug#14771)
       src/window.c (window_scroll_pixel_based): use
       default_line_pixel_height.
       src/dispextern.h (default_line_pixel_height): Add prototype.
       src/frame.c (x_set_line_spacing): Accept a float value for
       line-spacing parameter, per the documentation.
      fdda0220
    • Eli Zaretskii's avatar
      Clarify documentation of multibyte-string-p. · 3323c263
      Eli Zaretskii authored
       src/data.c (Fmultibyte_string_p): Doc fix.
      
       doc/lispref/nonascii.texi (Text Representations): Document that
       multibyte-string-p returns nil for non-string objects.
      3323c263
    • Paul Eggert's avatar
      Use emacs_open more consistently when opening files. · 406af475
      Paul Eggert authored
      This handles EINTR more consistently now, and makes it easier
      to introduce other uniform changes to file descriptor handling.
      * src/systdio.h: New file.
      * src/buffer.c (mmap_init):
      * cygw32.c (chdir_to_default_directory):
      * dispnew.c (Fopen_termscript):
      * emacs.c (Fdaemon_initialized):
      * fileio.c (Fdo_auto_save):
      * image.c (slurp_file, png_load_body, jpeg_load_body):
      * keyboard.c (Fopen_dribble_file):
      * lread.c (Fload):
      * print.c (Fredirect_debugging_output):
      * sysdep.c (get_up_time, procfs_ttyname, procfs_get_total_memory):
      * termcap.c (tgetent):
      * unexaix.c, unexcoff.c (unexec, adjust_lnnoptrs):
      * unexcw.c, unexelf.c, unexhp9k800.c, unexmacosx.c (unexec):
      * w32term.c (w32_initialize) [CYGWIN]:
      * xfaces.c (Fx_load_color_file):
      Use emacs_open instead of plain open, and emacs_fopen instead of
      plain fopen.
      * dispnew.c, fileio.c, image.c, keyboard.c, lread.c, print.c, sysdep.c:
      * xfaces.c: Include sysstdio.h rather than stdio.h, for emacs_fopen.
      * callproc.c (default_output_mode): New constant.
      (Fcall_process): Use it to call emacs_open instead of plain creat.
      * dispnew.c (Fopen_termscript): Fix minor race in opening termscript.
      * sysdep.c (emacs_open): Add commentary and don't call file name "path".
      (emacs_fopen): New function.
      * unexaix.c, unexcoff.c, unexelf.c, unexhp9k800.c, unexmacosx.c:
      Include <lisp.h>, for emacs_open.
      * unexelf.c (fatal): Remove decl; not needed with <lisp.h> included.
      406af475
  3. 05 Jul, 2013 1 commit
    • Paul Eggert's avatar
      Remove duplicate #include directives. · 47ba6d43
      Paul Eggert authored
      * alloc.c [GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES]:
      * xfaces.c:
      Don't include stdio.h twice.
      * buffer.c [USE_MMAP_FOR_BUFFERS]:
      Don't include sys/types.h or stdio.h twice.
      * fileio.c [WINDOWSNT | MSDOS]: Don't include fcntl.h twice.
      * lread.c: Don't include coding.h twice.
      * nsfont.m: Don't include frame.h twice.
      * process.c [HAVE_RES_INIT]: Don't include <netinet/in.h> twice.
      * ralloc.c: Don't include <unistd.h> twice.
      * xdisp.c: Don't include font.h twice.
      * xterm.c: Don't include fontset.h twice.
      * xterm.h [USE_X_TOOLKIT]: Don't include X11/StringDefs.h twice.
      47ba6d43
  4. 04 Jul, 2013 6 commits
  5. 02 Jul, 2013 5 commits
    • Paul Eggert's avatar
      Remove some unused macros from 'configure'. · 57f8c490
      Paul Eggert authored
      * configure.ac (HAVE_SOUNDCARD_H, HAVE_LINUX_VERSION_H, HAVE_SPEED_T)
      (HAVE_GNUTLS_CALLBACK_CERTIFICATE_VERIFY)
      (HAVE_GNUTLS_CERTIFICATE_SET_VERIFY_FUNCTION, HAVE_UTIMES)
      (HAVE_LIBHESIOD, HAVE_LIBRESOLV, HAVE_LIBCOM_ERR, HAVE_LIBCRYPTO)
      (HAVE_LIBK5CRYPTO, HAVE_LIBKRB5, HAVE_LIBDES425, HAVE_LIBDES)
      (HAVE_LIBKRB4, HAVE_LIBKRB, HAVE_DES_H, HAVE_KERBEROSIV_DES_H)
      (HAVE_DEV_PTMX, DEVICE_SEP, USG5):
      Remove these macros, as they are not used.
      (sys_siglist): Remove macro; src/sysdep.c now does this.
      * src/sysdep.c (sys_siglist) [HAVE_DECL___SYS_SIGLIST]:
      Define to __sys_siglist.
      57f8c490
    • Eli Zaretskii's avatar
      Fix bug #2749 with overflow-newline-into-fringe in visual-line-mode. · bcffb5ca
      Eli Zaretskii authored
       src/xdisp.c (IT_OVERFLOW_NEWLINE_INTO_FRINGE): Don't disallow
       word-wrap, so that overflow-newline-into-fringe would work in
       visual-line-mode.
       (move_it_in_display_line_to): When the last scanned display
       element fits exactly on the display line, and
       overflow-newline-into-fringe is non-nil, but wrap_it is valid,
       don't return MOVE_NEWLINE_OR_CR, but instead back up to the last
       wrap point and return MOVE_LINE_CONTINUED.  Fixes problems with
       finding buffer position that corresponds to pixel coordinates,
       e.g. in buffer_posn_from_coords.
      bcffb5ca
    • Jan Djärv's avatar
    • Paul Eggert's avatar
      Don't convert function pointers to void * and back. · 52a9bcae
      Paul Eggert authored
      It isn't portable C, and it's easy enough to avoid.
      * alloc.c: Verify SAVE_FUNCPOINTER bits, too.
      (make_save_value): Add support for SAVE_FUNCPOINTER.
      * keymap.c (map_keymap_char_table_item, map_keymap_internal):
      * print.c (print_object):
      Distinguish function from object pointers.
      * lisp.h (SAVE_FUNCPOINTER): New constant.
      (SAVE_SLOT_BITS): Adjust to it.
      (SAVE_TYPE_FUNCPTR_PTR_OBJ): New constant, replacing
      SAVE_TYPE_PTR_PTR_OBJ.  Change the only use.
      (voidfuncptr): New typedef.
      (struct Lisp_Save_Value): New member data[0].funcpointer.
      (XSAVE_FUNCPOINTER): New function.
      52a9bcae
    • Paul Eggert's avatar
      Simplify buildobj processing. · c2418359
      Paul Eggert authored
      * Makefile.in (buildobj.h): Make it a sequence of strings each
      followed by comma, rather than a single string.  Put it into a
      .tmp file in case there's an error while generating it.
      (gl-stamp): Use .tmp for temp files.
      (mostlyclean): Clean .tmp files.
      * doc.c (buildobj): Move to just the routine that needs it.
      It's now an array of strings, so processing is simpler.
      c2418359
  6. 01 Jul, 2013 3 commits
  7. 30 Jun, 2013 8 commits
    • Michal Nazarewicz's avatar
      Add `remember-notes' function to store random notes across Emacs · ef099a94
      Michal Nazarewicz authored
      restarts.
      * 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.
      ef099a94
    • 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
      9d3f2fc2
    • 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.
      1d71c1d9
    • Paul Eggert's avatar
      Remove duplicate ChangeLog entry. · 16b6e7f2
      Paul Eggert authored
      16b6e7f2
    • 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.
      8f5f35cc
    • Paul Eggert's avatar
      * intervals.c (get_local_map): Actually clip POSITION · e6c6c8c7
      Paul Eggert authored
      Fixes: debbugs:14753
      e6c6c8c7
    • 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.
      5d1c3286
    • 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
       loop.
      
       lisp/bindings.el (right-char, left-char): Don't call sit-for, this is
       no longer needed.  Use arithmetic comparison only for numerical
       arguments.
      0ba54312
  8. 29 Jun, 2013 4 commits
    • Juanma Barranquero's avatar
      Fix typos in ChangeLogs. · c1ea3abf
      Juanma Barranquero authored
      c1ea3abf
    • Eli Zaretskii's avatar
      Fix typo in src/ChangeLog. · 671796d3
      Eli Zaretskii authored
      671796d3
    • 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.
      9c90cc06
    • 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.
      4c672a0f
  9. 28 Jun, 2013 4 commits
  10. 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.
      dae2f5ef
  11. 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
      dummy_handler.
      (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
      fa55d2aa
  12. 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
      :max-height.
      
      * 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.
      f3f9606c
    • 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
      c7041908