From: Paul Eggert Date: Sun, 6 Mar 2011 19:53:35 +0000 (-0800) Subject: * xdisp.c (Fcurrent_bidi_paragraph_direction): Simplify slightly; this X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~605^2^2~82 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9f36b9fd38fb4bde2ac4664f05a65e2dd973add2;p=emacs.git * xdisp.c (Fcurrent_bidi_paragraph_direction): Simplify slightly; this avoids a gcc -Wuninitialized diagnostic. --- diff --git a/src/ChangeLog b/src/ChangeLog index 94ce2a9f6ce..8582bf67e04 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -2,6 +2,8 @@ * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff. Add a FIXME comment, since the code still doesn't look right. + (Fcurrent_bidi_paragraph_direction): Simplify slightly; this + avoids a gcc -Wuninitialized diagnostic. current_column: Now returns EMACS_INT, fixing some iftc. * bytecode.c (Fbyte_code): Don't cast current_column () to int. diff --git a/src/xdisp.c b/src/xdisp.c index 44a317b5785..174312ccab3 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -17912,16 +17912,13 @@ paragraphs, text begins at the right margin and is read from right to left. See also `bidi-paragraph-direction'. */) (Lisp_Object buffer) { - struct buffer *buf; - struct buffer *old; + struct buffer *buf = current_buffer; + struct buffer *old = buf; - if (NILP (buffer)) - buf = current_buffer; - else + if (! NILP (buffer)) { CHECK_BUFFER (buffer); buf = XBUFFER (buffer); - old = current_buffer; } if (NILP (BVAR (buf, bidi_display_reordering))) @@ -17938,8 +17935,7 @@ See also `bidi-paragraph-direction'. */) EMACS_INT bytepos = BUF_PT_BYTE (buf); int c; - if (buf != current_buffer) - set_buffer_temp (buf); + set_buffer_temp (buf); /* bidi_paragraph_init finds the base direction of the paragraph by searching forward from paragraph start. We need the base direction of the current or _previous_ paragraph, so we need @@ -17967,8 +17963,7 @@ See also `bidi-paragraph-direction'. */) itb.paragraph_dir = NEUTRAL_DIR; bidi_paragraph_init (NEUTRAL_DIR, &itb, 1); - if (buf != current_buffer) - set_buffer_temp (old); + set_buffer_temp (old); switch (itb.paragraph_dir) { case L2R: