From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] Make org-[beginning|end]-of-line respect visual-line-mode Date: Tue, 06 Nov 2012 20:41:08 +0100 Message-ID: <87bofa7c4r.fsf@gmail.com> References: <87fw4m7hfw.fsf@gmail.com> <20121106184629.GA8539@c3po> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVp5V-0001Gm-46 for emacs-orgmode@gnu.org; Tue, 06 Nov 2012 14:45:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TVp5P-0006ON-4U for emacs-orgmode@gnu.org; Tue, 06 Nov 2012 14:45:28 -0500 Received: from mail-wi0-f177.google.com ([209.85.212.177]:60612) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TVp5O-0006OD-Ta for emacs-orgmode@gnu.org; Tue, 06 Nov 2012 14:45:23 -0500 Received: by mail-wi0-f177.google.com with SMTP id hj13so583134wib.12 for ; Tue, 06 Nov 2012 11:45:22 -0800 (PST) In-Reply-To: <20121106184629.GA8539@c3po> (Toby Cubitt's message of "Tue, 6 Nov 2012 19:46:29 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Toby Cubitt writes: > I guess you want regression tests for `end-of-line' with > `visual-line-mode' enabled? (There aren't any tests for beginning-of-line > in test-org.el currently, and the fix to org-beginning-of-line won't > actually change the behaviour, just make the code more correct.) No, I meant tests for `org-beginning-of-line', since that's the function you modified. > I've made an attempt in the attached patch, which also fixes > org-beginning-of-line as discussed. Would you mind starting a test suite for that function? > + (org-test-with-temp-text > + "A long line of text\nSome other text" > + (progn (forward-char 2) (cl-dotimes (i 1000) (insert "very ")) > + (visual-line-mode 1) (goto-char (point-min)) (org-end-of-line) > + (thing-at-point-looking-at "very")))) `dotimes' is a function defined in subr.el. No need to call cl-dotimes. Thanks for your work. Regards,