emacs-wiki-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[emacs-wiki-discuss] Re: timeclock-summary publish and simple table mark


From: Dryice Liu
Subject: [emacs-wiki-discuss] Re: timeclock-summary publish and simple table markup
Date: Wed, 16 Mar 2005 16:03:23 +0800
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (berkeley-unix)

Dryice Liu <address@hidden> wrote:
> Recently I noticed that the table planner-timeclock-summary.el
> generated messed up after publish. And this is because some cells in
> the table are blank.
>
> I can think off two approaches to do with this:
>
> 1. Introduce some simple table markup rules to distinguish rows, like
> new line by default?
>
> 2. Add some trivial characters like "." or "_" in the blank
> cells. This will be a simple workaround.

After a good talk with dagbrown on #emacs, I realize in the simple
table markup rules, a "|" at the end of a line means the next line
will continue on the same row. This is a bad news for
planner-timeclock-summary.el cause we do have blank cells at the end
of a row.

So I decided to go with approach 2 and introduce
planner-timeclock-summary-placeholder-char. It is set to "." by
default for the benefit of new users. You can set it to " " if you
like the original behavior and don't mind publishing.

Here is the patch and they are also on my arch.

Location: http://dryice.3322.org/arch/
Archive name: address@hidden
Branch: planner--dev--1.0
patch: 32

======================================================================
--- orig/planner-timeclock-summary.el
+++ mod/planner-timeclock-summary.el
@@ -102,6 +102,13 @@
   :type 'string
   :group 'planner-timeclock-summary)
 
+(defcustom planner-timeclock-summary-placeholder-char "."
+  "Placeholder for blank cells in the report table.
+If there are have blank cells in a simple table, the generated HTML
+table will mess up. This character will be used as a placeholder."
+  :type 'character
+  :group 'planner-timeclock-summary)
+
 (defcustom planner-timeclock-summary-include-sub-plan-pages-flag nil
   "Non-nil means include 'sub plan pages' when doing plan page reports.
 
@@ -454,9 +461,12 @@
             (goto-char (point-min))
             (while (search-forward
                     planner-timeclock-summary-empty-cell-string nil t)
-              (replace-match (make-string
-                              (length 
planner-timeclock-summary-empty-cell-string)
-                              (aref " " 0))))
+              (replace-match (concat
+                             planner-timeclock-summary-placeholder-char
+                             (make-string
+                              (- (length 
planner-timeclock-summary-empty-cell-string) 
+                                 1)
+                              (aref " " 0)))))
             (goto-char (point-max))
             (unless hide-summary
               (insert (planner-timeclock-summary-make-summary-string-range
======================================================================

-- 
Dryice @ http://dryice.3322.org

Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/sylvester-response.html




reply via email to

[Prev in Thread] Current Thread [Next in Thread]