Paul Eggert [Sun, 9 Mar 2014 22:38:15 +0000 (15:38 -0700)]
Fix emacsclient terminal corruption when in background.
* emacsclient.c (handle_sigcont): Check for tcgetpgrp failure.
Cancel the continue only if tty. Send SIGTTIN to the process
group, not SIGSTOP to self, as this is what the glibc manual
recommends.
(main): If tty, and if started in the background, send SIGTTIN
to the process group.
Juri Linkov [Sun, 9 Mar 2014 21:55:35 +0000 (23:55 +0200)]
* lisp/ansi-color.el (ansi-color-names-vector): Copy default colors
from `xterm-standard-colors' that look well on the default white
background (and also on the black background) to avoid illegible
color combinations like yello-on-white and white-on-white.
http://lists.gnu.org/archive/html/emacs-devel/2014-02/msg00157.html
lisp/frameset.el: Avoid computing frame-list unnecessarily.
(frameset-restore): When no frame is visible, do not generate
a list of frames, just make visible the selected one.
Eli Zaretskii [Sat, 8 Mar 2014 10:54:43 +0000 (12:54 +0200)]
Fix more failures of visual-order cursor movement under word-wrap (bug#16961).
src/xdisp.c (move_it_in_display_line_to): If word-wrap is ON, and
there's a valid wrap point in the display line, the last glyph
cannot "just barely fit" on this row, because display_line doesn't
let it. Instead, proceed as if the last glyph didn't fit, so that
we eventually back up the iterator to the wrap point. This avoids
delusional behavior of move_it_to, whereby it proceeds to the next
display line, but sets current_x to zero for all the glyphs that
without word-wrap would fit on the previous display line. One
result was that visual-order cursor movement behaved erratically
under word-wrap.
(Fmove_point_visually): Add code to find the x coordinate of the
last character before wrap point, under word-wrap on a TTY.
Eli Zaretskii [Fri, 7 Mar 2014 20:00:33 +0000 (22:00 +0200)]
Fix bug #16961 with visual-order cursor movement and word-wrap.
src/xdisp.c (Fmove_point_visually): When under word-wrap, accept
also return value of MOVE_POS_MATCH_OR_ZV from
move_it_in_display_line_to, when moving from beginning of line to
point's position.
Michael Albinus [Fri, 7 Mar 2014 14:07:12 +0000 (15:07 +0100)]
* net/tramp-sh.el (tramp-sh-handle-vc-registered): Run first pass
only when `remote-file-name-inhibit-cache' is nil.
(tramp-sh-file-name-handler): Use `tramp-error'. Simplify code.
Martin Rudalics [Thu, 6 Mar 2014 13:41:58 +0000 (14:41 +0100)]
More window code related fixes and documentation changes.
* window.c (Fother_window_for_scrolling): Check that
Vother_window_scroll_buffer is a buffer.
* window.el (fit-frame-to-buffer, fit-frame-to-buffer-margins):
Fix doc-strings.
(fit-frame-to-buffer): New argument ONLY. Remove dependency on
fit-frame-to-buffer variable. Fix doc-string.
(fit-window-to-buffer): Set ONLY argument in call of
fit-frame-to-buffer. Fix doc-string.
* frames.texi (Size and Position): Rewrite entries for
`fit-frame-to-buffer' and `fit-frame-to-buffer-margins'. Add
description for `fit-frame-to-buffer-sizes'.
* windows.texi (Resizing Windows): Add descriptions for
pixelwise resizing. Add entries for `window-resize-pixelwise'
and `fit-window-to-buffer-horizontally'. Rewrite
`fit-window-to-buffer' entry.
Michael Albinus [Thu, 6 Mar 2014 13:23:04 +0000 (14:23 +0100)]
* net/tramp.el (tramp-error): VEC-OR-PROC can be nil.
(tramp-action-password): Clear password cache if needed.
(tramp-read-passwd): Do not clear password cache.
* net/tramp-gvfs.el (tramp-gvfs-handler-askpassword): Clear password
cache unless it is the first password request.
Dmitry Antipov [Thu, 6 Mar 2014 11:18:22 +0000 (15:18 +0400)]
* xterm.c (xim_initialize): Always pass a copy of resource name
to XRegisterIMInstantiateCallback and eassert whether return
value is True. Passing copy is important because Xlib doesn't
make its own copy and resource name argument usually points to
SSDATA (Vx_resource_name), which may be changed from Lisp.
(xim_close_display): For XUnregisterIMInstantiateCallback,
always eassert return value and pass exactly the same values
as were used for XRegisterIMInstantiateCallback. Otherwise
XUnregisterIMInstantiateCallback will always fail. See Xlib
sources to check why if you are interested.
Glenn Morris [Thu, 6 Mar 2014 01:59:47 +0000 (20:59 -0500)]
* etc/tutorials/TUTORIAL: Mention electric behavior of RET.
Note that I had to change "\" to `\', because otherwise Emacs thought
that everything after that point was inside a string and so did not
indent anything.
So translators should check for anything similar in their translated
versions.
Glenn Morris [Wed, 5 Mar 2014 19:57:36 +0000 (14:57 -0500)]
* configure.ac: Tweak the "unported" error message.
"Has not been ported to" usually isn't quite correct these days.
Eg it could be an old platform that we dropped support for.
Martin Rudalics [Wed, 5 Mar 2014 13:50:48 +0000 (14:50 +0100)]
Various window code related fixes and documentation changes.
* dispnew.c (change_frame_size_1): Add new_lines instead of
new_height, the latter may be still zero if passed as such.
* window.c (Fwindow_pixel_height): Mention bottom divider in
doc-string.
* window.el (window-min-height, window-min-width): Rewrite
doc-strings.
(window-body-size): Add PIXELWISE argument to make it consistent
with its callees.
* display.texi (Window Dividers): New section.
* frames.texi (Layout Parameters): Add right-divider-width and
bottom-divider-width.
* windows.texi (Window Sizes): Redraw schematic and rewrite its
description. Rewrite descriptions of `window-total-height',
`window-total-width', `window-total-size', `window-body-height',
`window-body-width' and `window-size-fixed'. Add descriptions
for `window-pixel-height', `window-pixel-width',
`window-min-height' and `window-min-width'. Remove description
of `window-size-fixed-p' moving part of it to that of
`window-size-fixed'.
(Resizing Windows): Mention dividers when talking about minimum
sizes.
Eli Zaretskii [Tue, 4 Mar 2014 17:35:15 +0000 (19:35 +0200)]
Follow-up improvements for last change in gmalloc.c.
src/gmalloc.c (aligned_alloc): Don't allocate more memory than
needed, and don't reallocate if the initial allocation already
fits the bill. Suggested by Ken Brown <kbrown@cornell.edu>.
Stefan Monnier [Tue, 4 Mar 2014 04:03:34 +0000 (23:03 -0500)]
* lisp/electric.el (electric-indent-mode-has-been-called): Remove.
(electric-indent-mode): Fix accordingly.
* lisp/progmodes/cc-mode.el (c-initialize-cc-mode): Only hook into
electric-indent-mode-hook if we obey electric-indent-mode.
(c-basic-common-init): Use (fboundp 'electric-indent-local-mode) to
decide whether we obey electric-indent-mode.
(c-change-set-fl-decl-start, c-extend-after-change-region):
Silence warnings.
(c-electric-indent-mode-hook): Assume we do want to obey
electric-indent-mode.
* binding.el: Add comment describing why C-d binds to `delete-char'.
* lisp/simple.el (delete-forward-char): Mark as interactive-only.
* src/cmds.c (delete-char): Update docstring pointing out that the
function ignores `delete-active-region' and `overwrite-mode'.
Eli Zaretskii [Mon, 3 Mar 2014 16:46:36 +0000 (18:46 +0200)]
Fix crashes in lisp_align_free in a build with GC_MCHECK.
src/gmalloc.c (aligned_alloc): Fix adjustment of size of the
allocated buffer due to alignment.
(freehook): If the block to be freed was allocated by
'aligned_alloc', find its real pointer before calling 'free'.
(mabort) [emacs]: Call 'emacs_abort', not 'abort', to provide a
backtrace.
Dmitry Antipov [Mon, 3 Mar 2014 08:27:58 +0000 (12:27 +0400)]
Avoid crashes when X fonts are erroneously freed on reused X
'Display *' connection data (Bug#16069). Note that X font
resources still may be leaked, but currently there is no way
to completely avoid it.
* xterm.h (struct x_display_info): New member x_id. Add comments.
* xterm.c (x_display_id): New variable.
(x_term_init): Assign identifier to each opened X connection.
* xfont.c (struct xfont): New member x_display_id.
(xfont_open): Initialize it with frame's display id.
(xfont_close): Check whether font's display id matches the one
recorded for the given display. Adjust comment.
* xftfont.c (struct xftfont_info):
(xftfont_open, xftfont_close): Exactly as above with xfont stuff.
Dmitry Antipov [Mon, 3 Mar 2014 07:46:08 +0000 (11:46 +0400)]
* font.c (toplevel): Adjust comment about font cache layout.
(font_clear_cache): Fix to match real font cache layout.
Suggested by <namespace_collision@yahoo.com> in Bug#16069.
(Fframe_font_cache) [FONT_DEBUG]: New function.
(syms_of_font) [FONT_DEBUG]: Defsubr it.
lisp/icomplete.el: Miscellaneous doc fixes.
Use Icomplete everywhere instead of icomplete for consistency.
(icomplete-max-delay-chars): Fix typo.
(icomplete-mode): Use \[].
(icomplete-tidy, icomplete-exhibit): Reflow.
(icomplete-minibuffer-setup-hook, icomplete-completions):
Remove superfluous backlashes.
lisp/ido.el: Miscellaneous doc fixes.
Use Ido everywhere instead of ido or `ido' for consistency.
(ido-record-ftp-work-directories, ido-merge-ftp-work-directories)
(ido-cache-ftp-work-directory-time, ido-slow-ftp-hosts)
(ido-slow-ftp-host-regexps, ido-reread-directory): Upcase "ftp".
(ido-separator): Extract obsolescence info from docstring and declare
with make-obsolete-variable.
(ido-minibuffer-setup-hook): Simplify example.
(ido-text, ido-text-init, ido-input-stack, ido-report-no-match)
(ido-wide-find-file, ido-wide-find-dir, ido-wide-find-dir-or-delete-dir)
(ido-completion-help, ido-completing-read): Fix typos in docstrings.
(ido-everywhere): Reflow docstring.
(ido-toggle-vc): Doc fix.
(ido-switch-buffer, ido-find-file): Use tabs to improve legibility
of long list of keybindings.
Barry O'Reilly [Sun, 2 Mar 2014 17:49:02 +0000 (12:49 -0500)]
* markers.texi (Moving Marker Positions): Clarify guidance about
when to move markers and when to create a new one, as discussed at
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16818#17
Barry O'Reilly [Sun, 2 Mar 2014 17:37:32 +0000 (12:37 -0500)]
* simple.el (undo-elt-in-region): Fix buffer corruption for edge
case of undo in region.
* automated/undo-tests.el (undo-test-in-region-not-most-recent):
Add new test of undo in region.
(undo-test-in-region-eob): Add test case described at
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16411#41