diff options
| author | Eli Zaretskii | 2011-09-18 22:02:17 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2011-09-18 22:02:17 +0300 |
| commit | 3e62b7e0044df3960bc6b2b70814c6ca4831d7fb (patch) | |
| tree | 693a9bc560fb300b275f4d3dd221883080077ca0 /src | |
| parent | d473dce83055a56fed39293a0ab5e9023b955862 (diff) | |
| download | emacs-3e62b7e0044df3960bc6b2b70814c6ca4831d7fb.tar.gz emacs-3e62b7e0044df3960bc6b2b70814c6ca4831d7fb.zip | |
Fix bug #9545 with crash in Dired when $ is pressed.
src/xdisp.c (reseat_at_next_visible_line_start): Undo the change made on
2011-09-17 that saved paragraph information and restored it after
the call to `reseat'.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 3 | ||||
| -rw-r--r-- | src/xdisp.c | 43 |
2 files changed, 4 insertions, 42 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index b81c5cf9792..1e110cc5139 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -8,6 +8,9 @@ | |||
| 8 | (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the | 8 | (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the |
| 9 | column is beyond frame width: don't subtract 1 "pixel" when | 9 | column is beyond frame width: don't subtract 1 "pixel" when |
| 10 | computing width of the stretch. | 10 | computing width of the stretch. |
| 11 | (reseat_at_next_visible_line_start): Undo the change made on | ||
| 12 | 2011-09-17 that saved paragraph information and restored it after | ||
| 13 | the call to `reseat'. (Bug#9545) | ||
| 11 | 14 | ||
| 12 | 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 15 | 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
| 13 | 16 | ||
diff --git a/src/xdisp.c b/src/xdisp.c index 97d59644b15..d58eea538f5 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -5722,10 +5722,6 @@ reseat_at_next_visible_line_start (struct it *it, int on_newline_p) | |||
| 5722 | { | 5722 | { |
| 5723 | int newline_found_p, skipped_p = 0; | 5723 | int newline_found_p, skipped_p = 0; |
| 5724 | struct bidi_it bidi_it_prev; | 5724 | struct bidi_it bidi_it_prev; |
| 5725 | int new_paragraph IF_LINT (= 0), first_elt IF_LINT (= 0); | ||
| 5726 | int disp_prop IF_LINT (= 0); | ||
| 5727 | EMACS_INT paragraph_end IF_LINT (= 0), disp_pos IF_LINT (= 0); | ||
| 5728 | bidi_dir_t paragraph_dir IF_LINT (= 0); | ||
| 5729 | 5725 | ||
| 5730 | newline_found_p = forward_to_next_line_start (it, &skipped_p, &bidi_it_prev); | 5726 | newline_found_p = forward_to_next_line_start (it, &skipped_p, &bidi_it_prev); |
| 5731 | 5727 | ||
| @@ -5742,23 +5738,6 @@ reseat_at_next_visible_line_start (struct it *it, int on_newline_p) | |||
| 5742 | forward_to_next_line_start (it, &skipped_p, &bidi_it_prev); | 5738 | forward_to_next_line_start (it, &skipped_p, &bidi_it_prev); |
| 5743 | } | 5739 | } |
| 5744 | 5740 | ||
| 5745 | /* Under bidi iteration, save the attributes of the paragraph we are | ||
| 5746 | in, to be restored after the call to `reseat' below. That's | ||
| 5747 | because `reseat' overwrites them, which requires unneeded and | ||
| 5748 | potentially expensive backward search for paragraph beginning. | ||
| 5749 | This search is unnecessary because we will be `reseat'ed to the | ||
| 5750 | same position where we are now, for which we already have all the | ||
| 5751 | information we need in the bidi iterator. */ | ||
| 5752 | if (it->bidi_p && !STRINGP (it->string)) | ||
| 5753 | { | ||
| 5754 | new_paragraph = it->bidi_it.new_paragraph; | ||
| 5755 | first_elt = it->bidi_it.first_elt; | ||
| 5756 | paragraph_end = it->bidi_it.separator_limit; | ||
| 5757 | paragraph_dir = it->bidi_it.paragraph_dir; | ||
| 5758 | disp_pos = it->bidi_it.disp_pos; | ||
| 5759 | disp_prop = it->bidi_it.disp_prop; | ||
| 5760 | } | ||
| 5761 | |||
| 5762 | /* Position on the newline if that's what's requested. */ | 5741 | /* Position on the newline if that's what's requested. */ |
| 5763 | if (on_newline_p && newline_found_p) | 5742 | if (on_newline_p && newline_found_p) |
| 5764 | { | 5743 | { |
| @@ -5798,30 +5777,10 @@ reseat_at_next_visible_line_start (struct it *it, int on_newline_p) | |||
| 5798 | IT_BYTEPOS (*it) = it->bidi_it.bytepos; | 5777 | IT_BYTEPOS (*it) = it->bidi_it.bytepos; |
| 5799 | } | 5778 | } |
| 5800 | reseat (it, it->current.pos, 0); | 5779 | reseat (it, it->current.pos, 0); |
| 5801 | if (it->bidi_p) | ||
| 5802 | { | ||
| 5803 | it->bidi_it.new_paragraph = new_paragraph; | ||
| 5804 | it->bidi_it.first_elt = first_elt; | ||
| 5805 | it->bidi_it.separator_limit = paragraph_end; | ||
| 5806 | it->bidi_it.paragraph_dir = paragraph_dir; | ||
| 5807 | it->bidi_it.disp_pos = disp_pos; | ||
| 5808 | it->bidi_it.disp_prop = disp_prop; | ||
| 5809 | } | ||
| 5810 | } | 5780 | } |
| 5811 | } | 5781 | } |
| 5812 | else if (skipped_p) | 5782 | else if (skipped_p) |
| 5813 | { | 5783 | reseat (it, it->current.pos, 0); |
| 5814 | reseat (it, it->current.pos, 0); | ||
| 5815 | if (it->bidi_p && !STRINGP (it->string)) | ||
| 5816 | { | ||
| 5817 | it->bidi_it.new_paragraph = new_paragraph; | ||
| 5818 | it->bidi_it.first_elt = first_elt; | ||
| 5819 | it->bidi_it.separator_limit = paragraph_end; | ||
| 5820 | it->bidi_it.paragraph_dir = paragraph_dir; | ||
| 5821 | it->bidi_it.disp_pos = disp_pos; | ||
| 5822 | it->bidi_it.disp_prop = disp_prop; | ||
| 5823 | } | ||
| 5824 | } | ||
| 5825 | 5784 | ||
| 5826 | CHECK_IT (it); | 5785 | CHECK_IT (it); |
| 5827 | } | 5786 | } |