Improve string search in `flyspell-word-search-*`. (Bug#16800)
* flyspell.el (flyspell-duplicate-distance): Limit default search
distance for duplicated words to 40000.
(flyspell-word-search-backward, flyspell-word-search-forward):
Search as full word with defined casechars, not as substring.
Eli Zaretskii [Tue, 10 Feb 2015 16:26:23 +0000 (18:26 +0200)]
Fix invocation of commands whose file name includes extension (Bug#19817)
nt/cmdproxy.c (get_next_token): Don't make backslashes disappear
without a trace when they are not followed by a quote.
(search_dir): Support searching programs whose file name already
has an arbitrary extension.
(main): When passing a command line to the shell, use cmd.exe
rules for quoting command-line tail.
Juri Linkov [Tue, 10 Feb 2015 00:38:09 +0000 (02:38 +0200)]
Better support for the case of typing RET on the prompt in comint.
* lisp/comint.el (comint-get-old-input-default): Go to the field end
when comint-use-prompt-regexp is nil.
(comint-line-beginning-position): Check if point is already
on the prompt before searching for the prompt when
comint-use-prompt-regexp is non-nil.
Eli Zaretskii [Sun, 8 Feb 2015 16:17:40 +0000 (18:17 +0200)]
Fix handling of frame color parameters in TTY sessions (Bug#19802)
src/xfaces.c (map_tty_color): Use assoc_no_quit instead of
assq_no_quit to fetch color definition by its string name.
lisp/frame.el (frame-notice-user-settings): Refresh the value of
frame parameters after calling tty-handle-reverse-video. Call
face-set-after-frame-default with the actual parameters, to avoid
resetting colors back to unspecified.
(set-background-color, set-foreground-color): Pass the selected
color to face-set-after-frame-default.
Eli Zaretskii [Thu, 5 Feb 2015 17:07:15 +0000 (19:07 +0200)]
Fix vertical-motion and posn-at-point when word-wrap is on (Bug#19769)
src/xdisp.c (move_it_in_display_line_to): Handle the case where the
last character of a screen line is whitespace, and we are under
word-wrap with overflow-newline-into-fringe turned on.
Juri Linkov [Thu, 5 Feb 2015 00:52:41 +0000 (02:52 +0200)]
Better multi-line input support in comint.el
Revert the change of comint-line-beginning-position callers,
and modify comint-line-beginning-position instead.
* lisp/comint.el (comint-history-isearch-search)
(comint-history-isearch-message, comint-history-isearch-wrap):
Use comint-line-beginning-position instead of field-beginning.
(comint-send-input): Use either end-of-line or field-end
depending on comint-use-prompt-regexp.
(comint-line-beginning-position): Search backward
for comint-prompt-regexp if comint-use-prompt-regexp is non-nil.
Use field-beginning instead of line-beginning-position
if comint-use-prompt-regexp is nil.
Eli Zaretskii [Tue, 3 Feb 2015 18:52:18 +0000 (20:52 +0200)]
A more thorough fix for bug#19307
src/xdisp.c (handle_stop, handle_single_display_spec)
(next-element_from_image): Don't reset the
ignore_overlay_strings_at_pos_p flag here.
(next_element_from_buffer): Reset ignore_overlay_strings_at_pos_p
here.
(next_overlay_string): Set ignore_overlay_strings_at_pos_p here,
after we've exhausted all the overlay strings at the current
position.
Eli Zaretskii [Mon, 2 Feb 2015 16:15:13 +0000 (18:15 +0200)]
Fix redrawing of mode lines when exposed (Bug#19721)
src/dispnew.c (adjust_glyph_matrix): Set the update_mode_line flag
of the window whose current glyph matrix was resized, which
disables the mode-line row as side effect.
src/xdisp.c (redisplay_window): Don't avoid redisplay of a window
whose update_mode_line flag is set.
Tassilo Horn [Thu, 29 Jan 2015 14:51:40 +0000 (15:51 +0100)]
Restore XEmacs compatibility
* textmodes/reftex-vars.el (featurep): Conditionalize value of
reftex-label-regexps in order to stay compatible with XEmacs 25
which has no explicitly numbered groups in regexps (bug#19714).
Eli Zaretskii [Wed, 28 Jan 2015 17:42:28 +0000 (19:42 +0200)]
Improve the fix for bug #19701
src/dired.c (directory_files_internal, file_name_completion)
[WINDOWSNT]: Signal an error when errno is set non-zero by
'readdir', regardless of its value.
src/w32.c (sys_readdir): Set errno to ENOENT when the directory
doesn't exist and to EACCES when it's not accessible to the
current user. Set errno to zero when FindNextFile exhausts the
directory, so that callers don't interpret that as an error and
don't signal a file-error.
(open_unc_volume): Set errno to ENOENT if WNetOpenEnum fails.
Tassilo Horn [Wed, 28 Jan 2015 09:32:50 +0000 (10:32 +0100)]
Fix issues with BibTeX entries containing ")".
* textmodes/reftex.el (reftex-syntax-table-for-bib): Give ( and )
punctuation syntax since to allow bibtex fields with values such
as {Test 1) and 2)} (bug#19205, bug#19707).
(reftex--prepare-syntax-tables): New function.
(reftex-mode): Use it.
Eli Zaretskii [Tue, 27 Jan 2015 19:02:13 +0000 (21:02 +0200)]
Signal a file-error from directory-files on MS-Windows (Bug#19701)
src/dired.c (directory_files_internal) [WINDOWSNT]: If readdir
returns NULL and errno is ENOTDIR, behave as if opendir failed to
open the directory.
src/w32.c (sys_readdir): If FindFirstFile fails because the
directory doesn't exist, set errno to ENOTDIR.
python.el: New non-global state dependent indentation engine.
Fixes: debbugs:18319 Fixes: debbugs:19595
* lisp/progmodes/python.el (python-syntax-comment-or-string-p): Accept
PPSS as argument.
(python-syntax-closing-paren-p): New function.
(python-indent-current-level)
(python-indent-levels): Mark obsolete.
(python-indent-context): Return more context cases.
(python-indent--calculate-indentation)
(python-indent--calculate-levels): New functions.
(python-indent-calculate-levels): Use them.
(python-indent-calculate-indentation, python-indent-line):
(python-indent-line-function): Rewritten to use new API.
(python-indent-dedent-line): Simplify logic.
(python-indent-dedent-line-backspace): Use `unless`.
(python-indent-toggle-levels): Delete function.
Daniel Koning [Wed, 21 Jan 2015 08:01:30 +0000 (09:01 +0100)]
Prevent artist-mode from creating runaway timers (Bug#6130).
* subr.el (posnp): Correct docstring of `posnp'.
(posn-col-row): Make it work with all mouse position objects.
* textmodes/artist.el (artist-mouse-draw-continously): Cancel
timers if an error occurs during continuous drawing. (Bug#6130)
* commands.texi (Drag Events, Motion Events, Event Examples)
(Accessing Mouse): Describe actual range of values that mouse
position objects can have.
configure.ac (HAVE_W32): Abort with error message if
--without-toolkit-scroll-bars was specified. See
http://lists.gnu.org/archive/html/emacs-devel/2015-01/msg00525.html
for the details.
Eli Zaretskii [Wed, 14 Jan 2015 18:14:02 +0000 (20:14 +0200)]
Fix support of non-ASCII frame titles on MS-Windows (Bug#19590)
src/w32fns.c (w32_set_title_bar_text): New function, including
support for titles with non-ASCII characters outside of the
current system codepage.
(x_set_name, x_set_title): Use it.
Juri Linkov [Mon, 29 Dec 2014 00:52:38 +0000 (02:52 +0200)]
More fixes to support multi-line search in comint
* lisp/comint.el (comint-history-isearch-message): Use field-beginning
instead of comint-line-beginning-position - that's more fixes for
http://lists.gnu.org/archive/html/emacs-devel/2014-12/msg00305.html
(comint-history-isearch-message): Fix args of isearch-message-prefix.
Juri Linkov [Fri, 5 Dec 2014 23:55:20 +0000 (01:55 +0200)]
Better support for multi-line shell input.
* lisp/comint.el (comint-history-isearch-search)
(comint-history-isearch-wrap): Use field-beginning instead of
comint-line-beginning-position.
(comint-send-input): Go to the end of the field instead of the end
of the line to accept whole multi-line input.
http://lists.gnu.org/archive/html/emacs-devel/2014-12/msg00305.html
Eli Zaretskii [Thu, 8 Jan 2015 14:04:46 +0000 (16:04 +0200)]
Fix line-move-visual's following of column in R2L lines (backport from trunk).
src/simple.el (line-move-visual): When converting X pixel coordinate
to temporary-goal-column, adjust the value for right-to-left
screen lines. This fixes vertical-motion, next/prev-line, etc.
src/dispnew.c (buffer_posn_from_coords): Fix the value of the column
returned for right-to-left screen lines. (Before the change on
2014-12-30, the incorrectly-computed X pixel coordinate concealed
this bug.)
Eli Zaretskii [Mon, 5 Jan 2015 15:42:55 +0000 (17:42 +0200)]
Fix assertion violations in try_window_id (Bug#19511)
src/xdisp.c (move_it_to, try_cursor_movement): Don't use the window
end information if the window_end_valid flag is unset.
(try_window_id): If the call to display_line invalidated the
window end information, give up the try_window_id optimization.
Eli Zaretskii [Sun, 4 Jan 2015 18:30:16 +0000 (20:30 +0200)]
More doc fixes for bug#19502 -- make documentation less X-specific.
doc/lispref/frames.texi (Display Feature Testing): Make the description of
x-server-version and x-server-vendor less X-specific.
Make doc strings on X and w32 identical.
src/w32fns.c (Fx_server_version, Fx_server_vendor): Doc fix.
src/xfns.c (Fx_server_version, Fx_server_vendor): Doc fix.