Browse Source

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.

Luis Anaya 12 years ago
parent
commit
a3778633c5
2 changed files with 39 additions and 86 deletions
  1. 32 50
      contrib/lisp/org-e-groff.el
  2. 7 36
      contrib/lisp/org-e-man.el

+ 32 - 50
contrib/lisp/org-e-groff.el

@@ -1053,15 +1053,7 @@ contextual information."
   "Transcode an ITEM element from Org to Groff.
   "Transcode an ITEM element from Org to Groff.
 CONTENTS holds the contents of the item.  INFO is a plist holding
 CONTENTS holds the contents of the item.  INFO is a plist holding
 contextual information."
 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
 		:type (org-element-property :parent item)))
 		:type (org-element-property :parent item)))
          (checkbox (case (org-element-property :checkbox item)
          (checkbox (case (org-element-property :checkbox item)
@@ -1566,47 +1558,37 @@ contextual information."
   "Return an appropriate Groff alignment string.
   "Return an appropriate Groff alignment string.
 TABLE is the considered table.  INFO is a plist used as
 TABLE is the considered table.  INFO is a plist used as
 a communication channel."
 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)
 (defun org-e-groff-table--org-table (table contents info)
   "Return appropriate Groff code for an Org table.
   "Return appropriate Groff code for an Org table.

+ 7 - 36
contrib/lisp/org-e-man.el

@@ -634,16 +634,7 @@ contextual information."
 CONTENTS holds the contents of the item.  INFO is a plist holding
 CONTENTS holds the contents of the item.  INFO is a plist holding
 contextual information."
 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)))
          (type (org-element-property :type (org-element-property :parent item)))
          (checkbox (case (org-element-property :checkbox item)
          (checkbox (case (org-element-property :checkbox item)
                      (on "\\o'\\(sq\\(mu'")			;;
                      (on "\\o'\\(sq\\(mu'")			;;
@@ -895,13 +886,10 @@ contextual information."
     (cond
     (cond
      ;; Case 1.  No source fontification.
      ;; Case 1.  No source fontification.
      ((not org-e-man-source-highlight)
      ((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"
           (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)
      ((and org-e-man-source-highlight)
        (let* ((tmpdir (if (featurep 'xemacs)
        (let* ((tmpdir (if (featurep 'xemacs)
                           temp-directory
                           temp-directory
@@ -1010,22 +998,7 @@ contextual information."
   "Return an appropriate Man alignment string.
   "Return an appropriate Man alignment string.
 TABLE is the considered table.  INFO is a plist used as
 TABLE is the considered table.  INFO is a plist used as
 a communication channel."
 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)
       ;; Extract column groups and alignment from first (non-rule)
       ;; row.
       ;; row.
       (org-element-map
       (org-element-map
@@ -1045,16 +1018,14 @@ a communication channel."
            (when (and (memq 'left borders) (not alignment))
            (when (and (memq 'left borders) (not alignment))
              (push "|" alignment))
              (push "|" alignment))
            (push
            (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))
                   (left (concat "l" width divider))
                   (right (concat "r" width divider))
                   (right (concat "r" width divider))
                   (center (concat "c" width divider)))
                   (center (concat "c" width divider)))
-              (concat align divider))
             alignment)
             alignment)
            (when (memq 'right borders) (push "|" alignment))))
            (when (memq 'right borders) (push "|" alignment))))
        info)
        info)
-      (apply 'concat (reverse alignment)))))
+      (apply 'concat (reverse alignment))))
 
 
 (defun org-e-man-table--org-table (table contents info)
 (defun org-e-man-table--org-table (table contents info)
   "Return appropriate Man code for an Org table.
   "Return appropriate Man code for an Org table.