summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis Anaya <papoanaya@hotmail.com>2012-08-08 12:31:05 -0400
committerLuis Anaya <papoanaya@hotmail.com>2012-08-08 12:31:05 -0400
commita3778633c50ef026f025b847408dbf5419740b36 (patch)
treeb9899a985e2a9f9f0ba3b8f150252d478bb41839
parentced90464dd2b095a9f38c5bd756dd2aed6d4ef90 (diff)
downloadorg-mode-a3778633c50ef026f025b847408dbf5419740b36.tar.gz
Removed not needed variables in org-e-groff.el and org-e-man.el
* org-e-groff.el (org-e-groff-item): Removed the `counter' variable from let assignment list. (org-e-groff-table--align-string): Removed the `attr' and `align' variables from the list assignment list. * org-e-man.el (org-e-man-item): Removed the `counter' variable from the let assignment list. (org-e-man-src-block): Removed non needed formatting string that was causing formatting errors for source blocks. (org-e-man-table--align-string): Removed `attr' and `align' variables from the let assignment list.
-rw-r--r--contrib/lisp/org-e-groff.el82
-rw-r--r--contrib/lisp/org-e-man.el43
2 files changed, 39 insertions, 86 deletions
diff --git a/contrib/lisp/org-e-groff.el b/contrib/lisp/org-e-groff.el
index d959f8e..de832d2 100644
--- a/contrib/lisp/org-e-groff.el
+++ b/contrib/lisp/org-e-groff.el
@@ -1053,15 +1053,7 @@ contextual information."
"Transcode an ITEM element from Org to Groff.
CONTENTS holds the contents of the item. INFO is a plist holding
contextual information."
- (let* ((counter
- ;; FIXME
- ;; (let ((count (org-element-property :counter item))
- ;; (level
- ;; (loop for parent in (org-export-get-genealogy item)
- ;; count (eq (org-element-type parent) 'plain-list)
- ;; until (eq (org-element-type parent) 'headline)))))
- )
- (bullet (org-element-property :bullet item))
+ (let* ((bullet (org-element-property :bullet item))
(type (org-element-property
:type (org-element-property :parent item)))
(checkbox (case (org-element-property :checkbox item)
@@ -1566,47 +1558,37 @@ contextual information."
"Return an appropriate Groff alignment string.
TABLE is the considered table. INFO is a plist used as
a communication channel."
- (let* ((attr
- (read (format "(%s)"
- (mapconcat #'identity
- (org-element-property :attr_groff table)
- " "))))
- (align
- (case (plist-get attr :align)
- ('center "c")
- ('left "l")
- ('right "r"))))
-
- (let (alignment)
- ;; Extract column groups and alignment from first (non-rule) row.
- (org-element-map
- (org-element-map
- table 'table-row
- (lambda (row)
- (and (eq (org-element-property :type row) 'standard) row))
- info 'first-match)
- 'table-cell
- (lambda (cell)
- (let* ((borders (org-export-table-cell-borders cell info))
- (raw-width (org-export-table-cell-width cell info))
- (width-cm (when raw-width (/ raw-width 5)))
- (width (if raw-width (format "w(%dc)"
- (if (< width-cm 1) 1 width-cm)) "")))
- ;; Check left border for the first cell only.
- ;; FIXME: alignment is always nil.
- (when (and (memq 'left borders) (not alignment))
- (push "|" alignment))
- (push
- (if (not align)
- (case (org-export-table-cell-alignment cell info)
- (left (concat "l" width divider))
- (right (concat "r" width divider))
- (center (concat "c" width divider)))
- (concat align divider))
- alignment)
- (when (memq 'right borders) (push "|" alignment))))
- info)
- (apply 'concat (reverse alignment)))))
+ (let (alignment)
+ (org-element-map
+ (org-element-map
+ table 'table-row
+ (lambda (row)
+ (and (eq (org-element-property :type row) 'standard) row))
+ info 'first-match)
+ 'table-cell
+ (lambda (cell)
+ (let* ((borders (org-export-table-cell-borders cell info))
+ (raw-width (org-export-table-cell-width cell info))
+ (width-cm (when raw-width (/ raw-width 5)))
+ (width (if raw-width (format "w(%dc)"
+ (if (< width-cm 1) 1 width-cm)) "")))
+
+ ;; Check left border for the first cell only.
+ ;; Alignment is nil on assignment
+
+ (when (and (memq 'left borders) (not alignment))
+ (push "|" alignment)) ;; Not nil after push
+
+ (push
+ (case (org-export-table-cell-alignment cell info)
+ (left (concat "l" width divider))
+ (right (concat "r" width divider))
+ (center (concat "c" width divider)))
+ alignment)
+
+ (when (memq 'right borders) (push "|" alignment))))
+ info)
+ (apply 'concat (reverse alignment))))
(defun org-e-groff-table--org-table (table contents info)
"Return appropriate Groff code for an Org table.
diff --git a/contrib/lisp/org-e-man.el b/contrib/lisp/org-e-man.el
index 146fff8..981f831 100644
--- a/contrib/lisp/org-e-man.el
+++ b/contrib/lisp/org-e-man.el
@@ -634,16 +634,7 @@ contextual information."
CONTENTS holds the contents of the item. INFO is a plist holding
contextual information."
- (let* ((counter
- (let ((count (org-element-property :counter item))
- (level
- (loop for parent in (org-export-get-genealogy item)
- count (eq (org-element-type parent) 'plain-list)
- until (eq (org-element-type parent) 'headline))))
- (and count
- (< level 5)
- (concat ""))))
- (bullet (org-element-property :bullet item))
+ (let* ((bullet (org-element-property :bullet item))
(type (org-element-property :type (org-element-property :parent item)))
(checkbox (case (org-element-property :checkbox item)
(on "\\o'\\(sq\\(mu'") ;;
@@ -895,13 +886,10 @@ contextual information."
(cond
;; Case 1. No source fontification.
((not org-e-man-source-highlight)
- (let ((caption-str (org-e-man--caption/label-string caption label info))
- (float-env (when caption ".RS\n.nf\\fC%s\\fP\n.fi.RE\n")))
- (format
- (or float-env "%s")
- (concat
+ (let ((caption-str (org-e-man--caption/label-string caption label info)))
+ (concat
(format ".RS\n.nf\n\\fC%s\\fP\n.fi\n.RE\n\n"
- (org-export-format-code-default src-block info))))))
+ (org-export-format-code-default src-block info)))))
((and org-e-man-source-highlight)
(let* ((tmpdir (if (featurep 'xemacs)
temp-directory
@@ -1010,22 +998,7 @@ contextual information."
"Return an appropriate Man alignment string.
TABLE is the considered table. INFO is a plist used as
a communication channel."
- (let* ((attr
- (read
- (format
- "(%s)"
- (mapconcat
- #'identity
- (org-element-property :attr_man table)
- " "))))
-
- (align
- (case (plist-get attr :align)
- ('center "c")
- ('left "l")
- ('right "r"))))
-
- (let (alignment)
+(let (alignment)
;; Extract column groups and alignment from first (non-rule)
;; row.
(org-element-map
@@ -1045,16 +1018,14 @@ a communication channel."
(when (and (memq 'left borders) (not alignment))
(push "|" alignment))
(push
- (if (not align)
- (case (org-export-table-cell-alignment cell info)
+ (case (org-export-table-cell-alignment cell info)
(left (concat "l" width divider))
(right (concat "r" width divider))
(center (concat "c" width divider)))
- (concat align divider))
alignment)
(when (memq 'right borders) (push "|" alignment))))
info)
- (apply 'concat (reverse alignment)))))
+ (apply 'concat (reverse alignment))))
(defun org-e-man-table--org-table (table contents info)
"Return appropriate Man code for an Org table.