From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Danil Orlov Newsgroups: gmane.emacs.devel Subject: Longlines mode and visual-line mode... again Date: Sun, 15 Dec 2013 22:42:36 +0200 Message-ID: <20131215204236.GG29987@debian> References: <52A941D3.4020607@cs.ucla.edu> <52A98D60.9080709@gmx.at> <52AD7F65.2090706@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1387140171 11558 80.91.229.3 (15 Dec 2013 20:42:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 15 Dec 2013 20:42:51 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 15 21:42:57 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VsIWe-0002zQ-6F for ged-emacs-devel@m.gmane.org; Sun, 15 Dec 2013 21:42:56 +0100 Original-Received: from localhost ([::1]:52445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsIWd-0008Hu-Ki for ged-emacs-devel@m.gmane.org; Sun, 15 Dec 2013 15:42:55 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33927) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsIWU-0008HE-Uz for emacs-devel@gnu.org; Sun, 15 Dec 2013 15:42:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VsIWP-0001us-3K for emacs-devel@gnu.org; Sun, 15 Dec 2013 15:42:46 -0500 Original-Received: from mail-ee0-x22b.google.com ([2a00:1450:4013:c00::22b]:59179) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VsIWO-0001sl-Sz for emacs-devel@gnu.org; Sun, 15 Dec 2013 15:42:41 -0500 Original-Received: by mail-ee0-f43.google.com with SMTP id c13so1840531eek.2 for ; Sun, 15 Dec 2013 12:42:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=VK0Qzwj5u8ALC10FFKnbDvdM5k1zmLhh2JgBqt8yNSY=; b=LXap7zOohJUWpUeVgzT8+HcCybDPyLg28l+awNtR0s/MqQFlom9XZ7c8+k1aLzIj8Z btQi7tqv0KCBy1aCmlMaQ3+ETXLt55rJG6vqGuTuQQWXgXsCYbWXHbYDwTe2mNKGQ6CU pcZsfimUKsBGg3ZTBWZ1xXn+lFzKHaBklT23wEFnaL3sIfdOx+gJlqavIeLnNBtxw3z0 VLrxaF2JP+BBOjgJjkYPiEu5HbH7BLg38HT9ofZ3ls0EBTsv6WU21Y7P0qop3mjW0I5m snVPb+BuHjqstHk1nqYRBINQ9U8H4RG+IFDGl9Z9DPTlIVGbkf+mubVqytcIk9RVfjGr 8Fag== X-Received: by 10.14.212.69 with SMTP id x45mr13341775eeo.69.1387140159735; Sun, 15 Dec 2013 12:42:39 -0800 (PST) Original-Received: from debian ([31.28.242.87]) by mx.google.com with ESMTPSA id m1sm34078685eeg.0.2013.12.15.12.42.38 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 15 Dec 2013 12:42:38 -0800 (PST) Content-Disposition: inline In-Reply-To: <52AD7F65.2090706@gmx.at> User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4013:c00::22b X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:166436 Archived-At: Hello. The main feature for me(and I hop for many others too) in longlines mode is soft line wrap on given column. Occasionally, ll-mode is obsolete, and we have visual-line instead of it. That's ok. But that new mode doesn't have this useful feature from the box. That's not ok. So, what is typical action for a typical emacs user who wants to get soft line break, avoiding to see message about ll-mode could be dropped in any next release? Right! He goes to: http://www.emacswiki.org/emacs/VisualLineMode And copy this fragment into his .emacs or what-else-he-use: ================================================================================ (defvar visual-wrap-column nil) (defun set-visual-wrap-column (new-wrap-column &optional buffer) "Force visual line wrap at NEW-WRAP-COLUMN in BUFFER (defaults to current buffer) by setting the right-hand margin on every window that displays BUFFER. A value of NIL or 0 for NEW-WRAP-COLUMN disables this behavior." (interactive (list (read-number "New visual wrap column, 0 to disable: " (or visual-wrap-column fill-column 0)))) (if (and (numberp new-wrap-column) (zerop new-wrap-column)) (setq new-wrap-column nil)) (with-current-buffer (or buffer (current-buffer)) (visual-line-mode t) (set (make-local-variable 'visual-wrap-column) new-wrap-column) (add-hook 'window-configuration-change-hook 'update-visual-wrap-column nil t) (let ((windows (get-buffer-window-list))) (while windows (when (window-live-p (car windows)) (with-selected-window (car windows) (update-visual-wrap-column))) (setq windows (cdr windows)))))) (defun update-visual-wrap-column () (if (not visual-wrap-column) (set-window-margins nil nil) (let* ((current-margins (window-margins)) (right-margin (or (cdr current-margins) 0)) (current-width (window-width)) (current-available (+ current-width right-margin))) (if (<= current-available visual-wrap-column) (set-window-margins nil (car current-margins)) (set-window-margins nil (car current-margins) (- current-available visual-wrap-column)))))) ================================================================================ And why this little piece of functionality cannot be integrated into visual-line mode? Especially if visual-line-mode is recommended as replacement for ll-mode.