فهرست منبع

Fix bug with showing empty lines before header

PT writes:

> I tried this new setting with 6.30 and it works well, thanks for
> this.
>
> The only strange case is when a header line doesn't have any
> content, only empty lines.
>
> So if there are 2 empty lines between headers
>
> * header1
>
>
> * header2
>
>
> Then the first empty line after header1 is folded regardless of
> the -1 setting.  If I understand the feature correctly no folding
> should occur in this case either.
Carsten Dominik 15 سال پیش
والد
کامیت
0c646a1b57
2فایلهای تغییر یافته به همراه7 افزوده شده و 1 حذف شده
  1. 2 0
      lisp/ChangeLog
  2. 5 1
      lisp/org.el

+ 2 - 0
lisp/ChangeLog

@@ -2,6 +2,8 @@
 
 	* org.el (org-offer-links-in-entry): New argument ZERO to
 	implement a link with index zero.
+	(org-cycle-show-empty-lines): Not keep empty line under header
+	hidden.
 
 	* org-agenda.el (org-agenda-open-link): Pass the prefix to
 	`org-offer-links-in-entry'.

+ 5 - 1
lisp/org.el

@@ -5261,7 +5261,11 @@ are at least `org-cycle-separator-lines' empty lines before the headline."
 		  (setq b (save-excursion
 			    (goto-char (match-beginning 0))
 			    (org-back-over-empty-lines)
-			    (point)))
+			    (if (save-excursion
+				  (goto-char (max (point-min) (1- (point))))
+				  (org-on-heading-p))
+				(1- (point))
+			      (point))))
 		(setq b (match-beginning 1)))
 	      (outline-flag-region b e nil)))))))
   ;; Never hide empty lines at the end of the file.