* src/fileio.c: Revert 2013-01-31 change.
(choose_write_coding_system): No longer callable from Lisp.
Move last piece back here from Fwrite_region.
(Fwrite_region, syms_of_fileio): Update for above changes.
* test/automated/data/files-bug18141.el.gz: New file.
* test/automated/files.el (files-test-bug-18141-file):
New variable and test.
Paul Eggert [Sun, 10 Aug 2014 20:40:57 +0000 (13:40 -0700)]
Don't prevent random file systems from being unmounted.
This fix relies on having the 'fchdir' function, and on having
"." be searchable (or at least readable, on platforms lacking O_SEARCH),
but that's good enough to handle the vast majority of cases and the
remaining folks can just live with the annoyance of file systems
that occasionally can't be unmounted.
* configure.ac (fchdir): New function to check for.
* lib/save-cwd.c: Copy from gnulib, except omit the part that
allocates memory, since that can cause problems in Emacs.
* lib/save-cwd.h: Copy from gnulib.
* calendar/icalendar.el (icalendar-export-sexp-enumerate-all)
(icalendar-export-sexp-enumeration-days): New
(icalendar-export-region): `icalendar--convert-to-ical' now
returns a cons cell or a list of cons cells.
(icalendar--convert-to-ical): Take care of
`icalendar-export-sexp-enumerate-all'. Return (a list of) cons
cells.
(icalendar--convert-ordinary-to-ical),
(icalendar--convert-weekly-to-ical),
(icalendar--convert-yearly-to-ical),
(icalendar--convert-block-to-ical),
(icalendar--convert-block-to-ical),
(icalendar--convert-float-to-ical),
(icalendar--convert-cyclic-to-ical),
(icalendar--convert-anniversary-to-ical): Return cons cell.
(icalendar--convert-sexp-to-ical): Enumerate evaluated sexp
entries. Return (list of) cons cells.
Martin Rudalics [Sun, 10 Aug 2014 08:26:28 +0000 (10:26 +0200)]
Fix handling of menu bar line on TTY frames (Bug#18136) (Bug#18196).
* dispnew.c (handle_window_change_signal):
* keyboard.c (Fsuspend_emacs): Call change_frame_size with
frame's menu bar lines subtracted from height.
* frame.c (frame_inhibit_resize): Inhibit resizing of TTY
frames.
(adjust_frame_size): Count in menu bar when setting FrameRows.
(make_terminal_frame): When setting up the frame's lines and
text height don't count in the menu bar.
(Fmake_terminal_frame): Call adjust_frame_size with menu bar
lines subtracted from height.
(do_switch_frame): Set tty's FrameRows to number of total lines
of frame.
(Fframe_pixel_height, Fframe_pixel_width): If no window system
is used, return total number of lines and columns.
* menu.c (emulate_dialog_with_menu): Use FRAME_TOTAL_LINES instead
of FRAME_LINES.
* term.c (OUTPUT, tty_set_terminal_modes)
(tty_set_terminal_window, tty_set_scroll_region)
(tty_clear_to_end, tty_write_glyphs, tty_write_glyphs_with_face)
(tty_ins_del_lines, tty_menu_display, tty_menu_activate): Use
FRAME_TOTAL_LINES instead of FRAME_LINES.
(Fresume_tty): Use FRAME_TOTAL_LINES instead of FRAME_LINES.
Call change_frame_size with frame's menu bar lines subtracted
from height.
* w32console.c (w32con_clear_to_end, w32con_clear_frame)
(w32con_ins_del_lines): Use FRAME_TOTAL_LINES instead of
FRAME_LINES.
Alan Mackenzie [Sat, 9 Aug 2014 20:54:04 +0000 (20:54 +0000)]
progmodes/cc-fonts.el (c-font-lock-declarators): Remove check for
top-level that can cause unacceptable slow-down in scrolling.
See email Subject: Huge {...} blocks in C/C++ again, from Dmitry Antipov
from 2013-10-14 in emacs-devel.
Martin Rudalics [Sat, 9 Aug 2014 16:50:13 +0000 (18:50 +0200)]
In display-buffer-below-selected reuse window below selected if it shows buffer already (Bug#18181).
* window.el (display-buffer-below-selected): Restore original
behavior if buffer is already displayed in the window below the
selected one (Bug#18181).
Martin Rudalics [Sat, 9 Aug 2014 11:12:45 +0000 (13:12 +0200)]
Second attempt to fix some doc-strings in window.c.
* window.c (Fwindow_new_total, Fwindow_new_normal)
(Fwindow_new_pixel, Fset_window_new_pixel)
(Fset_window_new_total, Fset_window_new_normal): Second attempt
to fix the doc-strings of these functions. See:
http://lists.gnu.org/archive/html/bug-gnu-emacs/2014-08/msg00287.html
Paul Eggert [Sat, 9 Aug 2014 06:57:59 +0000 (23:57 -0700)]
Merge from gnulib.
This incorporates:
2014-08-07 getdtablesize: fall back on sysconf (_SC_OPEN_MAX)
2014-08-05 sys_select: fix FD_ZERO problem on Solaris 10
* lib/getdtablesize.c, lib/sys_select.in.h: Update from gnulib.
ibuffer.el (ibuffer-mode-map): Use toggle button for
`ibuffer-auto-mode' menu entry.
(ibuffer-mode-hook): Add `ibuffer-auto-mode' customization option.
Reuben Thomas [Thu, 7 Aug 2014 11:49:36 +0000 (12:49 +0100)]
Remove remaining mentions of VMS as a host
* notes/exit-value: Remove specific discussion of VMS.
* doc/emacs/programs.texi (Program Modes): Don't advertise VMS DCL support
any more.
* doc/misc/ediff.texi (Merging and diff3): Don't mention lack of support
for VMS diff, we no longer support VMS.
* lisp/progmodes/ada-mode.el:
* lisp/net/tramp.el (tramp-handle-file-symlink-p):
* lisp/net/tramp-ftp.el (tramp-ftp-file-name-handler): Remove a comment
about VMS, which we no longer support.
* lisp/progmodes/ada-xref.el (ada-xref-current): Remove mention of VMS,
and fix a FIXME, using convert-standard-filename in place of
removed ada-convert-file-name.
* lisp/url/url-handlers.el: Remove a comment about VMS, which we no longer
support.
Reuben Thomas [Thu, 7 Aug 2014 10:15:52 +0000 (11:15 +0100)]
Fix a few ``MS-DOG''s overlooked in the previous commit.
* README: ``MSDOG'' becomes ``MS-DOS''.
* lisp/arc-mode.el: Fix a couple of ``MS-DOG''s missed in the previous
commit.
* lisp/file-mode.el: ditto.
* src/editfns.c: Fix a couple of ``MS-DOG''s missed in the previous commit.
* src/xfaces.c: ditto.
Eric Abrahamsen [Wed, 6 Aug 2014 00:33:37 +0000 (00:33 +0000)]
* gnus-sum.el (gnus-summary-expire-articles): Functions registered to
the gnus-summary-article-expire-hook should be told where the function
is going. In particular, the Gnus registry might want to know.
Eli Zaretskii [Tue, 5 Aug 2014 13:34:06 +0000 (16:34 +0300)]
Fix bug #18195 with inaccurate results from window-screen-lines.
lisp/simple.el (default-line-height): A floating-point value of
line-spacing means a fraction of the default frame font's height,
not of the font currently used by the 'default' face. Truncate
the pixel value, like the display engine does.
(window-screen-lines): Use window-inside-pixel-edges for
determining the window height in pixels.
Martin Rudalics [Tue, 5 Aug 2014 08:25:28 +0000 (10:25 +0200)]
Don't redeem scroll bars that have been turned off.
* w32term.c (w32_redeem_scroll_bar):
* xterm.c (XTredeem_scroll_bar): Revert part of last change by
not redeeming scroll bars that have been turned off.
Dmitry Antipov [Tue, 5 Aug 2014 06:04:38 +0000 (10:04 +0400)]
Fix bug with uninitialized undo list of an indirect buffer (Bug#18180).
* buffer.c (Fmake_indirect_buffer): Initialize undo list with the
base buffer's undo list.
Dmitry Antipov [Tue, 5 Aug 2014 05:43:35 +0000 (09:43 +0400)]
* keyboard.c (safe_run_hooks): Follow the convenient style to bind
inhibit-quit to t and pass 2 args to safe_run_hook_funcall. See
<http://lists.gnu.org/archive/html/emacs-devel/2014-08/msg00077.html>.
(safe_run_hook_funcall): Adjust accordingly.
Martin Rudalics [Mon, 4 Aug 2014 16:47:27 +0000 (18:47 +0200)]
Fix scroll bar handling for non-toolkit builds.
* frame.h (FRAME_HAS_HORIZONTAL_SCROLL_BARS): Condition
correctly according to toolkit used.
* frame.c (make_initial_frame, make_terminal_frame)
(x_set_horizontal_scroll_bars, x_set_scroll_bar_height)
(Vdefault_frame_horizontal_scroll_bars): Correctly condition
assignments according to presence of toolkit scrollbars.
* window.h (WINDOW_HAS_HORIZONTAL_SCROLL_BAR): Condition
correctly according to toolkit used.
* window.c (set_window_scroll_bars): Set horizontal scroll bar
only if toolkit supports it.
* w32term.c (w32_redeem_scroll_bar): Always redeem scroll bar if
present.
* xterm.c (x_scroll_bar_create): Initialize horizontal slot for
non-toolkit builds.
(XTredeem_scroll_bar): Always redeem scroll bar if present.
Dmitry Antipov [Mon, 4 Aug 2014 04:03:31 +0000 (08:03 +0400)]
* keyboard.c (safe_run_hook_funcall): Avoid consing around
Vinhibit_quit and prefer internal_condition_case_n to pass args.
(safe_run_hooks_error, safe_run_hooks_1): Adjust accordingly.
(safe_run_hooks): Remove comment which is not relevant any more.
Paul Eggert [Sun, 3 Aug 2014 15:38:52 +0000 (08:38 -0700)]
Don't mishandle year-9999 dates.
* lisp/calendar/parse-time.el (parse-time-rules):
Allow years up to most-positive-fixnum.
* lisp/calendar/time-date.el (date-to-time):
Pass "Specified time is not representable" errors through.
* lisp/url/url-cookie.el (url-cookie-expired-p): Treat out-of-range
expiration dates as if they were far in the future.
* src/editfns.c (decode_time_components): Store an invalid timespec
on overflow, instead of returning false, so that the caller can
distinguish overflow from other errors.
(lisp_time_argument, lisp_seconds_argument): If the time is out
of range, signal a time overflow instead of an invalid time spec.
* src/keyboard.c (decode_timer): Treat time overflow like other
timespec errors.
Dmitry Antipov [Sun, 3 Aug 2014 07:19:43 +0000 (11:19 +0400)]
Fix bug with an attempt to select uninitialized frame (Bug#18161).
* xfns.c (Fx_create_frame): Move call to change_frame_size to
a section where Lisp evaluation is disabled. This way a pointer
to uninitialized frame is not accessible from Lisp, which becomes
critical if following call to x_figure_window_size throws an error.
Paul Eggert [Sat, 2 Aug 2014 22:58:09 +0000 (15:58 -0700)]
Fix bug with clang + directory_files_internal + GC.
* src/dired.c (directory_files_internal): Use a volatile variable
to prevent the compiler from optimizing away all copies of a local.
I wonder how many other GC-related bugs like this lurk elsewhere?
Paul Eggert [Sat, 2 Aug 2014 21:31:18 +0000 (14:31 -0700)]
Avoid 100% CPU utilization on ssh session exit.
* src/xterm.h (struct x_display_info): New member 'connection'.
* src/xterm.c (x_term_init, x_delete_terminal): Set and use it,
so that x_delete_terminal has a file descriptor to pass to
delete_keyboard_wait_descriptor.
Alan Mackenzie [Sat, 2 Aug 2014 18:52:48 +0000 (18:52 +0000)]
Fix confusion in C++ file caused by comma in "= {1,2},".
cc-engine.el (c-beginning-of-statement-1): In checking for a statement
boundary marked by "}", check there's no "=" before the "{".
(c-guess-basic-syntax CASE 9B): Call c-beginning-of-statement with
non-nil `comma-delim' argument.
cc-fonts.el (c-font-lock-declarators): Parse an initializer expression
more accurately.
Alan Mackenzie [Sat, 2 Aug 2014 16:42:29 +0000 (16:42 +0000)]
Correct loop termination condition in c-syntactic-skip-backward.
progmodes/cc-engine.el (c-syntactic-skip-backward): Correct for the
situation where, after moving back out of a literal, skip-chars-backward
doesn't move further, yet checks have still to be done.
Eli Zaretskii [Fri, 1 Aug 2014 09:39:04 +0000 (12:39 +0300)]
Fix display of R2L lines when the last character fits only partially.
See http://lists.gnu.org/archive/html/emacs-devel/2014-07/msg00476.html
for the details.
src/xdisp.c (extend_face_to_end_of_line): If the last glyph of an
R2L row is visible only partially, give the row a negative x
offset.
(display_line): Fix the calculation of the glyph whose pixel width
is used to decide whether the last produced glyph fits on the
line. When the last glyph fits only partially, give the row a
negative x offset.
Dmitry Antipov [Fri, 1 Aug 2014 06:52:02 +0000 (10:52 +0400)]
* atimer.c (toplevel) [HAVE_TIMERFD]: Include errno.h.
(timerfd_callback): Ignore weird events with no data. Add tight
assertions and comments.
(init_atimer) [HAVE_TIMERFD]: Add environment variable to optionally
disabletimerfd-based timer. Use TFD_NONBLOCK for timer descriptor.
* lisp/progmodes/python.el: Shell output capture enhancements.
(python-shell-accept-process-output): New function.
(inferior-python-mode)
(python-shell-send-setup-code): Use it.
Paul Eggert [Thu, 31 Jul 2014 20:17:01 +0000 (13:17 -0700)]
Simplify timerfd configuration and fix some minor glitches.
* configure.ac (HAVE_TIMERFD): Define only if TFD_CLOEXEC works,
since the code leaked file descriptors to children when !TFD_CLOEXEC.
(HAVE_TIMERFD_CLOEXEC): Remove; no longer used.
* m4/clock_time.m4 (gl_CLOCK_TIME): Don't check for clock_getres.
This reverts the previous change to this file, so it matches
gnulib again.
* src/atimer.c (TIMERFD_CREATE_FLAGS): Remove; we now assume TFD_CLOEXEC.
(alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
Fall back on timer_create if timerfd_create fails at runtime.
(resolution) [HAVE_CLOCK_GETRES]: Remove; we now rely on the
kernel primitives to do resolution. All uses removed.
(timerfd) [!HAVE_TIMERFD]: Define to be -1, for convenience.
(turn_on_atimers): Clear timer_create-based timers too,
for consistency.