Dmitry Gutov [Mon, 17 Mar 2014 06:22:58 +0000 (08:22 +0200)]
Fix debbugs#16971
* lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables): Set
`comment-use-syntax' to t to avoid the unnecessary runtime check.
Set `comment-start-skip' to a simpler value that doesn't try to
check if the semicolon is escaped (this is handled by
`syntax-ppss' now).
Eli Zaretskii [Sun, 16 Mar 2014 16:28:34 +0000 (18:28 +0200)]
Fix bug #16830 with slow search for newlines in forward-line.
src/search.c (find_newline): Speed up the function when using the
newline cache, by halving the number of calls to
region_cache_forward and region_cache_backward.
Martin Rudalics [Sun, 16 Mar 2014 09:26:58 +0000 (10:26 +0100)]
Fix behavior of with-temp-buffer-window (Bug#16816, Bug#17007).
* window.el (with-temp-buffer-window): Don't make BUFFER-OR-NAME
current (Bug#16816, Bug#17007).
(with-current-buffer-window): New macro doing the same as
`with-temp-buffer-window' but with BUFFER-OR-NAME current.
* help.el (help-print-return-message): Warn in doc-string to not
use this in `with-help-window'.
(describe-bindings-internal): Call `describe-buffer-bindings'
from within help buffer. See Juanma's scenario in (Bug#16816).
(with-help-window): Update doc-string.
* dired.el (dired-mark-pop-up):
* files.el (save-buffers-kill-emacs):
* register.el (register-preview): Use `with-current-buffer-window'
instead of `with-temp-buffer-window'.
* display.texi (Temporary Displays): Rewrite descriptions of
`with-output-to-temp-buffer' and `with-temp-buffer-window'.
* help.texi (Help Functions): Rewrite description of
`with-help-window'.
lisp/term/ns-win.el (x-command-line-resources): Rename from ns-... version.
(ns-initialize-window-system): Use it. It is set in term/common-win.el
from the -xrm command line argument, but in the Nextstep port its value
is irrelevant because nsfns.m:Fx_open_connection ignores it for now.
Martin Rudalics [Fri, 14 Mar 2014 10:38:46 +0000 (11:38 +0100)]
Document pixelwise frame resizing and fix related bug on Windows.
* w32term.c (x_set_window_size): When frame-resize-pixelwise is
nil, always resize character wise to avoid potential loss of the
mode line (Bug#16923 related).
* display.texi (Temporary Displays): Say that
with-temp-buffer-window makes its buffer current.
* frames.texi (Size and Position): Describe new option
`frame-resize-pixelwise'. Rewrite descriptions of
`set-frame-size', `set-frame-height' and `set-frame-width'.
Paul Eggert [Thu, 13 Mar 2014 05:27:28 +0000 (22:27 -0700)]
* mule.texi (International, Language Environments): Update
the list of language environments to what Emacs currently
supports. Add the full list to the index. Suggest C-h L for
details rather than trying to give very brief details here.
Martin Rudalics [Wed, 12 Mar 2014 07:28:23 +0000 (08:28 +0100)]
Two adjustments in window/frame resizing.
* frame.c (x_set_frame_parameters): Always calculate new sizes
pixelwise to avoid potential loss when rounding.
* window.el (fit-frame-to-buffer): Get maximum width from
display's width instead of height.
Glenn Morris [Wed, 12 Mar 2014 07:14:30 +0000 (00:14 -0700)]
Some doc edits related to desktop-restore-frames
* doc/emacs/misc.texi (Saving Emacs Sessions):
Be briefer about desktop's handling of frames.
The manual does not need to mention every option, nor should
it just repeat the doc-strings.
Paul Eggert [Wed, 12 Mar 2014 07:03:40 +0000 (00:03 -0700)]
* mule.texi (International Chars): Adjust C-u C-x = description.
Change it to match Emacs's current behavior. Also, change the
example to use ê instead of À, as the isolated grave accent in the
latter's decomposition listing was confusingly transliterated to
left single quote in the PDF version of the manual.
Glenn Morris [Wed, 12 Mar 2014 06:52:54 +0000 (23:52 -0700)]
* doc/misc/octave-mode.texi (Using Octave Mode): Remove outdated stuff
about RET and indentation. E.g., octave-reindent-then-newline-and-indent
was removed three years ago.
When you delete commands, please use grep to check for references to them.
Stefan Monnier [Tue, 11 Mar 2014 17:10:07 +0000 (13:10 -0400)]
* lisp/simple.el (set-mark): Ensure mark-active is nil if the mark is nil.
Deactivate the mark before setting it to nil.
(activate-mark): Do nothing if region is already active.
Stefan Monnier [Tue, 11 Mar 2014 01:22:24 +0000 (21:22 -0400)]
* lisp/emacs-lisp/nadvice.el (advice--make-1): Fix autoloading avoidance.
(advice-add): Add a :advice--pending marker, so advice--make-1 knows
when the advice is pending.
(advice-remove): Remove this marker when not needed any more.
lisp/frameset.el: Separate frame reusing from cleaning up.
* lisp/desktop.el (desktop-restore-forces-onscreen)
(desktop-restore-reuses-frames): Use non-keyword values.
(desktop-restore-frameset): Use CLEANUP-FRAMES arg of frameset-restore.
* lisp/frameset.el: Separate options for reusing frames and cleaning up.
(frameset--reuse-list): Remove definition; declare.
(frameset--action-map): Declare.
(frameset--find-frame-if): Doc fix.
(frameset--restore-frame): Cache frame action.
(frameset-restore): New keyword arg CLEANUP-FRAMES, allows to select
how to clean up the frame list after restoring. Remove cleaning
options from REUSE-FRAMES. Change all keyword values to symbols.
(frameset--jump-to-register): Simplify by using CLEANUP-FRAMES.
Paul Eggert [Mon, 10 Mar 2014 18:12:25 +0000 (11:12 -0700)]
Fix "\" problem in tutorials by using natural-language quotes.
* tutorials/TUTORIAL, tutorials/TUTORIAL.cs, tutorials/TUTORIAL.eo:
* tutorials/TUTORIAL.es, tutorials/TUTORIAL.it, tutorials/TUTORIAL.ja:
* tutorials/TUTORIAL.ko, tutorials/TUTORIAL.nl, tutorials/TUTORIAL.pl:
* tutorials/TUTORIAL.pt_BR, tutorials/TUTORIAL.ro:
* tutorials/TUTORIAL.ru, tutorials/TUTORIAL.sk, tutorials/TUTORIAL.sv:
* tutorials/TUTORIAL.th:
Avoid using ` for natural-language quotes. Instead, work around
the problem with "\" by using non-" quotation marks appropriate
for the natural language in question, e.g., «...» for Spanish.
For English “...” could be used, but use '...' instead so that
TUTORIAL continues to be encoded in ASCII.
Eli Zaretskii [Mon, 10 Mar 2014 17:26:45 +0000 (19:26 +0200)]
Fix an obscure bug in fstatat on Windows 9X.
src/w32.c (fstatat): Don't add an extra slash if the argument ends
with a slash: this fails the subsequent call to stat_worker on
Windows 9X. Reported by oslsachem <oslsachem@gmail.com>.
Michael Albinus [Mon, 10 Mar 2014 13:36:39 +0000 (14:36 +0100)]
* net/tramp-sh.el (tramp-open-connection-setup-interactive-shell):
Do not add `nil' to the environment, when there's no remote `locale'.
(tramp-find-inline-encoding): Check, that the remote host has
installed perl, before sending scripts.
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.