Merge branch 'master' of orgmode.org:org-mode

This commit is contained in:
Bastien Guerry 2012-09-28 00:13:04 +02:00
commit b04e66a6f8
2 changed files with 60 additions and 15 deletions

View File

@ -121,6 +121,7 @@
(lambda (s v b) (lambda (s v b)
(org-e-ascii-export-to-ascii s v b '(:ascii-charset utf-8)))))) (org-e-ascii-export-to-ascii s v b '(:ascii-charset utf-8))))))
:filters-alist ((:filter-headline . org-e-ascii-filter-headline-blank-lines) :filters-alist ((:filter-headline . org-e-ascii-filter-headline-blank-lines)
(:filter-parse-tree . org-e-ascii-filter-paragraph-spacing)
(:filter-section . org-e-ascii-filter-headline-blank-lines)) (:filter-section . org-e-ascii-filter-headline-blank-lines))
:options-alist ((:ascii-charset nil nil org-e-ascii-charset))) :options-alist ((:ascii-charset nil nil org-e-ascii-charset)))
@ -180,6 +181,26 @@ original Org buffer at the same place."
(integer :tag "Number of blank lines before contents") (integer :tag "Number of blank lines before contents")
(integer :tag "Number of blank lines after contents")))) (integer :tag "Number of blank lines after contents"))))
(defcustom org-e-ascii-indented-line-width 'auto
"Additional indentation width for the first line in a paragraph.
If the value is an integer, indent the first line of each
paragraph by this number. If it is the symbol `auto' preserve
indentation from original document."
:group 'org-export-e-ascii
:type '(choice
(integer :tag "Number of white spaces characters")
(const :tag "Preserve original width" auto)))
(defcustom org-e-ascii-paragraph-spacing 'auto
"Number of white lines between paragraphs.
If the value is an integer, add this number of blank lines
between contiguous paragraphs. If is it the symbol `auto', keep
the same number of blank lines as in the original document."
:group 'org-export-e-ascii
:type '(choice
(integer :tag "Number of blank lines")
(const :tag "Preserve original spacing" auto)))
(defcustom org-e-ascii-charset 'ascii (defcustom org-e-ascii-charset 'ascii
"The charset allowed to represent various elements and objects. "The charset allowed to represent various elements and objects.
Possible values are: Possible values are:
@ -1355,9 +1376,12 @@ INFO is a plist holding contextual information."
"Transcode a PARAGRAPH element from Org to ASCII. "Transcode a PARAGRAPH element from Org to ASCII.
CONTENTS is the contents of the paragraph, as a string. INFO is CONTENTS is the contents of the paragraph, as a string. INFO is
the plist used as a communication channel." the plist used as a communication channel."
(let ((contents (if (not (wholenump org-e-ascii-indented-line-width)) contents
(concat
(make-string org-e-ascii-indented-line-width ? )
(replace-regexp-in-string "\\`[ \t]+" "" contents)))))
(org-e-ascii--fill-string (org-e-ascii--fill-string
contents contents (org-e-ascii--current-text-width paragraph info) info)))
(org-e-ascii--current-text-width paragraph info) info))
;;;; Plain List ;;;; Plain List
@ -1726,7 +1750,7 @@ contextual information."
org-e-ascii-quote-margin))) org-e-ascii-quote-margin)))
;;; Filter ;;; Filters
(defun org-e-ascii-filter-headline-blank-lines (headline back-end info) (defun org-e-ascii-filter-headline-blank-lines (headline back-end info)
"Filter controlling number of blank lines after an headline. "Filter controlling number of blank lines after an headline.
@ -1736,13 +1760,30 @@ BACK-END is symbol specifying back-end used for export. INFO is
plist containing the communication channel. plist containing the communication channel.
This function only applies to `e-ascii' back-end. See This function only applies to `e-ascii' back-end. See
`org-e-ascii-headline-spacing' for information. `org-e-ascii-headline-spacing' for information."
For any other back-end, HEADLINE is returned as-is."
(if (not org-e-ascii-headline-spacing) headline (if (not org-e-ascii-headline-spacing) headline
(let ((blanks (make-string (1+ (cdr org-e-ascii-headline-spacing)) ?\n))) (let ((blanks (make-string (1+ (cdr org-e-ascii-headline-spacing)) ?\n)))
(replace-regexp-in-string "\n\\(?:\n[ \t]*\\)*\\'" blanks headline)))) (replace-regexp-in-string "\n\\(?:\n[ \t]*\\)*\\'" blanks headline))))
(defun org-e-ascii-filter-paragraph-spacing (tree back-end info)
"Filter controlling number of blank lines between paragraphs.
TREE is the parse tree. BACK-END is the symbol specifying
back-end used for export. INFO is a plist used as
a communication channel.
This function only applies to `e-ascii' back-end. See
`org-e-ascii-paragraph-spacing' for information."
(when (wholenump org-e-ascii-paragraph-spacing)
(org-element-map
tree 'paragraph
(lambda (p)
(when (eq (org-element-type (org-export-get-next-element p info))
'paragraph)
(org-element-put-property
p :post-blank org-e-ascii-paragraph-spacing)))))
tree)
;;; Interactive function ;;; Interactive function

View File

@ -65,17 +65,19 @@ elpa-dirty:
@$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-elpa version autoloads @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-elpa version autoloads
-@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP) -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP)
ln -s . $(ORGDIR) ln -s . $(ORGDIR)
echo "(define-package \"org\" \"$(PKG_TAG)\" \"$(PKG_DOC)\" $(PKG_REQ))" \ echo "(define-package \"org\"" > org-pkg.el
> org-pkg.el echo " \"$(PKG_TAG)\" \"$(PKG_DOC)\" ($(PKG_REQ)))" >> org-pkg.el
tar --exclude=Makefile --exclude="org-colview-xemacs.el" --transform='s:\(lisp\|doc\)/::' -cf $(ORGDIR).tar \ echo ";; no-byte-compile: t" >> org-pkg.el
tar --exclude=Makefile --exclude="org-colview-xemacs.el" \
--transform='s:\(lisp\|doc\)/::' -cf $(ORGDIR).tar \
$(foreach dist, $(ORGELPA), $(ORGDIR)/$(dist)) $(foreach dist, $(ORGELPA), $(ORGDIR)/$(dist))
-@$(RM) $(ORGDIR) org-pkg.el -@$(RM) $(ORGDIR) org-pkg.el
elpa-up: info card elpa-dirty archive-contents elpa-up: info card elpa-dirty archive-contents
$(CP) archive-contents $(ORGDIR).tar $(SERVROOT)/pkg/daily/ $(CP) archive-contents $(ORGDIR).tar $(SERVROOT)/pkg/daily/
archive-contents: archive-contents:
echo "(1 (org . [($(PKG_TAG)) nil \"$(PKG_DOC)\"])\n" > $@ \ echo "(1 (org . [($(PKG_TAG)) ($(PKG_REQ)) \"$(PKG_DOC)\" tar])" > $@
" (org-plus-contrib . [($(PKG_TAG)) nil \"$(PKG_DOC)\"]))" >> $@ echo " (org-plus-contrib . [($(PKG_TAG)) ($(PKG_REQ)) \"$(PKG_DOC)\" tar]))" >> $@
elpaplus: cleanall info card elpaplus-dirty elpaplus: cleanall info card elpaplus-dirty
elpaplus-dirty elpaplus-up: ORG_ADD_CONTRIB=org-* elpaplus-dirty elpaplus-up: ORG_ADD_CONTRIB=org-*
@ -84,9 +86,11 @@ elpaplus-dirty:
@$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-elpaplus version autoloads @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-elpaplus version autoloads
-@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP) -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP)
ln -s . $(ORGDIR) ln -s . $(ORGDIR)
echo "(define-package \"org-plus-contrib\" \"$(PKG_TAG)\" \"$(PKG_DOC)\" $(PKG_REQ))" \ echo "(define-package \"org-plus-contrib\"" > org-plus-contrib-pkg.el
> org-plus-contrib-pkg.el echo " \"$(PKG_TAG)\" \"$(PKG_DOC)\" ($(PKG_REQ)))" >> org-plus-contrib-pkg.el
tar --exclude=Makefile --exclude="org-colview-xemacs.el" --transform='s:\(lisp\|doc\)/::' -cf $(ORGDIR).tar \ echo ";; no-byte-compile: t" >> org-plus-contrib-pkg.el
tar --exclude=Makefile --exclude="org-colview-xemacs.el" \
--transform='s:\(lisp\|doc\)/::' -cf $(ORGDIR).tar \
$(foreach dist, $(ORGELPAPLUS), $(ORGDIR)/$(dist)) $(foreach dist, $(ORGELPAPLUS), $(ORGDIR)/$(dist))
-@$(RM) $(ORGDIR) org-plus-contrib-pkg.el -@$(RM) $(ORGDIR) org-plus-contrib-pkg.el
@$(MAKE) cleanlisp @$(MAKE) cleanlisp