[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orgmode] [PATCH] Preserve trailing blank lines
From: |
Jason Dunsmore |
Subject: |
Re: [Orgmode] [PATCH] Preserve trailing blank lines |
Date: |
Tue, 15 Feb 2011 10:31:17 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) |
Bastien <address@hidden> writes:
> However, with your patch, I get a weird behavior.
>
> Config:
>
> ,----
> | (setq org-blank-before-new-entry '((heading . nil)
> | (plain-list-item . nil)))
> `----
>
> Test file:
>
> ,----
> | * Section
> |
> | ** Subsection 1
> | Body
> |
> | ** Subsection 2
> | Body
> `----
>
> Trying to move Subsection 1 down (with org-metadown):
>
> ,----
> | * Section
> | Body <<<<<< ??
> |
> | ** Subsection 2
> |
> | ** Subsection 1
> | Body
> `----
>
> Are you able to reproduce this?
I finally had a chance to test this out with the latest Org from git and
a vanilla Emacs config, and I was unable to reproduce the behavior you
saw. Here is what I did:
$ git clone git://orgmode.org/org-mode.git
$ emacs23 -Q &
(Edit org.el to re-introduce patch.)
$ cd org-mode/
$ git diff
diff --git a/lisp/org.el b/lisp/org.el
index 164081c..4329def 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -18507,10 +18507,10 @@ Taken from `count' in cl-seq.el with all keyword argum
"Move backwards over whitespace, to the beginning of the first empty line.
Returns the number of empty lines passed."
(let ((pos (point)))
- (skip-chars-backward " \t\n\r")
- ;; (if (cdr (assoc 'heading org-blank-before-new-entry))
- ;; (skip-chars-backward " \t\n\r")
- ;; (forward-line -1))
+ ;;(skip-chars-backward " \t\n\r")
+ (if (cdr (assoc 'heading org-blank-before-new-entry))
+ (skip-chars-backward " \t\n\r")
+ (forward-line -1))
(beginning-of-line 2)
(goto-char (min (point) pos))
(count-lines (point) pos)))
Then I evaluated the following in Emacs:
(delete "/usr/share/emacs/23.2/lisp/org/" load-path)
(add-to-list 'load-path "~/tmp/org-mode/lisp")
(require 'org-install)
(setq org-blank-before-new-entry '((heading . nil)
(plain-list-item . nil)))
You can see what happened on my screen with the following:
wget http://98.129.169.48/tmp/emacs-testing.time
wget http://98.129.169.48/tmp/emacs-testing.script
scriptreplay emacs-testing.time emacs-testing.script
Would you mind testing it out again?
Regards,
Jason