From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: line-line-move-visual: was line motion problem Date: Fri, 18 Jul 2008 12:08:30 -0400 Message-ID: <87fxq7yy2p.fsf@stupidchicken.com> References: <18557.63556.231489.523637@gargle.gargle.HOWL> <5F62534C-D5CE-4364-8F73-E1AE0D61B4E2@gmail.com> <87abghlqs2.fsf@stupidchicken.com> <87hcap3ct7.fsf@stupidchicken.com> <87mykg84aj.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1216397464 24118 80.91.229.12 (18 Jul 2008 16:11:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Jul 2008 16:11:04 +0000 (UTC) Cc: David Reitter , emacs-devel@gnu.org, Stefan Monnier , raman@users.sourceforge.net To: Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 18 18:11:51 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KJsYY-000528-5m for ged-emacs-devel@m.gmane.org; Fri, 18 Jul 2008 18:11:42 +0200 Original-Received: from localhost ([127.0.0.1]:46835 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KJsXf-0002q8-BD for ged-emacs-devel@m.gmane.org; Fri, 18 Jul 2008 12:10:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KJsUg-000070-Rk for emacs-devel@gnu.org; Fri, 18 Jul 2008 12:07:42 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KJsUf-00006F-A3 for emacs-devel@gnu.org; Fri, 18 Jul 2008 12:07:42 -0400 Original-Received: from [199.232.76.173] (port=37233 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KJsUf-00006A-5i for emacs-devel@gnu.org; Fri, 18 Jul 2008 12:07:41 -0400 Original-Received: from cyd.mit.edu ([18.115.2.24]:59669 helo=cyd) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KJsUZ-0000M9-4a; Fri, 18 Jul 2008 12:07:35 -0400 Original-Received: by cyd (Postfix, from userid 1000) id 4D4D757E2D4; Fri, 18 Jul 2008 12:08:30 -0400 (EDT) In-Reply-To: (Miles Bader's message of "Fri, 18 Jul 2008 13:35:17 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:100948 Archived-At: Miles Bader writes: > Chong Yidong 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;