diff --git a/contrib/lisp/org-e-ascii.el b/contrib/lisp/org-e-ascii.el index 42f4bc91e..c78bd1a03 100644 --- a/contrib/lisp/org-e-ascii.el +++ b/contrib/lisp/org-e-ascii.el @@ -121,6 +121,7 @@ (lambda (s v b) (org-e-ascii-export-to-ascii s v b '(:ascii-charset utf-8)))))) :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)) :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 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 "The charset allowed to represent various elements and objects. Possible values are: @@ -1355,9 +1376,12 @@ INFO is a plist holding contextual information." "Transcode a PARAGRAPH element from Org to ASCII. CONTENTS is the contents of the paragraph, as a string. INFO is the plist used as a communication channel." - (org-e-ascii--fill-string - contents - (org-e-ascii--current-text-width paragraph info) info)) + (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 + contents (org-e-ascii--current-text-width paragraph info) info))) ;;;; Plain List @@ -1726,7 +1750,7 @@ contextual information." org-e-ascii-quote-margin))) -;;; Filter +;;; Filters (defun org-e-ascii-filter-headline-blank-lines (headline back-end info) "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. This function only applies to `e-ascii' back-end. See -`org-e-ascii-headline-spacing' for information. - -For any other back-end, HEADLINE is returned as-is." +`org-e-ascii-headline-spacing' for information." (if (not org-e-ascii-headline-spacing) headline (let ((blanks (make-string (1+ (cdr org-e-ascii-headline-spacing)) ?\n))) (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 diff --git a/mk/server.mk b/mk/server.mk index ae91dae22..7cdae55db 100644 --- a/mk/server.mk +++ b/mk/server.mk @@ -65,17 +65,19 @@ elpa-dirty: @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-elpa version autoloads -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP) ln -s . $(ORGDIR) - echo "(define-package \"org\" \"$(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 "(define-package \"org\"" > org-pkg.el + echo " \"$(PKG_TAG)\" \"$(PKG_DOC)\" ($(PKG_REQ)))" >> org-pkg.el + 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)) -@$(RM) $(ORGDIR) org-pkg.el elpa-up: info card elpa-dirty archive-contents $(CP) archive-contents $(ORGDIR).tar $(SERVROOT)/pkg/daily/ archive-contents: - echo "(1 (org . [($(PKG_TAG)) nil \"$(PKG_DOC)\"])\n" > $@ \ - " (org-plus-contrib . [($(PKG_TAG)) nil \"$(PKG_DOC)\"]))" >> $@ + echo "(1 (org . [($(PKG_TAG)) ($(PKG_REQ)) \"$(PKG_DOC)\" tar])" > $@ + echo " (org-plus-contrib . [($(PKG_TAG)) ($(PKG_REQ)) \"$(PKG_DOC)\" tar]))" >> $@ elpaplus: cleanall info card elpaplus-dirty elpaplus-dirty elpaplus-up: ORG_ADD_CONTRIB=org-* @@ -84,9 +86,11 @@ elpaplus-dirty: @$(MAKE) GITVERSION=$(GITVERSION:release_%=%)-elpaplus version autoloads -@$(RM) $(ORGDIR) $(ORGTAR) $(ORGZIP) ln -s . $(ORGDIR) - echo "(define-package \"org-plus-contrib\" \"$(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 "(define-package \"org-plus-contrib\"" > org-plus-contrib-pkg.el + echo " \"$(PKG_TAG)\" \"$(PKG_DOC)\" ($(PKG_REQ)))" >> org-plus-contrib-pkg.el + 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)) -@$(RM) $(ORGDIR) org-plus-contrib-pkg.el @$(MAKE) cleanlisp