all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Chong Yidong <cyd@stupidchicken.com>
To: Miles Bader <miles@gnu.org>
Cc: David Reitter <david.reitter@gmail.com>,
	emacs-devel@gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>,
	raman@users.sourceforge.net
Subject: Re: line-line-move-visual: was line motion problem
Date: Fri, 18 Jul 2008 12:08:30 -0400	[thread overview]
Message-ID: <87fxq7yy2p.fsf@stupidchicken.com> (raw)
In-Reply-To: <buo8wvzx116.fsf@dhapc248.dev.necel.com> (Miles Bader's message of "Fri, 18 Jul 2008 13:35:17 +0900")

Miles Bader <miles.bader@necel.com> writes:

> Chong Yidong <cyd@stupidchicken.com> writes:
>> Since no one has commented, I've gone ahead and checked in
>> visual-line-mode into CVS.  Problem reports would be welcome.
>
> Seems to work pretty well...
>
> C-k acts a bit strangely, I think because it doesn't delete the
> whitespace at the end of the killed "line"; the result is that the
> cursor always ends up on the end of the previous "line" after using it.
>
> Also, what about dealing with fringe continuation glyphs?  I understand
> that some people want them, even in visual-line-mode, but I think many
> won't want them, so it would be good if there were an easy setting that
> would cause visual-line-mode suppress them.

The following simple patch implements a new variable,
`word-wrap-disable-fringe-indicators', that hides the continuation
indicators when word-wrap is on.  (The variable name is a little long
but I can't think of anything else.)

WDYT?

*** trunk/src/fringe.c.~1.53.~	2008-07-15 14:47:33.000000000 -0400
--- trunk/src/fringe.c	2008-07-18 12:03:55.000000000 -0400
***************
*** 39,44 ****
--- 39,48 ----
  
  Lisp_Object Voverflow_newline_into_fringe;
  
+ /* Non-nil means suppress continuation glyphs for word-wrap.  */
+ 
+ Lisp_Object Vword_wrap_disable_fringe_indicators;
+ 
  /* List of known fringe bitmap symbols.
  
     The fringe bitmap number is stored in the `fringe' property on
***************
*** 958,963 ****
--- 962,968 ----
    Lisp_Object ind = Qnil;
  #define MAX_BITMAP_CACHE (8*4)
    int bitmap_cache[MAX_BITMAP_CACHE];
+   int show_left_continuation, show_right_continuation;
  
    if (w->pseudo_window_p)
      return 0;
***************
*** 1058,1063 ****
--- 1063,1076 ----
     : (bitmap_cache[cache*4+2+partial_p] =			\
        get_logical_fringe_bitmap (w, which, 1, partial_p)))
  
+   show_left_continuation
+     = (NILP (XBUFFER (w->buffer)->word_wrap)
+        || NILP (Vword_wrap_disable_fringe_indicators)
+        || EQ (Vword_wrap_disable_fringe_indicators, Qright));
+   show_right_continuation
+     = (NILP (XBUFFER (w->buffer)->word_wrap)
+        || NILP (Vword_wrap_disable_fringe_indicators)
+        || EQ (Vword_wrap_disable_fringe_indicators, Qleft));
  
    for (y = 0, rn = 0;
         y < yb && rn < nrows;
***************
*** 1089,1095 ****
  		: LEFT_FRINGE (2, Qtop, 0));
        else if (row->indicate_eob_p && EQ (boundary_bot, Qleft))
  	left = LEFT_FRINGE (3, Qbottom, row->ends_at_zv_p);
!       else if (MATRIX_ROW_CONTINUATION_LINE_P (row))
  	left = LEFT_FRINGE (4, Qcontinuation, 0);
        else if (row->indicate_empty_line_p && EQ (empty_pos, Qleft))
  	left = LEFT_FRINGE (5, Qempty_line, 0);
--- 1102,1109 ----
  		: LEFT_FRINGE (2, Qtop, 0));
        else if (row->indicate_eob_p && EQ (boundary_bot, Qleft))
  	left = LEFT_FRINGE (3, Qbottom, row->ends_at_zv_p);
!       else if (MATRIX_ROW_CONTINUATION_LINE_P (row)
! 	       && show_left_continuation)
  	left = LEFT_FRINGE (4, Qcontinuation, 0);
        else if (row->indicate_empty_line_p && EQ (empty_pos, Qleft))
  	left = LEFT_FRINGE (5, Qempty_line, 0);
***************
*** 1116,1122 ****
  		 : RIGHT_FRINGE (2, Qtop, 0));
        else if (row->indicate_eob_p && EQ (boundary_bot, Qright))
  	right = RIGHT_FRINGE (3, Qbottom, row->ends_at_zv_p);
!       else if (row->continued_p)
  	right = RIGHT_FRINGE (4, Qcontinuation, 0);
        else if (row->indicate_top_line_p && EQ (arrow_top, Qright))
  	right = RIGHT_FRINGE (6, Qup, 0);
--- 1130,1137 ----
  		 : RIGHT_FRINGE (2, Qtop, 0));
        else if (row->indicate_eob_p && EQ (boundary_bot, Qright))
  	right = RIGHT_FRINGE (3, Qbottom, row->ends_at_zv_p);
!       else if (row->continued_p
! 	       && show_right_continuation)
  	right = RIGHT_FRINGE (4, Qcontinuation, 0);
        else if (row->indicate_top_line_p && EQ (arrow_top, Qright))
  	right = RIGHT_FRINGE (6, Qup, 0);
***************
*** 1649,1654 ****
--- 1664,1681 ----
  If nil, also continue lines which are exactly as wide as the window.  */);
    Voverflow_newline_into_fringe = Qt;
  
+   DEFVAR_LISP ("word-wrap-disable-fringe-indicators",
+ 	       &Vword_wrap_disable_fringe_indicators,
+     doc: /* *If non-nil, suppress fringe indicators when word-wrap is on.
+ This variable takes effect only if `word-wrap' is non-nil.
+ If its value is nil, the usual fringe indicators associated with
+ continuation lines are displayed for wrapped lines.
+ If its value is `left', the left fringe indicator is not displayed.
+ If its value is `right', the right fringe indicator is not displayed.
+ Any other non-nil value means neither fringe indicator is displayed.
+ This variable does not affect other types of fringe indicators.  */);
+   Vword_wrap_disable_fringe_indicators = Qt;
+ 
    DEFVAR_LISP ("fringe-bitmaps", &Vfringe_bitmaps,
      doc: /* List of fringe bitmap symbols.  */);
    Vfringe_bitmaps = Qnil;




  parent reply	other threads:[~2008-07-18 16:08 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-16 13:31 line-line-move-visual: was line motion problem T. V. Raman
2008-07-16 16:26 ` Stefan Monnier
2008-07-16 16:37   ` David Reitter
2008-07-16 16:47     ` Chong Yidong
2008-07-16 18:26       ` Chong Yidong
2008-07-17 23:44         ` Chong Yidong
2008-07-18  4:35           ` Miles Bader
2008-07-18 14:16             ` Stefan Monnier
2008-07-18 14:24               ` David Reitter
2008-07-18 15:21                 ` Stefan Monnier
2008-07-18 15:30                   ` Dan Nicolaescu
2008-07-18 15:50                     ` Stefan Monnier
2008-07-19  0:10                     ` Miles Bader
2008-07-21 15:49                     ` David Reitter
2008-07-21 16:01                       ` Chong Yidong
2008-07-21 17:31                         ` Miles Bader
2008-07-21 19:24                           ` Stefan Monnier
2008-07-21 20:18                             ` Miles Bader
2008-07-21 17:36                         ` David Reitter
2008-07-21 16:09                       ` Dan Nicolaescu
2008-07-21 17:30                         ` David Reitter
2008-07-21 17:33                         ` David Reitter
2008-07-21 23:05                       ` Vinicius Jose Latorre
2008-07-22  1:31                         ` Chong Yidong
2008-07-22  1:58                           ` Vinicius Jose Latorre
2008-07-22  2:20                             ` David Reitter
2008-07-23  1:53                               ` Vinicius Jose Latorre
2008-07-23  2:53                                 ` David Reitter
2008-07-23  3:19                                   ` Vinicius Jose Latorre
2008-07-23 10:58                                     ` David Reitter
2008-07-24  3:37                                       ` Vinicius Jose Latorre
     [not found]                                         ` <9B9CE742-E040-4484-9BDC-593DE5B6B037@gmail.com>
2008-07-26  0:15                                           ` Vinicius Jose Latorre
2008-07-26  0:32                                             ` Drew Adams
2008-07-26  2:11                                               ` Vinicius Jose Latorre
2008-07-26  2:39                                                 ` Drew Adams
2008-07-26 13:46                                                   ` Vinicius Jose Latorre
2008-07-26 10:44                                             ` David Reitter
2008-07-26 12:59                                               ` Vinicius Jose Latorre
2008-07-25 13:41                     ` T. V. Raman
2008-07-18 21:07                   ` David Reitter
2008-07-18 22:57                     ` Jason Rumney
2008-07-18 16:08             ` Chong Yidong [this message]
2008-07-18 18:36               ` Stefan Monnier
2008-07-20  3:34                 ` Chong Yidong
2008-07-20  3:43                 ` Chong Yidong
2008-07-20  4:15                   ` Miles Bader
2008-07-21  4:09                     ` Chong Yidong
2008-07-28 13:45           ` Juri Linkov
2008-07-28 14:11             ` Miles Bader
2008-07-28 14:35               ` Juri Linkov
2008-07-28 14:12             ` Chong Yidong
2008-07-25 13:39     ` T. V. Raman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fxq7yy2p.fsf@stupidchicken.com \
    --to=cyd@stupidchicken.com \
    --cc=david.reitter@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=miles@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=raman@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.