unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* line-line-move-visual: was line motion problem
@ 2008-07-16 13:31 T. V. Raman
  2008-07-16 16:26 ` Stefan Monnier
  0 siblings, 1 reply; 52+ messages in thread
From: T. V. Raman @ 2008-07-16 13:31 UTC (permalink / raw)
  To: emacs-devel

Would it be possible to make line-move-visual user customizable?

At present the change its default setting of T causes to cursor
motion is a drastic change to how Emacs has always behaved.

-- 
Best Regards,
--raman

      
Email:  raman@users.sf.net
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: tv.raman.tv@gmail.com
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman 
IRC:    irc://irc.freenode.net/#emacs




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  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
  0 siblings, 1 reply; 52+ messages in thread
From: Stefan Monnier @ 2008-07-16 16:26 UTC (permalink / raw)
  To: raman; +Cc: emacs-devel

> Would it be possible to make line-move-visual user customizable?
> At present the change its default setting of T causes to cursor
> motion is a drastic change to how Emacs has always behaved.

Yes, it should be a define-minor-mode (with name ending in "-mode").
Can someone make this change?


        Stefan




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-16 16:26 ` Stefan Monnier
@ 2008-07-16 16:37   ` David Reitter
  2008-07-16 16:47     ` Chong Yidong
  2008-07-25 13:39     ` T. V. Raman
  0 siblings, 2 replies; 52+ messages in thread
From: David Reitter @ 2008-07-16 16:37 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: emacs-devel, raman

[-- Attachment #1: Type: text/plain, Size: 726 bytes --]

On 16 Jul 2008, at 12:26, Stefan Monnier wrote:
>
> Yes, it should be a define-minor-mode (with name ending in "-mode").
> Can someone make this change?


What do we conclude from the discussion related to this?

My understanding is that we were going to have visual navigation  
(arrow keys, C-n, C-p) default to on, and leave default behavior of C- 
a and C-e as is, with some code (from the visual-line-mode that I  
posted) to optionally remap C-a and C-e to visual navigation as it is  
sensible in text modes.

Should this be one minor mode that defaults to on, or should we have  
two minor modes then?
Also, should C-a and C-e default to the visual mode in all text modes?  
(Would that just go in text-mode-hook?)




[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-16 16:37   ` David Reitter
@ 2008-07-16 16:47     ` Chong Yidong
  2008-07-16 18:26       ` Chong Yidong
  2008-07-25 13:39     ` T. V. Raman
  1 sibling, 1 reply; 52+ messages in thread
From: Chong Yidong @ 2008-07-16 16:47 UTC (permalink / raw)
  To: David Reitter; +Cc: raman, Stefan Monnier, emacs-devel

David Reitter <david.reitter@gmail.com> writes:

> On 16 Jul 2008, at 12:26, Stefan Monnier wrote:
>>
>> Yes, it should be a define-minor-mode (with name ending in "-mode").
>> Can someone make this change?
>
> What do we conclude from the discussion related to this?
>
> My understanding is that we were going to have visual navigation
> (arrow keys, C-n, C-p) default to on, and leave default behavior of C- 
> a and C-e as is, with some code (from the visual-line-mode that I
> posted) to optionally remap C-a and C-e to visual navigation as it is
> sensible in text modes.
>
> Should this be one minor mode that defaults to on, or should we have
> two minor modes then?
> Also, should C-a and C-e default to the visual mode in all text modes?
> (Would that just go in text-mode-hook?)

I think we should have a defcustom that sets the default value of
line-move-visual, and a minor mode (I guess it'll be called
visual-line-mode, since there doesn't seem to be any better name) that
provides the rest of the visual editing features.

The minor mode would then turn on word-wrap and line-move-visual in
buffers where it is activated.




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-16 16:47     ` Chong Yidong
@ 2008-07-16 18:26       ` Chong Yidong
  2008-07-17 23:44         ` Chong Yidong
  0 siblings, 1 reply; 52+ messages in thread
From: Chong Yidong @ 2008-07-16 18:26 UTC (permalink / raw)
  To: David Reitter; +Cc: emacs-devel, Stefan Monnier, raman

Chong Yidong <cyd@stupidchicken.com> writes:

> I think we should have a defcustom that sets the default value of
> line-move-visual, and a minor mode (I guess it'll be called
> visual-line-mode, since there doesn't seem to be any better name) that
> provides the rest of the visual editing features.

The following patch implements this approach.  I've taken bits from
visual-line.el, and re-written other bits to make use of the new
features of vertical-motion in Emacs 23.

Could people try it out and see if it DTRT?

As Richard suggested, it binds M-[ and M-] to logical previous-line and
next-line.  I don't know, OTOH, where a logical kill-line should be
bound (visual-line.el bound it to C-K, but this doesn't seem optimal,
since OTOH we try not to use upcased keybindings where possible).


*** trunk/lisp/simple.el.~1.934.~	2008-07-15 14:47:32.000000000 -0400
--- trunk/lisp/simple.el	2008-07-16 14:23:26.000000000 -0400
***************
*** 3906,3916 ****
    :type 'boolean
    :group 'editing-basics)
  
! (defvar line-move-visual t
    "When non-nil, `line-move' moves point by visual lines.
  This movement is based on where the cursor is displayed on the
  screen, instead of relying on buffer contents alone.  It takes
! into account variable-width characters and line continuation.")
  
  ;; Returns non-nil if partial move was done.
  (defun line-move-partial (arg noerror to-end)
--- 3906,3919 ----
    :type 'boolean
    :group 'editing-basics)
  
! (defcustom line-move-visual t
    "When non-nil, `line-move' moves point by visual lines.
  This movement is based on where the cursor is displayed on the
  screen, instead of relying on buffer contents alone.  It takes
! into account variable-width characters and line continuation."
!   :type 'boolean
!   :group 'editing-basics)
! (make-variable-buffer-local 'line-move-visual)
  
  ;; Returns non-nil if partial move was done.
  (defun line-move-partial (arg noerror to-end)
***************
*** 4017,4022 ****
--- 4020,4027 ----
    (let ((inhibit-point-motion-hooks t)
  	(opoint (point))
  	(orig-arg arg))
+     (if (floatp temporary-goal-column)
+ 	(setq temporary-goal-column (truncate temporary-goal-column)))
      (unwind-protect
  	(progn
  	  (if (not (memq last-command '(next-line previous-line)))
***************
*** 4365,4371 ****
--- 4370,4499 ----
      )
    nil)
  \f
+ ;;; Editing based on visual lines, as opposed to logical lines.
+ 
+ (defun end-of-visual-line (&optional n)
+   "Move point to end of current visual line.
+ With argument N not nil or 1, move forward N - 1 visual lines first.
+ If point reaches the beginning or end of buffer, it stops there.
+ To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
+   (interactive "^p")
+   (or n (setq n 1))
+   (if (/= n 1)
+       (let ((line-move-visual t))
+ 	(line-move (1- n) t)))
+   (vertical-motion (cons (window-width) 0)))
+ 
+ (defun beginning-of-visual-line (&optional n)
+   "Move point to beginning of current visual line.
+ With argument N not nil or 1, move forward N - 1 visual lines first.
+ If point reaches the beginning or end of buffer, it stops there.
+ To ignore intangibility, bind `inhibit-point-motion-hooks' to t."
+   (interactive "^p")
+   (or n (setq n 1))
+   (if (/= n 1)
+       (let ((line-move-visual t))
+ 	(line-move (1- n) t)))
+   (vertical-motion 0))
+ 
+ (defun kill-visual-line (&optional arg)
+   "Kill the rest of the visual line.
+ If there are only whitespace characters there, kill through the
+ newline as well.
+ 
+ With prefix argument, kill that many lines from point.
+ Negative arguments kill lines backward.
+ With zero argument, kill the text before point on the current line.
+ 
+ When calling from a program, nil means \"no arg\",
+ a number counts as a prefix arg.
+ 
+ If `kill-whole-line' is non-nil, then this command kills the whole line
+ including its terminating newline, when used at the beginning of a line
+ with no argument.  As a consequence, you can always kill a whole line
+ by typing \\[beginning-of-line] \\[kill-line].
+ 
+ If you want to append the killed line to the last killed text,
+ use \\[append-next-kill] before \\[kill-line].
+ 
+ If the buffer is read-only, Emacs will beep and refrain from deleting
+ the line, but put the line in the kill ring anyway.  This means that
+ you can use this command to copy text from a read-only buffer.
+ \(If the variable `kill-read-only-ok' is non-nil, then this won't
+ even beep.)"
+   (interactive "P")
+   (let ((opoint (point))
+ 	(line-move-visual t)
+ 	end)
+     ;; It is better to move point to the other end of the kill before
+     ;; killing.  That way, in a read-only buffer, point moves across
+     ;; the text that is copied to the kill ring.  The choice has no
+     ;; effect on undo now that undo records the value of point from
+     ;; before the command was run.
+     (if arg
+ 	(vertical-motion (prefix-numeric-value arg))
+       (if (eobp)
+ 	  (signal 'end-of-buffer nil))
+       (setq end (save-excursion
+ 		  (end-of-visual-line) (point)))
+       (if (or (save-excursion
+ 		;; If trailing whitespace is visible,
+ 		;; don't treat it as nothing.
+ 		(unless show-trailing-whitespace
+ 		  (skip-chars-forward " \t" end))
+ 		(= (point) end))
+ 	      (and kill-whole-line (bolp)))
+ 	  (line-move 1)
+ 	(goto-char end)))
+     (kill-region opoint (point))))
+ 
+ (defun next-logical-line (&optional arg try-vscroll)
+   "Move cursor vertically down ARG lines.
+ This is identical to `previous-line', except that it always moves
+ by logical lines instead of visual lines, ignoring the value of
+ `line-move-visual'."
+   (interactive "^p\np")
+   (let ((line-move-visual nil))
+     (with-no-warnings
+       (next-line arg try-vscroll))))
+ 
+ (defun previous-logical-line (&optional arg try-vscroll)
+   "Move cursor vertically up ARG lines.
+ This is identical to `previous-line', except that it always moves
+ by logical lines instead of visual lines, ignoring the value of
+ `line-move-visual'."
+   (interactive "^p\np")
+   (let ((line-move-visual nil))
+     (with-no-warnings
+       (previous-line arg try-vscroll))))
  
+ (defvar visual-line-mode-map
+   (let ((map (make-sparse-keymap)))
+     (define-key map [remap kill-line] 'kill-visual-line)
+     (define-key map [remap move-beginning-of-line] 'beginning-of-visual-line)
+     (define-key map [remap move-end-of-line]  'end-of-visual-line)
+     (define-key map "\M-[" 'previous-logical-line)
+     (define-key map "\M-]" 'next-logical-line)
+     map))
+ 
+ (define-minor-mode visual-line-mode
+   "Define key binding for visual line moves."
+   :keymap visual-line-mode-map
+   :group 'convenience
+   (if visual-line-mode
+       (progn
+ 	(setq line-move-visual t
+ 	      word-wrap t))
+     (kill-local-variable 'line-move-visual)
+     (kill-local-variable 'word-wrap)))
+ 
+ (defun turn-on-visual-line-mode ()
+   (visual-line-mode 1))
+ 
+ (define-globalized-minor-mode global-visual-line-mode
+   visual-line-mode turn-on-visual-line-mode
+   :lighter " vl")
+ \f
  (defun scroll-other-window-down (lines)
    "Scroll the \"other window\" down.
  For more details, see the documentation for `scroll-other-window'."




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-16 18:26       ` Chong Yidong
@ 2008-07-17 23:44         ` Chong Yidong
  2008-07-18  4:35           ` Miles Bader
  2008-07-28 13:45           ` Juri Linkov
  0 siblings, 2 replies; 52+ messages in thread
From: Chong Yidong @ 2008-07-17 23:44 UTC (permalink / raw)
  To: David Reitter; +Cc: raman, Stefan Monnier, emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

> The following patch implements this approach.  I've taken bits from
> visual-line.el, and re-written other bits to make use of the new
> features of vertical-motion in Emacs 23.
>
> Could people try it out and see if it DTRT?

Since no one has commented, I've gone ahead and checked in
visual-line-mode into CVS.  Problem reports would be welcome.




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-17 23:44         ` Chong Yidong
@ 2008-07-18  4:35           ` Miles Bader
  2008-07-18 14:16             ` Stefan Monnier
  2008-07-18 16:08             ` Chong Yidong
  2008-07-28 13:45           ` Juri Linkov
  1 sibling, 2 replies; 52+ messages in thread
From: Miles Bader @ 2008-07-18  4:35 UTC (permalink / raw)
  To: Chong Yidong; +Cc: David Reitter, emacs-devel, Stefan Monnier, raman

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.

Thanks,

-Miles

-- 
Education, n. That which discloses to the wise and disguises from the foolish
their lack of understanding.




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-18  4:35           ` Miles Bader
@ 2008-07-18 14:16             ` Stefan Monnier
  2008-07-18 14:24               ` David Reitter
  2008-07-18 16:08             ` Chong Yidong
  1 sibling, 1 reply; 52+ messages in thread
From: Stefan Monnier @ 2008-07-18 14:16 UTC (permalink / raw)
  To: Miles Bader; +Cc: David Reitter, Chong Yidong, emacs-devel, raman

> 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.

I don't know how many people actually want them in visual-line-mode
(I'd like a fringe item at a hard newline, but until this is
implemented the next best thing is a display-table element for \n).


        Stefan




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-18 14:16             ` Stefan Monnier
@ 2008-07-18 14:24               ` David Reitter
  2008-07-18 15:21                 ` Stefan Monnier
  0 siblings, 1 reply; 52+ messages in thread
From: David Reitter @ 2008-07-18 14:24 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Chong Yidong, raman, emacs-devel, Miles Bader

[-- Attachment #1: Type: text/plain, Size: 2161 bytes --]

On 18 Jul 2008, at 10:16, Stefan Monnier wrote:

>> 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.
>
> I don't know how many people actually want them in visual-line-mode
> (I'd like a fringe item at a hard newline, but until this is
> implemented the next best thing is a display-table element for \n).

We could leave the continuation glyphs, but make them less conspicuous.

To mark hard newlines, try the code below.   I suggest to include this.


(defface blank-newline
   '((((class color) (background dark))
      (:foreground "lightgrey" :bold nil))
     (((class color) (background light))
      ( :foreground "lightgrey" :bold nil))
     (t (:bold nil :underline t)))
   "Face used to visualize NEWLINE char mapping.

See `blank-display-mappings'."
   :group 'blank)


  ;; 2230 = \x8B6
(defvar show-newlines-newline-code (vector (make-glyph-code 2230  
'blank-newline) 10))
(define-minor-mode show-newlines-mode
   "Mark newlines in current buffer"
  :group 'convenience

  (unless buffer-display-table
    (setq buffer-display-table (or standard-display-table (make- 
display-table))))
  (if show-newlines-mode
      (aset buffer-display-table 10 show-newlines-newline-code)
    (aset buffer-display-table 10 nil)))

(define-minor-mode global-show-newlines-mode
   "Mark newlines in all buffers"
   :group 'convenience
   :global t

  (unless standard-display-table
    (setq standard-display-table (make-display-table)))
  (if global-show-newlines-mode
      (aset standard-display-table 10 show-newlines-newline-code)
    (aset standard-display-table 10 nil))
  (dolist (buffer (buffer-list))
    (with-current-buffer buffer
      (if buffer-display-table
	 (show-newlines-mode (if global-show-newlines-mode 1 -1))))))


(define-key-after menu-bar-showhide-menu [show-newlines-mode]
   (menu-bar-make-mm-toggle global-show-newlines-mode
			   "Show Newlines"
			   "Show hard newlines") 'highlight-paren-mode)


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-18 14:24               ` David Reitter
@ 2008-07-18 15:21                 ` Stefan Monnier
  2008-07-18 15:30                   ` Dan Nicolaescu
  2008-07-18 21:07                   ` David Reitter
  0 siblings, 2 replies; 52+ messages in thread
From: Stefan Monnier @ 2008-07-18 15:21 UTC (permalink / raw)
  To: David Reitter; +Cc: Chong Yidong, raman, emacs-devel, Miles Bader

>> I don't know how many people actually want them in visual-line-mode
>> (I'd like a fringe item at a hard newline, but until this is
>> implemented the next best thing is a display-table element for \n).

> We could leave the continuation glyphs, but make them less conspicuous.

For a mode that expects most lines to be wrapped, I see not point in
leaving continuation marks.

> To mark hard newlines, try the code below.   I suggest to include this.

>  ;; 2230 = \x8B6
> (defvar show-newlines-newline-code (vector (make-glyph-code 2230
> blank-newline) 10))

[ Too long a line, huh? ]

My font doesn't seem to know the char 2230, and UnicodeData.txt doesn't
seem to know that char either.  So we should probably use something else.

>  (if show-newlines-mode
>      (aset buffer-display-table 10 show-newlines-newline-code)
>    (aset buffer-display-table 10 nil)))

Better write it as:

 (aset buffer-display-table 10
       (if show-newlines-mode show-newlines-newline-code))


-- Stefan




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-18 15:21                 ` Stefan Monnier
@ 2008-07-18 15:30                   ` Dan Nicolaescu
  2008-07-18 15:50                     ` Stefan Monnier
                                       ` (3 more replies)
  2008-07-18 21:07                   ` David Reitter
  1 sibling, 4 replies; 52+ messages in thread
From: Dan Nicolaescu @ 2008-07-18 15:30 UTC (permalink / raw)
  To: Stefan Monnier
  Cc: Miles Bader, David Reitter, Chong Yidong, emacs-devel, raman

Stefan Monnier <monnier@iro.umontreal.ca> writes:

  > >> I don't know how many people actually want them in visual-line-mode
  > >> (I'd like a fringe item at a hard newline, but until this is
  > >> implemented the next best thing is a display-table element for \n).
  > 
  > > We could leave the continuation glyphs, but make them less conspicuous.
  > 
  > For a mode that expects most lines to be wrapped, I see not point in
  > leaving continuation marks.
  > 
  > > To mark hard newlines, try the code below.   I suggest to include this.
  > 
  > >  ;; 2230 = \x8B6
  > > (defvar show-newlines-newline-code (vector (make-glyph-code 2230
  > > blank-newline) 10))
  > 
  > [ Too long a line, huh? ]
  > 
  > My font doesn't seem to know the char 2230, and UnicodeData.txt doesn't
  > seem to know that char either.  So we should probably use something else.
  > 
  > >  (if show-newlines-mode
  > >      (aset buffer-display-table 10 show-newlines-newline-code)
  > >    (aset buffer-display-table 10 nil)))
  > 
  > Better write it as:
  > 
  >  (aset buffer-display-table 10
  >        (if show-newlines-mode show-newlines-newline-code))

whitespace.el already has many many ways of dealing with whitespaces,
wouldn't this mode be a better fit in whitespace.el?




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-18 15:30                   ` Dan Nicolaescu
@ 2008-07-18 15:50                     ` Stefan Monnier
  2008-07-19  0:10                     ` Miles Bader
                                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 52+ messages in thread
From: Stefan Monnier @ 2008-07-18 15:50 UTC (permalink / raw)
  To: Dan Nicolaescu
  Cc: Miles Bader, David Reitter, Chong Yidong, emacs-devel, raman

> whitespace.el already has many many ways of dealing with whitespaces,
> wouldn't this mode be a better fit in whitespace.el?

Probably, yes,


        Stefan




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-18  4:35           ` Miles Bader
  2008-07-18 14:16             ` Stefan Monnier
@ 2008-07-18 16:08             ` Chong Yidong
  2008-07-18 18:36               ` Stefan Monnier
  1 sibling, 1 reply; 52+ messages in thread
From: Chong Yidong @ 2008-07-18 16:08 UTC (permalink / raw)
  To: Miles Bader; +Cc: David Reitter, emacs-devel, Stefan Monnier, raman

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;




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-18 16:08             ` Chong Yidong
@ 2008-07-18 18:36               ` Stefan Monnier
  2008-07-20  3:34                 ` Chong Yidong
  2008-07-20  3:43                 ` Chong Yidong
  0 siblings, 2 replies; 52+ messages in thread
From: Stefan Monnier @ 2008-07-18 18:36 UTC (permalink / raw)
  To: Chong Yidong; +Cc: David Reitter, raman, emacs-devel, Miles Bader

> 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.)

I think it should not be linked to word-wrap but to visual-line-mode
(or longlines-mode).
A side-benefit is that it can then be all done in Elisp.


        Stefan




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-18 15:21                 ` Stefan Monnier
  2008-07-18 15:30                   ` Dan Nicolaescu
@ 2008-07-18 21:07                   ` David Reitter
  2008-07-18 22:57                     ` Jason Rumney
  1 sibling, 1 reply; 52+ messages in thread
From: David Reitter @ 2008-07-18 21:07 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Chong Yidong, raman, emacs-devel, Miles Bader

[-- Attachment #1: Type: text/plain, Size: 417 bytes --]

On 18 Jul 2008, at 11:21, Stefan Monnier wrote:
> My font doesn't seem to know the char 2230, and UnicodeData.txt  
> doesn't
> seem to know that char either.  So we should probably use something  
> else.

It's the standard unicode 182 (U+00B6), "Pilcrow". See also: http://en.wikipedia.org/wiki/Pilcrow

2230 might be wrong for the general case, but it does work for me.  Do  
you know what the right code would be?

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-18 21:07                   ` David Reitter
@ 2008-07-18 22:57                     ` Jason Rumney
  0 siblings, 0 replies; 52+ messages in thread
From: Jason Rumney @ 2008-07-18 22:57 UTC (permalink / raw)
  To: David Reitter
  Cc: Miles Bader, Chong Yidong, emacs-devel, Stefan Monnier, raman

David Reitter wrote:
> On 18 Jul 2008, at 11:21, Stefan Monnier wrote:
>> My font doesn't seem to know the char 2230, and UnicodeData.txt doesn't
>> seem to know that char either.  So we should probably use something else.
> 
> It's the standard unicode 182 (U+00B6), "Pilcrow". See also:
> http://en.wikipedia.org/wiki/Pilcrow
> 
> 2230 might be wrong for the general case, but it does work for me.

Are you using 22.2 (or the 22 branch)? 2230 seems to be the code point
for a latin-1 pilcrow in emacs-mule encoding. In the trunk, the code
point should be 182.




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  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-25 13:41                     ` T. V. Raman
  3 siblings, 0 replies; 52+ messages in thread
From: Miles Bader @ 2008-07-19  0:10 UTC (permalink / raw)
  To: Dan Nicolaescu
  Cc: David Reitter, Chong Yidong, raman, Stefan Monnier, emacs-devel

Dan Nicolaescu <dann@ics.uci.edu> writes:
> whitespace.el already has many many ways of dealing with whitespaces,
> wouldn't this mode be a better fit in whitespace.el?

whitespace.el is already a huge bloated mess, let's not make it worse...

-Miles

-- 
Accordion, n. An instrument in harmony with the sentiments of an assassin.




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-18 18:36               ` Stefan Monnier
@ 2008-07-20  3:34                 ` Chong Yidong
  2008-07-20  3:43                 ` Chong Yidong
  1 sibling, 0 replies; 52+ messages in thread
From: Chong Yidong @ 2008-07-20  3:34 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: David Reitter, raman, emacs-devel, Miles Bader

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> 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.)
>
> I think it should not be linked to word-wrap but to visual-line-mode
> (or longlines-mode).  A side-benefit is that it can then be all done
> in Elisp.

You mean, have a variable `continuation-fringe-indicators', and make
visual-line-mode set it?




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  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
  1 sibling, 1 reply; 52+ messages in thread
From: Chong Yidong @ 2008-07-20  3:43 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: David Reitter, raman, emacs-devel, Miles Bader

Stefan Monnier <monnier@iro.umontreal.ca> writes:

> I think it should not be linked to word-wrap but to visual-line-mode
> (or longlines-mode).
> A side-benefit is that it can then be all done in Elisp.

Oh I see what you mean: something like this?  (i.e., making
visual-line-mode modify fringe-indicator-alist)?


*** trunk/lisp/simple.el.~1.935.~ 2008-07-18
01:10000 -0400
--- trunk/lisp/simple.el      2008-07-19 23:39:47.000000000
-0400
***************
*** 4482,4490 ****
    (if visual-line-mode
        (progn
        (set (make-local-variable 'line-move-visual) t)
!       (setq word-wrap t))
      (kill-local-variable 'line-move-visual)
!     (kill-local-variable 'word-wrap)))
  
  (defun turn-on-visual-line-mode ()
    (visual-line-mode 1))
--- 4482,4494 ----
    (if visual-line-mode
        (progn
        (set (make-local-variable 'line-move-visual) t)
!       (setq word-wrap t)
!       (setq fringe-indicator-alist (copy-tree fringe-indicator-alist))
!       (setcdr (assq 'continuation fringe-indicator-alist)
!               (list nil nil nil nil)))
      (kill-local-variable 'line-move-visual)
!     (kill-local-variable 'word-wrap)
!     (kill-local-variable 'fringe-indicator-alist)))
  
  (defun turn-on-visual-line-mode ()
    (visual-line-mode 1))




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-20  3:43                 ` Chong Yidong
@ 2008-07-20  4:15                   ` Miles Bader
  2008-07-21  4:09                     ` Chong Yidong
  0 siblings, 1 reply; 52+ messages in thread
From: Miles Bader @ 2008-07-20  4:15 UTC (permalink / raw)
  To: Chong Yidong; +Cc: David Reitter, emacs-devel, Stefan Monnier, raman

No need to copy/modify fringe-indicator-alist I think; how about just
doing:

   (push '(continuation) fringe-indicator-alist)

[the display engine only looks at the first entry]

-Miles

-- 
Somebody has to do something, and it's just incredibly pathetic that it
has to be us.  -- Jerry Garcia




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-20  4:15                   ` Miles Bader
@ 2008-07-21  4:09                     ` Chong Yidong
  0 siblings, 0 replies; 52+ messages in thread
From: Chong Yidong @ 2008-07-21  4:09 UTC (permalink / raw)
  To: Miles Bader; +Cc: David Reitter, emacs-devel, Stefan Monnier, raman

Miles Bader <miles@gnu.org> writes:

> No need to copy/modify fringe-indicator-alist I think; how about just
> doing:
>
>    (push '(continuation) fringe-indicator-alist)

Indeed.  I just checked in something to CVS along these lines.




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  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
                                         ` (2 more replies)
  2008-07-25 13:41                     ` T. V. Raman
  3 siblings, 3 replies; 52+ messages in thread
From: David Reitter @ 2008-07-21 15:49 UTC (permalink / raw)
  To: Dan Nicolaescu
  Cc: Miles Bader, Chong Yidong, emacs-devel, Stefan Monnier, raman

[-- Attachment #1: Type: text/plain, Size: 4072 bytes --]

On 21 Jul 2008, at 00:49, Chong Yidong wrote:
> If anyone on this list has a patch that is still waiting for  
> approval or
> further comments, now would be a good time to ping.


OK, there is still the paragraph marking function. The following two  
major items (and some smaller issues) have been addressed:

Stefan Monnier:

> My font doesn't seem to know the char 2230, and UnicodeData.txt  
> doesn't
> seem to know that char either.  So we should probably use something  
> else.

On 18 Jul 2008, at 11:30, Dan Nicolaescu wrote:
>
> whitespace.el already has many many ways of dealing with whitespaces,
> wouldn't this mode be a better fit in whitespace.el?


Any objections to the patch below.
Can't put it in simple.el because make-glyph-code can't be autoloaded,  
and the code is probably happy in whitespace.el.

- D




*** whitespace.el	06 May 2008 03:57:59 -0400	1.80
--- whitespace.el	21 Jul 2008 11:04:45 -0400	
***************
*** 2352,2357 ****
--- 2352,2406 ----
         (whitespace-mode -1)))
     nil)					; continue standard unloading

+ \f
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+
+ ;; Show-newlines-mode
+ (defface blank-newline
+  '((((class color) (background dark))
+     (:foreground "lightgrey" :bold nil))
+    (((class color) (background light))
+     ( :foreground "lightgrey" :bold nil))
+    (t (:bold nil :underline t)))
+  "Face used to visualize NEWLINE char mapping.
+
+ See `blank-display-mappings'."
+  :group 'blank)
+
+ (defvar show-newlines-newline-code
+   (vector (make-glyph-code 182 'blank-newline) 10))
+
+ ;;;###autoload
+ (define-minor-mode show-newlines-mode
+   "Mark newlines in current buffer"
+   :group 'convenience
+
+   (unless buffer-display-table
+     (setq buffer-display-table
+ 	  (or standard-display-table (make-display-table))))
+   (aset buffer-display-table 10
+ 	(if show-newlines-mode show-newlines-newline-code)))
+
+ ;;;###autoload
+ (define-minor-mode global-show-newlines-mode
+  "Mark newlines in all buffers"
+  :group 'convenience
+  :global t
+
+  (unless standard-display-table
+    (setq standard-display-table (make-display-table)))
+  (if global-show-newlines-mode
+      (aset standard-display-table 10 show-newlines-newline-code)
+    (aset standard-display-table 10 nil))
+  (dolist (buffer (buffer-list))
+    (with-current-buffer buffer
+      (if buffer-display-table
+ 	 (show-newlines-mode
+ 	  (if global-show-newlines-mode 1 -1))))))
+
+

   (provide 'whitespace)

*** menu-bar.el	10 Jul 2008 00:27:23 -0400	1.341
--- menu-bar.el	21 Jul 2008 11:45:01 -0400	
***************
*** 653,659 ****
     (let ((need-save nil))
       ;; These are set with menu-bar-make-mm-toggle, which does not
       ;; put on a customized-value property.
!     (dolist (elt '(line-number-mode column-number-mode size- 
indication-mode
   		   cua-mode show-paren-mode transient-mark-mode
   		   blink-cursor-mode display-time-mode display-battery-mode))
         (and (customize-mark-to-save elt)
--- 653,660 ----
     (let ((need-save nil))
       ;; These are set with menu-bar-make-mm-toggle, which does not
       ;; put on a customized-value property.
!     (dolist (elt '(global-show-newlines-mode line-number-mode
! 		   column-number-mode size-indication-mode
   		   cua-mode show-paren-mode transient-mark-mode
   		   blink-cursor-mode display-time-mode display-battery-mode))
         (and (customize-mark-to-save elt)
***************
*** 700,705 ****
--- 701,714 ----

   (defvar menu-bar-showhide-menu (make-sparse-keymap "Show/Hide"))

+ (define-key menu-bar-showhide-menu [show-newlines-mode]
+  (menu-bar-make-mm-toggle global-show-newlines-mode
+ 			   "Show Newlines"
+ 			   "Show hard newlines"))
+
+ (define-key menu-bar-showhide-menu [newlines-separator]
+   '("--"))
+
   (define-key menu-bar-showhide-menu [column-number-mode]
     (menu-bar-make-mm-toggle column-number-mode
   			   "Column Numbers"



[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-21 15:49                     ` David Reitter
@ 2008-07-21 16:01                       ` Chong Yidong
  2008-07-21 17:31                         ` Miles Bader
  2008-07-21 17:36                         ` David Reitter
  2008-07-21 16:09                       ` Dan Nicolaescu
  2008-07-21 23:05                       ` Vinicius Jose Latorre
  2 siblings, 2 replies; 52+ messages in thread
From: Chong Yidong @ 2008-07-21 16:01 UTC (permalink / raw)
  To: David Reitter; +Cc: emacs-devel

David Reitter <david.reitter@gmail.com> writes:

> OK, there is still the paragraph marking function. The following two
> major items (and some smaller issues) have been addressed:

Please don't add a menu-bar entry for this.  The menu-bar is already too
cluttered.

Also, I'd suggest a couple of tweaks to your docstrings:

> +  "Face used to visualize NEWLINE char mapping.
> +
> + See `blank-display-mappings'."

Don't capitalize "newline".

> + (defvar show-newlines-newline-code
> +   (vector (make-glyph-code 182 'blank-newline) 10))

Add a brief docstring for this.

> + (define-minor-mode show-newlines-mode
> +   "Mark newlines in current buffer"

This should also say something like "Newlines are marked using the glyph
specified by `show-newlines-newline-code'."

If no one objects within the next 2 days, go ahead and check your code
in, with the above docstring fixes and without the menu-bar entry.
You'll also need a proper ChangeLog entry and a brief entry in etc/NEWS.




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-21 15:49                     ` David Reitter
  2008-07-21 16:01                       ` Chong Yidong
@ 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
  2 siblings, 2 replies; 52+ messages in thread
From: Dan Nicolaescu @ 2008-07-21 16:09 UTC (permalink / raw)
  To: David Reitter
  Cc: Miles Bader, Chong Yidong, emacs-devel, Stefan Monnier, raman

David Reitter <david.reitter@gmail.com> writes:

  > On 21 Jul 2008, at 00:49, Chong Yidong wrote:
  > Any objections to the patch below.

Some nits below:

  > *** whitespace.el	06 May 2008 03:57:59 -0400	1.80
  > --- whitespace.el	21 Jul 2008 11:04:45 -0400	
  > ***************
  > *** 2352,2357 ****
  > --- 2352,2406 ----
  >         (whitespace-mode -1)))
  >     nil)					; continue standard unloading
  > 
  > + \f
  > + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  > +
  > +
  > +
  > + ;; Show-newlines-mode
  > + (defface blank-newline
               ^^^^
Everything else in the file uses "whitespace", better not use a new prefix.

  > +  '((((class color) (background dark))
  > +     (:foreground "lightgrey" :bold nil))
  > +    (((class color) (background light))
  > +     ( :foreground "lightgrey" :bold nil))
  > +    (t (:bold nil :underline t)))
  > +  "Face used to visualize NEWLINE char mapping.
  > +
  > + See `blank-display-mappings'."
  > +  :group 'blank)
       ^^^^^^
This group does not exist.

Didn't look at the rest...




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-21 16:09                       ` Dan Nicolaescu
@ 2008-07-21 17:30                         ` David Reitter
  2008-07-21 17:33                         ` David Reitter
  1 sibling, 0 replies; 52+ messages in thread
From: David Reitter @ 2008-07-21 17:30 UTC (permalink / raw)
  To: Dan Nicolaescu
  Cc: Miles Bader, Chong Yidong, emacs-devel, Stefan Monnier, raman

[-- Attachment #1: Type: text/plain, Size: 132 bytes --]

On 21 Jul 2008, at 12:09, Dan Nicolaescu wrote:
>>
>> +  :group 'blank)
>       ^^^^^^
> This group does not exist.

`display' okay?

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-21 16:01                       ` Chong Yidong
@ 2008-07-21 17:31                         ` Miles Bader
  2008-07-21 19:24                           ` Stefan Monnier
  2008-07-21 17:36                         ` David Reitter
  1 sibling, 1 reply; 52+ messages in thread
From: Miles Bader @ 2008-07-21 17:31 UTC (permalink / raw)
  To: Chong Yidong; +Cc: David Reitter, emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:
>> + (defvar show-newlines-newline-code
>> +   (vector (make-glyph-code 182 'blank-newline) 10))
>
> Add a brief docstring for this.

The name `show-newlines-newline-code' seems bizarre though... "code"?

Also having to append the actual newline oneself seems a bit annoying.

How about just:

  (1) Call it something like "show-newlines-marker", and let it be a
      string.  The default value would be only one character long, but
      there seems no reason to limit users.

  (2) When turning on the mode, map the make-glyph over
      `show-newlines-marker', append the actual newline, and turn it
      into a vector.

-Miles

-- 
自らを空にして、心を開く時、道は開かれる




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-21 16:09                       ` Dan Nicolaescu
  2008-07-21 17:30                         ` David Reitter
@ 2008-07-21 17:33                         ` David Reitter
  1 sibling, 0 replies; 52+ messages in thread
From: David Reitter @ 2008-07-21 17:33 UTC (permalink / raw)
  To: Dan Nicolaescu
  Cc: Miles Bader, Chong Yidong, emacs-devel, Stefan Monnier, raman

[-- Attachment #1: Type: text/plain, Size: 327 bytes --]

On 21 Jul 2008, at 12:09, Dan Nicolaescu wrote:
>>
>> + ;; Show-newlines-mode
>> + (defface blank-newline
>     +  :group 'blank)
>       ^^^^^^
> This group does not exist.

Actually, how about `whitespace' (like the other whitespace  
customizations) for the face and the two minor modes?
That's more specific than `display'.

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-21 16:01                       ` Chong Yidong
  2008-07-21 17:31                         ` Miles Bader
@ 2008-07-21 17:36                         ` David Reitter
  1 sibling, 0 replies; 52+ messages in thread
From: David Reitter @ 2008-07-21 17:36 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 461 bytes --]

On 21 Jul 2008, at 12:01, Chong Yidong wrote:
>  Please don't add a menu-bar entry for this.  The menu-bar is  
> already too
> cluttered.

Do we expect a sizeable number of users to look for this?
If so, we should add it to the Show/Hide menu.

As for clutter: the show/hide menu only has 11 entries with this.

(It is a general problem that users can't find functions unless they  
read a big manual, know how to search customizations or read a news  
group.)

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-21 17:31                         ` Miles Bader
@ 2008-07-21 19:24                           ` Stefan Monnier
  2008-07-21 20:18                             ` Miles Bader
  0 siblings, 1 reply; 52+ messages in thread
From: Stefan Monnier @ 2008-07-21 19:24 UTC (permalink / raw)
  To: Miles Bader; +Cc: David Reitter, Chong Yidong, emacs-devel

> The name `show-newlines-newline-code' seems bizarre though... "code"?

Of course, since it's in whitespace.el its name should start with
"whitespace-".


        Stefan




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-21 19:24                           ` Stefan Monnier
@ 2008-07-21 20:18                             ` Miles Bader
  0 siblings, 0 replies; 52+ messages in thread
From: Miles Bader @ 2008-07-21 20:18 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: David Reitter, Chong Yidong, emacs-devel

Stefan Monnier <monnier@IRO.UMontreal.CA> writes:
> Of course, since it's in whitespace.el its name should start with
> "whitespace-".

Then please move it out of whitespace.el...

-Miles

-- 
Quidquid latine dictum sit, altum viditur.




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-21 15:49                     ` David Reitter
  2008-07-21 16:01                       ` Chong Yidong
  2008-07-21 16:09                       ` Dan Nicolaescu
@ 2008-07-21 23:05                       ` Vinicius Jose Latorre
  2008-07-22  1:31                         ` Chong Yidong
  2 siblings, 1 reply; 52+ messages in thread
From: Vinicius Jose Latorre @ 2008-07-21 23:05 UTC (permalink / raw)
  To: David Reitter
  Cc: Chong Yidong, raman, Dan Nicolaescu, Stefan Monnier, emacs-devel,
	Miles Bader

David Reitter wrote:
> On 21 Jul 2008, at 00:49, Chong Yidong wrote:
>> If anyone on this list has a patch that is still waiting for approval or
>> further comments, now would be a good time to ping.
>
>
> OK, there is still the paragraph marking function. The following two 
> major items (and some smaller issues) have been addressed:
>
> Stefan Monnier:
>
>> My font doesn't seem to know the char 2230, and UnicodeData.txt doesn't
>> seem to know that char either.  So we should probably use something 
>> else.
>
> On 18 Jul 2008, at 11:30, Dan Nicolaescu wrote:
>>
>> whitespace.el already has many many ways of dealing with whitespaces,
>> wouldn't this mode be a better fit in whitespace.el?
>
>
> Any objections to the patch below.
> Can't put it in simple.el because make-glyph-code can't be autoloaded, 
> and the code is probably happy in whitespace.el.
>
> - D


I have objections to this patch.


> *** whitespace.el    06 May 2008 03:57:59 -0400    1.80
> --- whitespace.el    21 Jul 2008 11:04:45 -0400   
> ***************
> *** 2352,2357 ****
> --- 2352,2406 ----
>         (whitespace-mode -1)))
>     nil)                    ; continue standard unloading
>
> + \f
> + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> +
> +
> +
> + ;; Show-newlines-mode
> + (defface blank-newline
> +  '((((class color) (background dark))
> +     (:foreground "lightgrey" :bold nil))
> +    (((class color) (background light))
> +     ( :foreground "lightgrey" :bold nil))
> +    (t (:bold nil :underline t)))
> +  "Face used to visualize NEWLINE char mapping.
> +
> + See `blank-display-mappings'."
> +  :group 'blank)

First of all, there is no more blank package, it was replaced by 
whitespace package.

Second, there is already whitespace-newline which is the face used to 
visualize newlines.


> +
> + (defvar show-newlines-newline-code
> +   (vector (make-glyph-code 182 'blank-newline) 10))

No need for this, please, see whitespace-display-mappings option 
documentation.


> +
> + ;;;###autoload
> + (define-minor-mode show-newlines-mode
> +   "Mark newlines in current buffer"
> +   :group 'convenience
> +
> +   (unless buffer-display-table
> +     (setq buffer-display-table
> +       (or standard-display-table (make-display-table))))
> +   (aset buffer-display-table 10
> +     (if show-newlines-mode show-newlines-newline-code)))
> +
> + ;;;###autoload
> + (define-minor-mode global-show-newlines-mode
> +  "Mark newlines in all buffers"
> +  :group 'convenience
> +  :global t
> +
> +  (unless standard-display-table
> +    (setq standard-display-table (make-display-table)))
> +  (if global-show-newlines-mode
> +      (aset standard-display-table 10 show-newlines-newline-code)
> +    (aset standard-display-table 10 nil))
> +  (dolist (buffer (buffer-list))
> +    (with-current-buffer buffer
> +      (if buffer-display-table
> +      (show-newlines-mode
> +       (if global-show-newlines-mode 1 -1))))))
> +
> +
>
>   (provide 'whitespace)

Again, no need for all of these functions.

If it is necessary to have specific functions to display newlines, it 
should be something like this:

(defun whitespace-newline ()
    (let ((whitespace-style '(newline-mark newline)))
       (whitespace-mode 1)))

(defun global-whitespace-newline ()
    (let ((whitespace-style '(newline-mark newline)))
       (global-whitespace-mode 1)))



> *** menu-bar.el    10 Jul 2008 00:27:23 -0400    1.341
> --- menu-bar.el    21 Jul 2008 11:45:01 -0400   
> ***************
> *** 653,659 ****
>     (let ((need-save nil))
>       ;; These are set with menu-bar-make-mm-toggle, which does not
>       ;; put on a customized-value property.
> !     (dolist (elt '(line-number-mode column-number-mode 
> size-indication-mode
>              cua-mode show-paren-mode transient-mark-mode
>              blink-cursor-mode display-time-mode display-battery-mode))
>         (and (customize-mark-to-save elt)
> --- 653,660 ----
>     (let ((need-save nil))
>       ;; These are set with menu-bar-make-mm-toggle, which does not
>       ;; put on a customized-value property.
> !     (dolist (elt '(global-show-newlines-mode line-number-mode
> !            column-number-mode size-indication-mode
>              cua-mode show-paren-mode transient-mark-mode
>              blink-cursor-mode display-time-mode display-battery-mode))
>         (and (customize-mark-to-save elt)
> ***************
> *** 700,705 ****
> --- 701,714 ----
>
>   (defvar menu-bar-showhide-menu (make-sparse-keymap "Show/Hide"))
>
> + (define-key menu-bar-showhide-menu [show-newlines-mode]
> +  (menu-bar-make-mm-toggle global-show-newlines-mode
> +                "Show Newlines"
> +                "Show hard newlines"))
> +
> + (define-key menu-bar-showhide-menu [newlines-separator]
> +   '("--"))
> +
>   (define-key menu-bar-showhide-menu [column-number-mode]
>     (menu-bar-make-mm-toggle column-number-mode
>                  "Column Numbers"

Why should the newline visualization be inserted into menu-bar?


Vinicius





^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-21 23:05                       ` Vinicius Jose Latorre
@ 2008-07-22  1:31                         ` Chong Yidong
  2008-07-22  1:58                           ` Vinicius Jose Latorre
  0 siblings, 1 reply; 52+ messages in thread
From: Chong Yidong @ 2008-07-22  1:31 UTC (permalink / raw)
  To: Vinicius Jose Latorre
  Cc: David Reitter, raman, Dan Nicolaescu, Stefan Monnier, emacs-devel,
	Miles Bader

Vinicius Jose Latorre <viniciusjl@ig.com.br> writes:

> Second, there is already whitespace-newline which is the face used to
> visualize newlines.
>
> If it is necessary to have specific functions to display newlines, it
> should be something like this:
>
> (defun whitespace-newline ()
>    (let ((whitespace-style '(newline-mark newline)))
>       (whitespace-mode 1)))
>
> (defun global-whitespace-newline ()
>    (let ((whitespace-style '(newline-mark newline)))
>       (global-whitespace-mode 1)))

Aha.  This certainly looks like a much better solution (it will have to
be rewritten properly using define-minor-mode, though).

Thanks.




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-22  1:31                         ` Chong Yidong
@ 2008-07-22  1:58                           ` Vinicius Jose Latorre
  2008-07-22  2:20                             ` David Reitter
  0 siblings, 1 reply; 52+ messages in thread
From: Vinicius Jose Latorre @ 2008-07-22  1:58 UTC (permalink / raw)
  To: Chong Yidong
  Cc: David Reitter, raman, Dan Nicolaescu, Stefan Monnier, emacs-devel,
	Miles Bader

Chong Yidong wrote:
> Vinicius Jose Latorre <viniciusjl@ig.com.br> writes:
>
>> Second, there is already whitespace-newline which is the face used to
>> visualize newlines.
>>
>> If it is necessary to have specific functions to display newlines, it
>> should be something like this:
>>
>> (defun whitespace-newline ()
>>    (let ((whitespace-style '(newline-mark newline)))
>>       (whitespace-mode 1)))
>>
>> (defun global-whitespace-newline ()
>>    (let ((whitespace-style '(newline-mark newline)))
>>       (global-whitespace-mode 1)))
>
> Aha.  This certainly looks like a much better solution (it will have to
> be rewritten properly using define-minor-mode, though).
>
> Thanks.

What about the code below?


;;;###autoload
(define-minor-mode whitespace-newline-mode
  "Toggle newline minor mode visualization (\"nl\" on modeline).

If ARG is null, toggle newline visualization.
If ARG is a number greater than zero, turn on visualization;
otherwise, turn off visualization.
Only useful with a windowing system."
  :lighter    " nl"
  :init-value nil
  :global     nil
  :group      'whitespace
  (let ((whitespace-style '(newline-mark newline)))
    (whitespace-mode whitespace-newline-mode)))


;;;###autoload
(define-minor-mode global-whitespace-newline-mode
  "Toggle newline global minor mode visualization (\"NL\" on modeline).

If ARG is null, toggle newline visualization.
If ARG is a number greater than zero, turn on visualization;
otherwise, turn off visualization.
Only useful with a windowing system."
  :lighter    " NL"
  :init-value nil
  :global     t
  :group      'whitespace
  (let ((whitespace-style '(newline-mark newline)))
    (global-whitespace-mode global-whitespace-newline-mode)))





^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-22  1:58                           ` Vinicius Jose Latorre
@ 2008-07-22  2:20                             ` David Reitter
  2008-07-23  1:53                               ` Vinicius Jose Latorre
  0 siblings, 1 reply; 52+ messages in thread
From: David Reitter @ 2008-07-22  2:20 UTC (permalink / raw)
  To: Vinicius Jose Latorre
  Cc: Chong Yidong, raman, Dan Nicolaescu, Stefan Monnier, emacs-devel,
	Miles Bader

[-- Attachment #1: Type: text/plain, Size: 367 bytes --]

On 21 Jul 2008, at 21:58, Vinicius Jose Latorre wrote:

> What about the code below?
>
> (let ((whitespace-style '(newline-mark newline)))
>   (whitespace-mode whitespace-newline-mode)))

Much more elegant.

I would still want the pilcrow to be used by default and the more (s/ 
t)ame colors for the face.
But that may well be the default for whitespace in general.


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-22  2:20                             ` David Reitter
@ 2008-07-23  1:53                               ` Vinicius Jose Latorre
  2008-07-23  2:53                                 ` David Reitter
  0 siblings, 1 reply; 52+ messages in thread
From: Vinicius Jose Latorre @ 2008-07-23  1:53 UTC (permalink / raw)
  To: David Reitter
  Cc: Chong Yidong, raman, Dan Nicolaescu, Stefan Monnier, emacs-devel,
	Miles Bader


>> What about the code below?
>>
>> (let ((whitespace-style '(newline-mark newline)))
>>   (whitespace-mode whitespace-newline-mode)))
>
> Much more elegant.
>
> I would still want the pilcrow to be used by default and the more 
> (s/t)ame colors for the face.
> But that may well be the default for whitespace in general.

Well, you can change the whitespace-newline and 
whitespace-display-mappings settings in your ~/.emacs file.

BTW, I also prefer the pilcrow.






^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-23  1:53                               ` Vinicius Jose Latorre
@ 2008-07-23  2:53                                 ` David Reitter
  2008-07-23  3:19                                   ` Vinicius Jose Latorre
  0 siblings, 1 reply; 52+ messages in thread
From: David Reitter @ 2008-07-23  2:53 UTC (permalink / raw)
  To: Vinicius Jose Latorre
  Cc: Chong Yidong, raman, Dan Nicolaescu, Stefan Monnier, emacs-devel,
	Miles Bader

[-- Attachment #1: Type: text/plain, Size: 732 bytes --]

On 22 Jul 2008, at 21:53, Vinicius Jose Latorre wrote:
>>
>> I would still want the pilcrow to be used by default and the more  
>> (s/t)ame colors for the face.
>> But that may well be the default for whitespace in general.
>
> Well, you can change the whitespace-newline and whitespace-display- 
> mappings settings in your ~/.emacs file.

... so we don't have to set sensible defaults?

> BTW, I also prefer the pilcrow.


The default has to be sensible, and this is quite possibly different  
for the full-blown whitespace-mode and for this show-newlines-mode.

Since unicode is no problem, I would suggest to use the pilcrow for  
both modes, and stick to no background color and grey foreground for  
the show-newlines-mode.


[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-23  2:53                                 ` David Reitter
@ 2008-07-23  3:19                                   ` Vinicius Jose Latorre
  2008-07-23 10:58                                     ` David Reitter
  0 siblings, 1 reply; 52+ messages in thread
From: Vinicius Jose Latorre @ 2008-07-23  3:19 UTC (permalink / raw)
  To: David Reitter
  Cc: Chong Yidong, raman, Dan Nicolaescu, Stefan Monnier, emacs-devel,
	Miles Bader

David Reitter wrote:
> On 22 Jul 2008, at 21:53, Vinicius Jose Latorre wrote:
>>>
>>> I would still want the pilcrow to be used by default and the more 
>>> (s/t)ame colors for the face.
>>> But that may well be the default for whitespace in general.
>>
>> Well, you can change the whitespace-newline and 
>> whitespace-display-mappings settings in your ~/.emacs file.
>
> ... so we don't have to set sensible defaults?
>
>> BTW, I also prefer the pilcrow.
>
>
> The default has to be sensible, and this is quite possibly different 
> for the full-blown whitespace-mode and for this show-newlines-mode.
>
> Since unicode is no problem, I would suggest to use the pilcrow for 
> both modes, and stick to no background color and grey foreground for 
> the show-newlines-mode.

Well, the current defaults are sensible.

There was a discussion about whitespace settings before whitespace was 
accepted as part of Emacs.

When I said that I also prefer pilcrow, I was expressing my preference, 
but this is not the consensus about these settings.

Anyway, anyone can change these settings in ~/.emacs file to reflect 
personal preferences.





^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-23  3:19                                   ` Vinicius Jose Latorre
@ 2008-07-23 10:58                                     ` David Reitter
  2008-07-24  3:37                                       ` Vinicius Jose Latorre
  0 siblings, 1 reply; 52+ messages in thread
From: David Reitter @ 2008-07-23 10:58 UTC (permalink / raw)
  To: Vinicius Jose Latorre
  Cc: Chong Yidong, raman, Dan Nicolaescu, Stefan Monnier, emacs-devel,
	Miles Bader

[-- Attachment #1: Type: text/plain, Size: 770 bytes --]

On 22 Jul 2008, at 23:19, Vinicius Jose Latorre wrote:
>
> Well, the current defaults are sensible.
>
> There was a discussion about whitespace settings before whitespace  
> was accepted as part of Emacs.
>
> When I said that I also prefer pilcrow, I was expressing my  
> preference, but this is not the consensus about these settings.

The weird color combination makes perfect sense for whitespace-mode,  
but not to just mark paragraphs as a regularly enabled function.   
There, the paragraph marks would have to be a lot less conspicuous.   
Perhaps the show-newlines-mode is really something that needs to be  
implemented more separately from  whitespace.el or at least whitespace- 
mode.

This is the last message from me regarding this topic for lack of time.

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-23 10:58                                     ` David Reitter
@ 2008-07-24  3:37                                       ` Vinicius Jose Latorre
       [not found]                                         ` <9B9CE742-E040-4484-9BDC-593DE5B6B037@gmail.com>
  0 siblings, 1 reply; 52+ messages in thread
From: Vinicius Jose Latorre @ 2008-07-24  3:37 UTC (permalink / raw)
  To: David Reitter
  Cc: Chong Yidong, raman, Dan Nicolaescu, Stefan Monnier, emacs-devel,
	Miles Bader


> The weird color combination makes perfect sense for whitespace-mode, 
> but not to just mark paragraphs as a regularly enabled function.  
> There, the paragraph marks would have to be a lot less conspicuous.  
> Perhaps the show-newlines-mode is really something that needs to be 
> implemented more separately from  whitespace.el or at least 
> whitespace-mode.
>
> This is the last message from me regarding this topic for lack of time.

Please, could you send two images with the "non-weird" colors, one image 
with light background and another with dark background?





^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-16 16:37   ` David Reitter
  2008-07-16 16:47     ` Chong Yidong
@ 2008-07-25 13:39     ` T. V. Raman
  1 sibling, 0 replies; 52+ messages in thread
From: T. V. Raman @ 2008-07-25 13:39 UTC (permalink / raw)
  To: david.reitter; +Cc: emacs-devel, monnier, raman

I  think changing the behavior of the arrow keys and c-n / c-p to
default to the behavior from visual-line-mode is simply too
drastic a change for Emacs. It should be customizable, and once a
minor mode,  come with a turn-on-visual-mode that users can place
on various hooks. 

>>>>> "David" == David Reitter <david.reitter@gmail.com> writes:
    David> On 16 Jul 2008, at 12:26, Stefan Monnier wrote:
    >> 
    >> Yes, it should be a define-minor-mode (with name ending in
    >> "-mode").  Can someone make this change?
    David> 
    David> 
    David> What do we conclude from the discussion related to
    David> this?
    David> 
    David> My understanding is that we were going to have visual
    David> navigation (arrow keys, C-n, C-p) default to on, and
    David> leave default behavior of C- a and C-e as is, with
    David> some code (from the visual-line-mode that I posted) to
    David> optionally remap C-a and C-e to visual navigation as
    David> it is sensible in text modes.
    David> 
    David> Should this be one minor mode that defaults to on, or
    David> should we have two minor modes then?  Also, should C-a
    David> and C-e default to the visual mode in all text modes?
    David> (Would that just go in text-mode-hook?)
    David> 
    David> 
    David> 

-- 
Best Regards,
--raman

      
Email:  raman@users.sf.net
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: tv.raman.tv@gmail.com
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman 
IRC:    irc://irc.freenode.net/#emacs




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-18 15:30                   ` Dan Nicolaescu
                                       ` (2 preceding siblings ...)
  2008-07-21 15:49                     ` David Reitter
@ 2008-07-25 13:41                     ` T. V. Raman
  3 siblings, 0 replies; 52+ messages in thread
From: T. V. Raman @ 2008-07-25 13:41 UTC (permalink / raw)
  To: dann; +Cc: david.reitter, cyd, emacs-devel, monnier, raman, miles

1+ on whitespace.el -- it's what I depend on in general to clean
up unnecessary whitespace in various portions of code I write.

>>>>> "Dan" == Dan Nicolaescu <dann@ics.uci.edu> writes:
    Dan> Stefan Monnier <monnier@iro.umontreal.ca> writes:
    >> >> I don't know how many people actually want them in
    >> visual-line-mode >> (I'd like a fringe item at a hard
    >> newline, but until this is >> implemented the next best
    >> thing is a display-table element for \n).
    >> 
    >> > We could leave the continuation glyphs, but make them
    >> less conspicuous.
    >> 
    >> For a mode that expects most lines to be wrapped, I see
    >> not point in leaving continuation marks.
    >> 
    >> > To mark hard newlines, try the code below.  I suggest to
    >> include this.
    >> 
    >> > ;; 2230 = \x8B6 > (defvar show-newlines-newline-code
    >> (vector (make-glyph-code 2230 > blank-newline) 10))
    >> 
    >> [ Too long a line, huh? ]
    >> 
    >> My font doesn't seem to know the char 2230, and
    >> UnicodeData.txt doesn't seem to know that char either.  So
    >> we should probably use something else.
    >> 
    >> > (if show-newlines-mode > (aset buffer-display-table 10
    >> show-newlines-newline-code) > (aset buffer-display-table
    >> 10 nil)))
    >> 
    >> Better write it as:
    >> 
    >> (aset buffer-display-table 10 (if show-newlines-mode
    >> show-newlines-newline-code))
    Dan> 
    Dan> whitespace.el already has many many ways of dealing with
    Dan> whitespaces, wouldn't this mode be a better fit in
    Dan> whitespace.el?

-- 
Best Regards,
--raman

      
Email:  raman@users.sf.net
WWW:    http://emacspeak.sf.net/raman/
AIM:    emacspeak       GTalk: tv.raman.tv@gmail.com
PGP:    http://emacspeak.sf.net/raman/raman-almaden.asc
Google: tv+raman 
IRC:    irc://irc.freenode.net/#emacs




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
       [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 10:44                                             ` David Reitter
  0 siblings, 2 replies; 52+ messages in thread
From: Vinicius Jose Latorre @ 2008-07-26  0:15 UTC (permalink / raw)
  To: David Reitter
  Cc: Chong Yidong, raman, Dan Nicolaescu, Stefan Monnier, emacs-devel,
	Miles Bader

[-- Attachment #1: Type: text/plain, Size: 864 bytes --]


> See attachments.
>
> The idea is to use less contrast for the pilcrow.  The whitespace.el 
> colors do the exact opposite: they emphasize the whitespace over the 
> normal text, which is great if and only if you want to just check 
> whitespace and then turn it off again.


Hmmm, yes, it looks good, but lightgrey is a problem with dark 
background and a white foreground, as lightgrey and white have low contrast.

I made some tests with the following setting:

(defface whitespace-newline
  '((((class color) (background dark))
     (:background "grey22" :foreground "gray" :bold nil))
    (((class color) (background light))
     (:background "floralwhite" :foreground "gray" :bold nil))
    (t (:bold nil :underline t)))
  "Face used to visualize NEWLINE char mapping.

See `whitespace-display-mappings'."
  :group 'whitespace)

See the attached images.



[-- Attachment #2: bg-light.png --]
[-- Type: image/png, Size: 3222 bytes --]

[-- Attachment #3: bg-dark.png --]
[-- Type: image/png, Size: 3160 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* RE: line-line-move-visual: was line motion problem
  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 10:44                                             ` David Reitter
  1 sibling, 1 reply; 52+ messages in thread
From: Drew Adams @ 2008-07-26  0:32 UTC (permalink / raw)
  To: 'Vinicius Jose Latorre', 'David Reitter'
  Cc: 'Chong Yidong', emacs-devel, 'Dan Nicolaescu',
	'Stefan Monnier', raman, 'Miles Bader'

FWIW: In Framemaker, text symbols (such as pilcrow and section symbol) have the
same color as the preceding text. I think that is a good convention - the
symbols are then always as readable as the text.

FWIW2: In Framemaker, you can toggle display of all text symbols at once.





^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-26  0:32                                             ` Drew Adams
@ 2008-07-26  2:11                                               ` Vinicius Jose Latorre
  2008-07-26  2:39                                                 ` Drew Adams
  0 siblings, 1 reply; 52+ messages in thread
From: Vinicius Jose Latorre @ 2008-07-26  2:11 UTC (permalink / raw)
  To: Drew Adams
  Cc: 'David Reitter', 'Chong Yidong', emacs-devel,
	'Dan Nicolaescu', 'Stefan Monnier', raman,
	'Miles Bader'


> FWIW: In Framemaker, text symbols (such as pilcrow and section symbol) have the
> same color as the preceding text. I think that is a good convention - the
> symbols are then always as readable as the text.
>
> FWIW2: In Framemaker, you can toggle display of all text symbols at once.
>   

FWIW1: Not only Framemaker, also OpenOffice, Word, etc.

FWIW2: whitespace package visualize tabs, (hard) spaces and newlines via 
display table and/or faces.
To visualize as Framemaker (OpenOffice, Word, etc.), just use display 
table, that is:

(setq whitespace-style '(space-mark tab-mark newline-mark))

FWIW3: whitespace also toggles display of all text symbols at once.





^ permalink raw reply	[flat|nested] 52+ messages in thread

* RE: line-line-move-visual: was line motion problem
  2008-07-26  2:11                                               ` Vinicius Jose Latorre
@ 2008-07-26  2:39                                                 ` Drew Adams
  2008-07-26 13:46                                                   ` Vinicius Jose Latorre
  0 siblings, 1 reply; 52+ messages in thread
From: Drew Adams @ 2008-07-26  2:39 UTC (permalink / raw)
  To: 'Vinicius Jose Latorre'
  Cc: 'David Reitter', 'Chong Yidong', emacs-devel,
	'Dan Nicolaescu', 'Stefan Monnier', raman,
	'Miles Bader'

> FWIW2: whitespace package visualize tabs, (hard) spaces and 
> newlines via display table and/or faces. To visualize as
> Framemaker (OpenOffice, Word, etc.), just use display table,
> that is: (setq whitespace-style '(space-mark tab-mark newline-mark))
> 
> FWIW3: whitespace also toggles display of all text symbols at once.

Sounds good. I didn't try your code; I was just offering some feedback based on
the images you sent, in case it helped.





^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-26  0:15                                           ` Vinicius Jose Latorre
  2008-07-26  0:32                                             ` Drew Adams
@ 2008-07-26 10:44                                             ` David Reitter
  2008-07-26 12:59                                               ` Vinicius Jose Latorre
  1 sibling, 1 reply; 52+ messages in thread
From: David Reitter @ 2008-07-26 10:44 UTC (permalink / raw)
  To: Vinicius Jose Latorre
  Cc: Chong Yidong, raman, Dan Nicolaescu, Stefan Monnier, emacs-devel,
	Miles Bader

[-- Attachment #1: Type: text/plain, Size: 647 bytes --]

On 25 Jul 2008, at 20:15, Vinicius Jose Latorre wrote:

>
>> See attachments.
>>
>> The idea is to use less contrast for the pilcrow.  The  
>> whitespace.el colors do the exact opposite: they emphasize the  
>> whitespace over the normal text, which is great if and only if you  
>> want to just check whitespace and then turn it off again.
>
>
> Hmmm, yes, it looks good, but lightgrey is a problem with dark  
> background and a white foreground, as lightgrey and white have low  
> contrast.

Low contrast is precisely what I wanted to achieve.
The extra paragraph marks don't need to stand out.  The text being  
edited needs to be prominent.

[-- Attachment #2: smime.p7s --]
[-- Type: application/pkcs7-signature, Size: 2193 bytes --]

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-26 10:44                                             ` David Reitter
@ 2008-07-26 12:59                                               ` Vinicius Jose Latorre
  0 siblings, 0 replies; 52+ messages in thread
From: Vinicius Jose Latorre @ 2008-07-26 12:59 UTC (permalink / raw)
  To: David Reitter
  Cc: Chong Yidong, raman, Dan Nicolaescu, Stefan Monnier, emacs-devel,
	Miles Bader


>>> See attachments.
>>>
>>> The idea is to use less contrast for the pilcrow.  The whitespace.el 
>>> colors do the exact opposite: they emphasize the whitespace over the 
>>> normal text, which is great if and only if you want to just check 
>>> whitespace and then turn it off again.
>>
>>
>> Hmmm, yes, it looks good, but lightgrey is a problem with dark 
>> background and a white foreground, as lightgrey and white have low 
>> contrast.
>
> Low contrast is precisely what I wanted to achieve.
> The extra paragraph marks don't need to stand out.  The text being 
> edited needs to be prominent.

What I meant is that lightgray and white colors seem almost the same color.

I've just tried with darkgray instead of lightgray, it seems better, the 
text (white foreground) is more prominent than newline (darkgray 
foreground).





^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-26  2:39                                                 ` Drew Adams
@ 2008-07-26 13:46                                                   ` Vinicius Jose Latorre
  0 siblings, 0 replies; 52+ messages in thread
From: Vinicius Jose Latorre @ 2008-07-26 13:46 UTC (permalink / raw)
  To: Drew Adams
  Cc: 'David Reitter', 'Chong Yidong', emacs-devel,
	'Dan Nicolaescu', 'Stefan Monnier', raman,
	'Miles Bader'


>> FWIW2: whitespace package visualize tabs, (hard) spaces and 
>> newlines via display table and/or faces. To visualize as
>> Framemaker (OpenOffice, Word, etc.), just use display table,
>> that is: (setq whitespace-style '(space-mark tab-mark newline-mark))
>>
>> FWIW3: whitespace also toggles display of all text symbols at once.
>>     
>
> Sounds good. I didn't try your code; I was just offering some feedback based on
> the images you sent, in case it helped.
>   

Feedback, like yours and David's, helps to improve whitespace package.

Please, try whitespace and see what could/should be 
improved/extended/generalized.





^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-17 23:44         ` Chong Yidong
  2008-07-18  4:35           ` Miles Bader
@ 2008-07-28 13:45           ` Juri Linkov
  2008-07-28 14:11             ` Miles Bader
  2008-07-28 14:12             ` Chong Yidong
  1 sibling, 2 replies; 52+ messages in thread
From: Juri Linkov @ 2008-07-28 13:45 UTC (permalink / raw)
  To: Chong Yidong; +Cc: David Reitter, emacs-devel, Stefan Monnier, raman

>> The following patch implements this approach.  I've taken bits from
>> visual-line.el, and re-written other bits to make use of the new
>> features of vertical-motion in Emacs 23.
>>
>> Could people try it out and see if it DTRT?
>
> Since no one has commented, I've gone ahead and checked in
> visual-line-mode into CVS.  Problem reports would be welcome.

It seems that keys M-[ and M-] are more suitable for moving to the
beginning/end of the real line because similar keys M-{ and M-} are
bound to commands that move point to the beginning/end of the paragraph.

Maybe better keys for moving to the next/previous real line are
M-down and M-up?

-- 
Juri Linkov
http://www.jurta.org/emacs/




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  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
  1 sibling, 1 reply; 52+ messages in thread
From: Miles Bader @ 2008-07-28 14:11 UTC (permalink / raw)
  To: Juri Linkov
  Cc: David Reitter, Chong Yidong, raman, Stefan Monnier, emacs-devel

Juri Linkov <juri@jurta.org> writes:
> It seems that keys M-[ and M-] are more suitable for moving to the
> beginning/end of the real line because similar keys M-{ and M-} are
> bound to commands that move point to the beginning/end of the paragraph.

M-[ and M-] are not so good because they are commonly used as a prefix
for terminal function keys.

-Miles

-- 
Faith, n. Belief without evidence in what is told by one who speaks without
knowledge, of things without parallel.




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-28 13:45           ` Juri Linkov
  2008-07-28 14:11             ` Miles Bader
@ 2008-07-28 14:12             ` Chong Yidong
  1 sibling, 0 replies; 52+ messages in thread
From: Chong Yidong @ 2008-07-28 14:12 UTC (permalink / raw)
  To: Juri Linkov; +Cc: David Reitter, emacs-devel, Stefan Monnier, raman

Juri Linkov <juri@jurta.org> writes:

>>> The following patch implements this approach.  I've taken bits from
>>> visual-line.el, and re-written other bits to make use of the new
>>> features of vertical-motion in Emacs 23.
>>>
>>> Could people try it out and see if it DTRT?
>>
>> Since no one has commented, I've gone ahead and checked in
>> visual-line-mode into CVS.  Problem reports would be welcome.
>
> It seems that keys M-[ and M-] are more suitable for moving to the
> beginning/end of the real line because similar keys M-{ and M-} are
> bound to commands that move point to the beginning/end of the paragraph.

That makes sense.




^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: line-line-move-visual: was line motion problem
  2008-07-28 14:11             ` Miles Bader
@ 2008-07-28 14:35               ` Juri Linkov
  0 siblings, 0 replies; 52+ messages in thread
From: Juri Linkov @ 2008-07-28 14:35 UTC (permalink / raw)
  To: Miles Bader
  Cc: David Reitter, Chong Yidong, raman, Stefan Monnier, emacs-devel

> Juri Linkov <juri@jurta.org> writes:
>> It seems that keys M-[ and M-] are more suitable for moving to the
>> beginning/end of the real line because similar keys M-{ and M-} are
>> bound to commands that move point to the beginning/end of the paragraph.
>
> M-[ and M-] are not so good because they are commonly used as a prefix
> for terminal function keys.

Then maybe M-home and M-end to move to the beginning/end of the real line.

-- 
Juri Linkov
http://www.jurta.org/emacs/




^ permalink raw reply	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2008-07-28 14:35 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).