unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Chong Yidong <cyd@stupidchicken.com>, emacs-devel@gnu.org
Subject: Re: C-n and C-a
Date: Thu, 12 Feb 2009 00:45:48 +0200	[thread overview]
Message-ID: <87vdrgwq1v.fsf@jurta.org> (raw)
In-Reply-To: <jwvfxiozo7h.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sun, 08 Feb 2009 15:08:57 -0500")

>> For starters, the following patch does this for dired-mode:
>
> FWIW, I think the right patch for dired would be to set truncate-lines
> to t.

I have no opinion on the default of truncate-lines in dired but I think
setting word-wrap to nil in dired-mode is necessary as well to prevent
the problem I described in the case when someone sets truncate-lines to nil
and word-wrap to t globally.

There are also two other ways to mitigate the word-wrap problem in Dired:

1. display arrows at the right fringe in visual-line-mode indicating
that the file name is wrapped to the left side of the dired buffer;

2. add an option to the variable word-wrap to wrap at word boundaries
instead of whitespace as is currently implemented.  Thus wrapping might
occur inside a long file name that has non-word non-whitespace characters,
and it's likely that at least the first word will remain unwrapped.
However, this is not for the coming release.

For the same reason I think we should not set word-mode in
visual-line-mode.  Someone might want to enable visual-line-mode in
dired and stumble upon the same problem.  The following patch
fixes this.

Also there is a problem with the terminology.  The term "logical line"
causes cognitive dissonance - it is a common synonym of "virtual line"
and is opposite to the "real line".  But currently "logical line"
is used as a synonym of "real line".

From Jargon File 4.4.4 (14 Aug 2003):

  virtual

     1. Common alternative to logical; often used to refer to the
     artificial objects (like addressable virtual memory larger than
     physical memory) simulated by a computer system as a convenient way
     to manage access to shared resources.

     2. Simulated; performing the functions of something that isn't
     really there. An imaginative child's doll may be a virtual playmate.
     Oppose real.

I suggest using the term "real lines" instead of "logical lines".

Index: lisp/simple.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/simple.el,v
retrieving revision 1.971
diff -c -r1.971 simple.el
*** lisp/simple.el	8 Feb 2009 00:46:38 -0000	1.971
--- lisp/simple.el	11 Feb 2009 22:44:57 -0000
***************
*** 4554,4564 ****
  (defvar visual-line--saved-state nil)
  
  (define-minor-mode visual-line-mode
!   "Redefine simple editing commands to act on visual lines, not logical lines.
! This also turns on `word-wrap' in the buffer."
    :keymap visual-line-mode-map
    :group 'visual-line
    :lighter " wrap"
--- 4564,4574 ----
  (defvar visual-line--saved-state nil)
  
  (define-minor-mode visual-line-mode
!   "Redefine simple editing commands to act on visual lines, not real lines.
! This also turns off `truncate-lines' in the buffer."
    :keymap visual-line-mode-map
    :group 'visual-line
    :lighter " wrap"
***************
*** 4566,4584 ****
  	;; visual-line-mode is turned off.
  	(dolist (var '(line-move-visual truncate-lines
  		       truncate-partial-width-windows
! 		       word-wrap fringe-indicator-alist))
  	  (if (local-variable-p var)
  	      (push (cons var (symbol-value var))
  		    visual-line--saved-state)))
  	(set (make-local-variable 'line-move-visual) t)
  	(set (make-local-variable 'truncate-partial-width-windows) nil)
  	(setq truncate-lines nil
- 	      word-wrap t
  	      fringe-indicator-alist
  	      (cons (cons 'continuation visual-line-fringe-indicators)
  		    fringe-indicator-alist)))
      (kill-local-variable 'line-move-visual)
-     (kill-local-variable 'word-wrap)
      (kill-local-variable 'truncate-lines)
      (kill-local-variable 'truncate-partial-width-windows)
      (kill-local-variable 'fringe-indicator-alist)
--- 4576,4592 ----
  	;; visual-line-mode is turned off.
  	(dolist (var '(line-move-visual truncate-lines
  		       truncate-partial-width-windows
! 		       fringe-indicator-alist))
  	  (if (local-variable-p var)
  	      (push (cons var (symbol-value var))
  		    visual-line--saved-state)))
  	(set (make-local-variable 'line-move-visual) t)
  	(set (make-local-variable 'truncate-partial-width-windows) nil)
  	(setq truncate-lines nil
  	      fringe-indicator-alist
  	      (cons (cons 'continuation visual-line-fringe-indicators)
  		    fringe-indicator-alist)))
      (kill-local-variable 'line-move-visual)
      (kill-local-variable 'truncate-lines)
      (kill-local-variable 'truncate-partial-width-windows)
      (kill-local-variable 'fringe-indicator-alist)

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




  parent reply	other threads:[~2009-02-11 22:45 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-29 14:32 C-n and C-a Richard M Stallman
2009-01-29 15:10 ` Tassilo Horn
2009-01-29 16:09   ` Harald Hanche-Olsen
2009-01-29 17:15     ` Tassilo Horn
2009-01-29 19:40   ` Adrian Robert
2009-01-30  0:32   ` Juri Linkov
2009-01-30  1:20     ` Stefan Monnier
2009-01-30  9:45       ` Eli Zaretskii
2009-01-31 17:45       ` Juri Linkov
2009-01-31 19:47         ` Stefan Monnier
2009-02-02  1:45           ` Juri Linkov
2009-01-31 20:33         ` Chong Yidong
2009-02-02  1:47           ` Juri Linkov
2009-01-30  7:25   ` Richard M Stallman
2009-01-29 18:24 ` Karl Fogel
2009-01-29 18:48   ` Harald Hanche-Olsen
2009-01-29 21:41 ` Stefan Monnier
2009-01-30 16:07   ` Sascha Wilde
2009-01-31 20:34   ` Chong Yidong
2009-01-30  0:29 ` Juri Linkov
2009-01-30  6:12   ` mail
2009-01-31 17:45     ` Juri Linkov
2009-01-31 22:35       ` Drew Adams
2009-02-01 20:11         ` Leo
2009-02-03 15:11           ` Carsten Dominik
2009-02-02  1:54         ` Juri Linkov
2009-02-02  2:25           ` Drew Adams
2009-02-02  9:45             ` Juri Linkov
2009-02-06  0:45 ` Juri Linkov
2009-02-06 16:04   ` Chong Yidong
2009-02-08  0:48     ` Juri Linkov
2009-02-08 20:08       ` Stefan Monnier
2009-02-09 21:22         ` Christian Schlauer
2009-02-09 22:02         ` Drew Adams
2009-02-10  2:05           ` Stefan Monnier
2009-02-10  3:11             ` Drew Adams
2009-02-11 22:45         ` Juri Linkov [this message]
2009-02-12  2:01           ` Miles Bader
2009-02-12 10:05             ` Juri Linkov
2009-02-12 11:04               ` Miles Bader
2009-02-13  6:33                 ` Richard M Stallman
2009-02-07  1:52   ` Stefan Monnier

Reply instructions:

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

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

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87vdrgwq1v.fsf@jurta.org \
    --to=juri@jurta.org \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

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

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