1. 05 Mar, 2013 5 commits
    • Paul Eggert's avatar
      FILE's lock is now always .#FILE and may be a regular file. · 70743157
      Paul Eggert authored
      * etc/NEWS: Document this.
      * nt/inc/unistd.h (O_NOFOLLOW): New macro.
      * src/filelock.c: Include <c-ctype.h>.
      (MAX_LFINFO): New top-level constant.
      (lock_info_type): Remove members pid, boot_time.  Add members at,
      dot, colon.  Change user member to be the entire buffer, not a
      pointer.  This allows us to handle the case where a foreign
      pid or boot time exceeds the local range.  All uses changed.
      (LINKS_MIGHT_NOT_WORK): New constant.
      (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
      (defined_WINDOWSNT): Remove.
      (MAKE_LOCK_NAME, file_in_lock_file_name):
      Always use .#FILE (not .#-FILE) for the file lock,
      even if it is a regular file.
      (rename_lock_file): New function.
      (create_lock_file): Use it.
      (create_lock_file, read_lock_data):
      Prefer a symbolic link for the lock file, falling back on a
      regular file if symlinks don't work.  Do not try to create
      symlinks on MS-Windows, due to security hassles.  Stick with
      POSIXish functions (open, read,...
      70743157
    • Eli Zaretskii's avatar
      Don't sync charpos and bytepos in bidi_resolve_explicit_1. · 05e193f1
      Eli Zaretskii authored
       src/bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
       bidi_count_bytes, as the callers now arrange for bidi_it->charpos
       to be in sync with bidi_it->bytepos.  Suggested by Dmitry Antipov
       <dmantipov@yandex.ru>.
      05e193f1
    • Paul Eggert's avatar
      Also port to MirBSD. · a318f811
      Paul Eggert authored
      a318f811
    • Paul Eggert's avatar
      Fix a build failure on OpenBSD 4.x. · 725eb027
      Paul Eggert authored
      * sysdep.c (KERN_PROC, kinfo_proc) [BSD_SYSTEM && !KERN_PROC]:
      Define to KERN_PROC2 and kinfo_proc2, for OpenBSD 4.9.
      list-system-processes still returns nil, but at least it doesn't crash.
      Problem reported by Nelson H. F. Beebe in
      <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>.
      725eb027
    • Dmitry Antipov's avatar
      * composite.c (get_composition_id, fill_gstring_header): · 3bfc46eb
      Dmitry Antipov authored
      Use make_uninit_vector where appropriate.
      * font.c (Ffont_get_glyphs, build_style_table): Likewise.
      * xselect.c (clean_local_selection_data): Likewise.
      3bfc46eb
  2. 04 Mar, 2013 2 commits
  3. 02 Mar, 2013 7 commits
    • Paul Eggert's avatar
      2db41375
    • Paul Eggert's avatar
      The lock for FILE is now .#FILE or .#-FILE. · b5029e23
      Paul Eggert authored
      The old approach, which fell back on DIR/.#FILE.0 through
      DIR/.#FILE.9, had race conditions that could not be easily fixed.
      If DIR/.#FILE is a non-symlink file, Emacs now does not create a
      lock file for DIR/FILE; that is, DIR/FILE is no longer partly
      protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
      because the locking mechanism was never reliable in that case).
      This patch fixes this and other bugs discovered by a code
      inspection that was prompted by
      <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
      Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
      to avoid interoperability problems between the MS-Windows and
      non-MS-Windows implementations.  MS-Windows and non-MS-Windows
      instances of Emacs now ignore each others' locks.
      * etc/NEWS: Document this.
      * src/filelock.c (defined_WINDOWSNT): New constant.
      (MAKE_LOCK_NAME, fill_in_lock_file_name):
      Don't create DIR/.#FILE.0 through DIR/.#FILE.9.  Instead, create
      DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
      regular files on MS-Windows hosts.
      (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
      Use SAFE_ALLOCA to avoid problems with long file names.
      (MAX_LFINFO): Now a local constant, not a global macro.
      (IS_LOCK_FILE): Remove.
      (lock_file_1): Don't inspect errno if symlink call succeeds;
      that's not portable.
      (lock_file): Document that this function can return if lock
      creation fails.
      
      Fixes: debbugs:13807
      b5029e23
    • Paul Eggert's avatar
      * textprop.c: Use bool for booleans. · 81c23309
      Paul Eggert authored
      (validate_interval_range, Fadd_text_properties)
      (Fremove_text_properties): Prefer bool to int when either works.
      81c23309
    • Eli Zaretskii's avatar
      Protect against changes of interval tree when adding/removing text props. · 18f2ac09
      Eli Zaretskii authored
       src/textprop.c (Fadd_text_properties, Fremove_text_properties): If
       the interval tree changes as a side effect of calling
       modify_region, re-do processing starting from the call to
       validate_interval_range.  (Bug#13743)
      18f2ac09
    • Eli Zaretskii's avatar
      c856b8d4
    • Eli Zaretskii's avatar
      Fix bug #13734 with errors in lisp.h macro expansion. · 474b43d9
      Eli Zaretskii authored
       src/lisp.h (XPNTR) [!USE_LSB_TAG]: Fix parentheses nesting.
      474b43d9
    • Andreas Schwab's avatar
      Fixes: debbugs:13734 · b270d116
      Andreas Schwab authored
      * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren.
      b270d116
  4. 27 Feb, 2013 3 commits
  5. 26 Feb, 2013 2 commits
    • Bastien Guerry's avatar
      3b166f09
    • Paul Eggert's avatar
      Minor textprop integer cleanup. · ecc0fdd4
      Paul Eggert authored
      * intervals.h, textprop.c (add_text_properties_from_list):
      Return void, not int, since nobody uses the return value.
      * textprop.c (validate_plist, add_properties, remove_properties)
      (Fadd_text_properties):
      Don't assume list length fits in int.
      (interval_has_all_properties, interval_has_some_properties)
      (interval_has_some_properties_list, add_properties, remove_properties)
      (Fadd_text_properties, Fremove_text_properties)
      (Fremove_list_of_text_properties, text_property_stickiness):
      Use bool for booleans.
      (Fadd_text_properties, Fremove_text_properties):
      (Fremove_list_of_text_properties):
      Reindent do-while as per GNU style.
      ecc0fdd4
  6. 25 Feb, 2013 4 commits
    • Eli Zaretskii's avatar
      Implement CLASH_DETECTION for MS-Windows. · 343a2aef
      Eli Zaretskii authored
       src/filelock.c [WINDOWSNT]: Include w32.h.
       (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
       function of that name.  Up-case the macro arguments.
       (IS_LOCK_FILE): New macro.
       (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
       (create_lock_file): New function, with body extracted from
       lock_file_1.
       [WINDOWSNT]: Implement lock files by writing a regular file with
       the lock information as its contents.
       (read_lock_data): New function, on Posix platforms just calls
       emacs_readlinkat.
       [WINDOWSNT]: Read the lock info from the file.
       (current_lock_owner): Call read_lock_data instead of calling
       emacs_readlinkat directly.
       (lock_file) [WINDOWSNT]: Run the file name through
       dostounix_filename.
       src/w32proc.c (sys_kill): Support the case of SIG = 0, in which case
       just check if the process by that PID exists.
       src/w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
       also present, as doing so will fail to error out if the file
       alrea...
      343a2aef
    • Eli Zaretskii's avatar
      Fix bug #13743 with crashes due to recursive add-text-properties. · 0248b0d7
      Eli Zaretskii authored
       src/textprop.c (Fadd_text_properties, Fremove_text_properties)
       (Fremove_list_of_text_properties): Skip all of the intervals in
       the region between START and END that already have resp. don't
       have the requested properties, not just the first one.  Add
       assertions that the loop afterwards always modifies the
       properties.
      0248b0d7
    • Stefan Monnier's avatar
      * src/callint.c (Fcall_interactively): Use the right lexical environment · b5071fc7
      Stefan Monnier authored
      for `interactive' specs.
      * src/eval.c (Feval): Accept a lexical environment.
      
      Fixes: debbugs:13811
      b5071fc7
    • Paul Eggert's avatar
      Simplify data_start configuration. · 1ddc2bd6
      Paul Eggert authored
      This is a followon simplification to the fix for Bug#13650.
      * admin/CPP-DEFINES (DATA_START, ORDINARY_LINK): Remove.
      * configure.ac (CRT_DIR, LIB_STANDARD, START_FILES, DATA_START)
      (LD_FIRSTFLAG, ORDINARY_LINK, LIB_GCC): Remove.
      (AC_CHECK_HEADERS_ONCE): Remove sys/resource.h, as it's
      not always needed.
      (HAVE_DATA_START): New macro.
      * etc/PROBLEMS (LIBS_SYSTEM, LIBS_MACHINE, LIBS_STANDARD): Remove.
      Remove legacy-systems section, as this stuff is no longer
      applicable with current linking strategies.
      * src/Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
      (START_FILES): Remove.  All uses removed.
      (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
      (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
      (buildobj.h): Use it.
      ($(ALLOBJS)): Depend on globals.h.
      (temacs$(EXEEXT)): Use $(ALLOBJS).
      * src/autodeps.mk (ALLOBJS): Move to Makefile.in.
      * src/deps.mk (vm-limit.o):
      * src/makefile.w32-in ($(BLD)/vm-limit.$(O)):
      Do not depend on mem-limits.h.
      * src/...
      1ddc2bd6
  7. 24 Feb, 2013 2 commits
  8. 22 Feb, 2013 2 commits
    • Paul Eggert's avatar
      Assume C89 or better. · fcee5028
      Paul Eggert authored
      * ralloc.c (SIZE, POINTER, NIL):
      * vm-limit.c (POINTER):
      Remove, replacing all uses with C89 equivalents.  These old
      symbols were present only for porting to pre-C89 platforms.
      fcee5028
    • Claudio Bley's avatar
      Don't call 'select' from emacs_gnutls_pull. · d78cf5ed
      Claudio Bley authored
       src/w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
       This avoids warning messages reported as part of Bug#13546.
      d78cf5ed
  9. 21 Feb, 2013 1 commit
  10. 20 Feb, 2013 4 commits
  11. 18 Feb, 2013 1 commit
  12. 17 Feb, 2013 4 commits
    • Eli Zaretskii's avatar
      Fix bug #13735 with network streams on MS-Windows. · ae11bda5
      Eli Zaretskii authored
      Revert changes to w32proc.c done since 2012-11-30T09:23:15Z!eliz@gnu.org.
      
      Do NOT merge to trunk!
      
       src/w32proc.c (new_child): Remove the loop that attempted to salvage
       slots of dead processes.
       (new_child, delete_child, find_child_pid): Don't insist on
       procinfo.hProcess be NULL for a process slot to be considered
       inactive, or be non-NULL to be considered active.
       (reader_thread): Don't set the FILE_AT_EOF flag of a file
       descriptor if the corresponding child was deleted and its
       char_avail handle is NULL.
       (reap_subprocess): Don't reset the FILE_AT_EOF flag.
       (sys_select): Don't pass a NULL process handle to
       WaitForMultipleObjects.
      
      Fixes: debbugs:13735 debbugs:13546
      ae11bda5
    • Stefan Monnier's avatar
      Prefer `message1' over `message'. · 2f73da9c
      Stefan Monnier authored
      * src/xml.c (init_libxml2_functions):
      * src/sound.c (sound_warning):
      * src/sheap.c (report_sheap_usage):
      * src/process.c (wait_reading_process_output):
      * src/msdos.c (XMenuActivate):
      * src/macros.c (Fstart_kbd_macro, Fend_kbd_macro):
      * src/keyboard.c (top_level_1):
      * src/editfns.c (Fmessage, Fmessage_box):
      * src/callint.c (Fcall_interactively):
      * src/fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
      2f73da9c
    • Eli Zaretskii's avatar
      Fix bug #13723 with redrawing vertical border in GUI sessions. · fd80c659
      Eli Zaretskii authored
       src/xdisp.c (x_draw_vertical_border): For a window that is neither
       the leftmost nor the rightmost, redraw both the left and the right
       vertical borders.
      fd80c659
    • Jan Djärv's avatar
      Move scroll-bar-adjust-thumb-portion. · fd9547e8
      Jan Djärv authored
      * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
      
      * frame.c (syms_of_frame): ... to here.
      fd9547e8
  13. 16 Feb, 2013 3 commits