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.
Eli Zaretskii [Tue, 29 Jul 2014 08:19:29 +0000 (11:19 +0300)]
Fix hscroll of R2L lines that begin with a TAB or another wide glyph.
src/xdisp.c (append_stretch_glyph): In a R2L glyph row, decrease the
pixel width of the first glyph that is hscrolled from display.
(display_line): In R2L glyph rows, don't give a negative offset to
row->x when the first glyph begins before first_visible_x.
Eli Zaretskii [Mon, 28 Jul 2014 13:09:02 +0000 (16:09 +0300)]
Fix another part of bug #18035 with redisplay of line-prefix and linum-mode.
src/xdisp.c (display_line): If called with iterator set up to write
to a marginal area, delay the call to handle_line_prefix until we
switch back to the text area.
Stephen Berman [Fri, 25 Jul 2014 16:01:05 +0000 (18:01 +0200)]
Fix code and doc involving marked items.
* todo-mode.texi (Marked Items): Correct omission of item deletion
from commands applying to both todo and done items.
* calendar/todo-mode.el: Fix handling of marked items and make
minor code improvements.
(todo-edit-item): If there are marked items, ensure user can only
invoke editing commands that work with marked items.
(todo-edit-item--text): When there are marked items, make it a
noop if invoked with point not on an item; otherwise, ensure it
applies only to item at point.
(todo-item-undone): If there are marked not-done items, return
point to its original position before signaling user error.
(todo--user-error-if-marked-done-item): New function.
(todo-edit-item--header, todo-edit-item--diary-inclusion)
(todo-item-done): Use it.
* lisp/progmodes/prolog.el (prolog-mode-keybindings-edit):
Replace missing `switch-to-prolog' with `run-prolog'.
(switch-to-prolog): Define as (obsolete) alias, as in 23.4.
* lisp/progmodes/python.el:
(python-shell-completion-setup-code): New value supporting iPython.
(python-shell-completion-string-code): New value supporting iPython.
(python-shell-completion-get-completions): Use them.
(python-shell-completion-module-string-code): Make obsolete.
(python-shell-prompt-input-regexps)
(python-shell-prompt-output-regexps): Add safeguard for ipdb.
(python-shell-output-filter): Fix comment typo.
* nsterm.m (applicationDidFinishLaunching:): Call
antialiasThresholdDidChange, register for antialias changes.
(antialiasThresholdDidChange:): New method for EmacsApp.
* lisp/progmodes/python.el:
(python-shell-interpreter-interactive-arg)
(python-shell-prompt-detect-enabled)
(python-shell-prompt-detect-failure-warning)
(python-shell-prompt-input-regexps)
(python-shell-prompt-output-regexps): New vars.
(python-shell-prompt-calculated-input-regexp)
(python-shell-prompt-calculated-output-regexp): New vars.
(python-shell-get-process-name)
(python-shell-internal-get-process-name)
(python-shell-output-filter)
(python-shell-completion-get-completions): Use them.
(python-shell-prompt-detect)
(python-shell-prompt-validate-regexps): New functions.
(python-shell-prompt-set-calculated-regexps): New function.
(inferior-python-mode): Use it. Also honor overriden
python-shell-interpreter and python-shell-interpreter-args.
(python-shell-make-comint): Honor overriden
python-shell-interpreter and python-shell-interpreter-args.
(python-shell-get-or-create-process): Make it testable by allowing
to call run-python non-interactively.
(python-util-valid-regexp-p): New function.
(python-shell-prompt-regexp, python-shell-prompt-block-regexp)
(python-shell-prompt-output-regexp)
(python-shell-prompt-pdb-regexp): Use it as defcustom :safe.
* test/automated/python-tests.el (python-shell-make-comint-1):
(python-shell-make-comint-2): Fix indentation.
(python-shell-make-comint-3)
(python-shell-make-comint-4): New tests.
(python-shell-get-or-create-process-1): Fix test.
(python-shell-get-or-create-process-2)
(python-shell-get-or-create-process-3): New tests.
(python-shell-internal-get-or-create-process-1): Fix test.
(python-shell-prompt-detect-1): New test.
(python-shell-prompt-detect-2): New test. (Bug#17370)
(python-shell-prompt-detect-3)
(python-shell-prompt-detect-4)
(python-shell-prompt-detect-5)
(python-shell-prompt-detect-6)
(python-shell-prompt-validate-regexps-1)
(python-shell-prompt-validate-regexps-2)
(python-shell-prompt-validate-regexps-3)
(python-shell-prompt-validate-regexps-4)
(python-shell-prompt-validate-regexps-5)
(python-shell-prompt-validate-regexps-6)
(python-shell-prompt-validate-regexps-7)
(python-shell-prompt-set-calculated-regexps-1)
(python-shell-prompt-set-calculated-regexps-2)
(python-shell-prompt-set-calculated-regexps-3)
(python-shell-prompt-set-calculated-regexps-4)
(python-shell-prompt-set-calculated-regexps-5)
(python-shell-prompt-set-calculated-regexps-6)
(python-util-valid-regexp-p-1): New tests.
Eli Zaretskii [Thu, 17 Jul 2014 15:37:48 +0000 (18:37 +0300)]
Fix setting up coding-systems for clipboard access on MS-Windows and MS-DOS.
src/w32select.c (setup_windows_coding_system): Apply
CODING_ANNOTATION_MASK to the common_flags member of struct
coding_system. Reported by Martin Rudalics <rudalics@gmx.at>.
src/w16select.c (Fw16_get_clipboard_data): Apply
CODING_ANNOTATION_MASK to the common_flags member of struct
coding_system.
Eli Zaretskii [Thu, 17 Jul 2014 15:25:21 +0000 (18:25 +0300)]
Fix assertion violation when restoring hscrolled window configurations.
src/xdisp.c (hscroll_window_tree): Don't try hscrolling windows whose cursor
row has zero buffer position as their start position. Reported by
Martin Rudalics <rudalics@gmx.at>.
Eli Zaretskii [Thu, 17 Jul 2014 15:17:52 +0000 (18:17 +0300)]
Fix part of bug #18035 with overlay strings on invisible text.
src/xdisp.c (init_iterator): Initialize it->stop_charpos to the
buffer position where we are to start the iteration.
(handle_invisible_prop): Record in it->stop_charpos the position
where the invisible text ends.
Eli Zaretskii [Wed, 16 Jul 2014 18:39:35 +0000 (21:39 +0300)]
Fix bug #18036 with infloop in redisplay with huge fringes.
src/xdisp.c (move_it_vertically_backward, move_it_by_lines): Prevent
infinite looping in redisplay when display lines don't have enough
space to display even a single character.
Eli Zaretskii [Sun, 13 Jul 2014 14:49:59 +0000 (17:49 +0300)]
Fix bug #17986 with infloop in redisplay when default-directory is nil.
src/xdisp.c (decode_mode_spec): Call file-remote-p on the current
buffer's default-directory only if it is a string.
lisp/bindings.el (mode-line-remote): If default-directory is not a
string, don't call file-remote-p on it; instead state in the
help-echo that it is nil.
Eli Zaretskii [Sat, 12 Jul 2014 09:25:29 +0000 (12:25 +0300)]
Document the behavior of file selection dialogs on Windows 7 (bug #17950).
etc/PROBLEMS: Mention the problem from bug #17950.
src/w32fns.c (Fx_file_dialog): Mention in the doc string the
behavior on Windows 7 and later when the function is repeatedly
invoked with the same value of DIR.
src/xfns.c (Fx_file_dialog) [USE_MOTIF, USE_GTK]: Update the doc
string to match the one in w32fns.c.
* lisp/progmodes/python.el
(python-rx-constituents): Add dedenter and block-ender.
(python-indent-dedenters, python-indent-block-enders): Delete.
(python-indent-context): Return new case for dedenter-statement.
(python-indent-calculate-indentation): Handle new case.
(python-indent-calculate-levels): Fix levels calculation for
dedenter statements.
(python-indent-post-self-insert-function): Fix colon handling.
(python-info-dedenter-opening-block-message): New function.
(python-indent-line): Use it.
(python-info-closing-block)
(python-info-closing-block-message): Remove.
(python-info-dedenter-opening-block-position)
(python-info-dedenter-opening-block-positions)
(python-info-dedenter-statement-p): New functions.
Juri Linkov [Tue, 8 Jul 2014 08:55:00 +0000 (11:55 +0300)]
* lisp/facemenu.el (list-colors-print): In help-echo format use %.2f
instead of %d because now HSV values are floating-point components
between 0.0 and 1.0.
Stephen Berman [Sun, 6 Jul 2014 20:28:38 +0000 (22:28 +0200)]
* calendar/todo-mode.el: Fix wrong-type-argument error when
marking multiple consecutive items.
(todo-toggle-mark-item): Don't try to mark the empty lines at the
end of the todo and done items sections. Note in doc string that
items marked by passing a numeric prefix argument can include the
last todo and first done items.
(todo-mark-category): Don't try to mark the empty line between the
todo and done items sections.
Eli Zaretskii [Sat, 5 Jul 2014 08:24:07 +0000 (11:24 +0300)]
A better fix for bug #17942.
src/xdisp.c (pos_visible_p): If CHARPOS is at beginning of window,
and there is a display property at that position, don't call
move_it_to to move to a position before window start.
Stefan Monnier [Sat, 5 Jul 2014 02:17:14 +0000 (22:17 -0400)]
* src/syntax.c (find_defun_start): Try the cache even
if !open_paren_in_column_0_is_defun_start.
(back_comment): If find_defun_start was pessimistic, use the
scan_sexps_forward result to improve the cache.
Stephen Berman [Fri, 4 Jul 2014 19:09:29 +0000 (21:09 +0200)]
* todo-mode.texi (Levels of Organization): Comment out statement
that Emacs recognizes todo files by their extension, since this
feature has been removed due to bug#17482.
Stephen Berman [Fri, 4 Jul 2014 15:53:25 +0000 (17:53 +0200)]
* calendar/todo-mode.el: Fix two bugs. Shorten Commentary and
refer to the Todo mode Info manual. Update the comment on
requiring cl-lib.
(todo-find-filtered-items-file): Add todo-prefix overlays.
(todo-filter-items): Reorder a let-bound variable to avoid a
wrong-type-argument error on canceling the file choice dialog.
Jan Djärv [Fri, 4 Jul 2014 15:15:02 +0000 (17:15 +0200)]
Backport from trunk.
* xfns.c (create_frame_xic): Pass XNStatusAttributes to XCreateIC
only if xic_style calls for it. This change allows Emacs to work
with ibus. Also, don't leak resources if create_frame_xic fails,
and stop caching xic_style across different displays.
(supported_xim_styles): Make const.
(best_xim_style): Remove first parameter: it's always just
supported_xim_styles. Change to look at supported_xim_styles
directly.
Eli Zaretskii [Fri, 4 Jul 2014 13:22:04 +0000 (16:22 +0300)]
Fix bug #17905 with display of point in partially visible line at end of window.
src/xdisp.c (redisplay_window): If redisplay of a window ends up
with point in a partially visible line at end of the window, make
sure the amended position of point actually has smaller Y
coordinate; if not, give up and scroll the display.
src/window.c (window_scroll_pixel_based): When point ends up at the
last fully visible line, don't let move_it_to stop at the left
edge of the line and dupe us into thinking point is inside the
scroll margin.
Eli Zaretskii [Fri, 4 Jul 2014 07:35:22 +0000 (10:35 +0300)]
Minor updates in etc/TODO and etc/NEWS.
etc/TODO: Remove items that were already done. Rearrange a few
items that are closely related. Update a couple of items with new
information.
etc/NEWS: Mention 'network-interface-list' and 'network-interface-info'
being available on MS-Windows.
Eli Zaretskii [Tue, 1 Jul 2014 17:07:24 +0000 (20:07 +0300)]
Fix bug #17892 with mode/header line and display margins.
src/dispnew.c (prepare_desired_row): Accept 2 additional arguments:
the window whose glyph row is being prepared and a flag whether it
is for mode/header line. Make sure the glyph row's marginal areas
are in sync with what the window wants.
src/xdisp.c (display_line, display_mode_line): Call
prepare_desired_row with additional arguments, as appropriate.
src/dispextern.h (prepare_desired_row): Adjust prototype.
src/window.h: Improve commentary of the marginal columns.
* lisp/progmodes/python.el (python-indent-post-self-insert-function):
Enhancements to electric indentation behavior inside
parens.
* test/automated/python-tests.el
(python-tests-self-insert): New function.
(python-triple-quote-pairing): Use it.
(python-util-forward-comment-1): New test. (Bug#17658)
Stephen Berman [Fri, 27 Jun 2014 15:15:30 +0000 (17:15 +0200)]
* calendar/todo-mode.el (todo-set-top-priorities): Fix logic to
account for file-wide setting of todo-top-priorities-overrides.
Make code a bit cleaner.