From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: C-n and C-a Date: Thu, 12 Feb 2009 00:45:48 +0200 Organization: JURTA Message-ID: <87vdrgwq1v.fsf@jurta.org> References: <8763jotmim.fsf@jurta.org> <873aerpn4y.fsf@cyd.mit.edu> <87vdrln48c.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1234394306 16391 80.91.229.12 (11 Feb 2009 23:18:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Feb 2009 23:18:26 +0000 (UTC) Cc: Chong Yidong , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 12 00:19:41 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LXOMg-0006HQ-Jn for ged-emacs-devel@m.gmane.org; Thu, 12 Feb 2009 00:19:34 +0100 Original-Received: from localhost ([127.0.0.1]:51649 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LXOLM-0008KZ-Om for ged-emacs-devel@m.gmane.org; Wed, 11 Feb 2009 18:18:12 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LXOKT-0007qL-P6 for emacs-devel@gnu.org; Wed, 11 Feb 2009 18:17:17 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LXOKQ-0007nv-6Z for emacs-devel@gnu.org; Wed, 11 Feb 2009 18:17:16 -0500 Original-Received: from [199.232.76.173] (port=44174 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LXOKQ-0007nn-2V for emacs-devel@gnu.org; Wed, 11 Feb 2009 18:17:14 -0500 Original-Received: from relay03.kiev.sovam.com ([62.64.120.201]:60741) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LXOKP-00011H-Mg for emacs-devel@gnu.org; Wed, 11 Feb 2009 18:17:13 -0500 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay03.kiev.sovam.com with esmtp (Exim 4.69) (envelope-from ) id 1LXOKM-000Awl-5N; Thu, 12 Feb 2009 01:17:10 +0200 In-Reply-To: (Stefan Monnier's message of "Sun, 08 Feb 2009 15:08:57 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.90 (x86_64-pc-linux-gnu) X-Scanner-Signature: a89dff86c47152c77ba722073511b1ec X-DrWeb-checked: yes X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:108994 Archived-At: >> 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/