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

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

[PATCH] Re: [emacs-wiki-discuss] Centering in emacs-wiki


From: Mark Triggs
Subject: [PATCH] Re: [emacs-wiki-discuss] Centering in emacs-wiki
Date: Sat, 23 Jul 2005 13:11:22 +1000
User-agent: No Gnus v0.4

Johan Brannlund <address@hidden> writes:

> Hello. I have a feeling this may be a stupid question, but I'd  
> nevertheless be grateful if you could answer it. No matter how I try,  
> I'm not able to get centered paragraphs in emacs-wiki (version 2.69).  
> Even if I put a whole bunch of whitespace at the beginning of a line,  
> it only gives me a quoted paragraph. Does anyone have any idea what the  
> problem could be? I've tried starting with a blank .emacs, so it  
> doesn't seem to be an issue with my settings.

This looks like a bug in emacs-wiki-publish.el to me.  As a quick
workaround you could wrap your lines in <center>...</center> tags.

Michael: I've attached a patch against emacs-wiki-publish.el that I
think fixes this, but it's been a while since I looked at the emacs-wiki
code so you might like to check that it looks reasonable :o)

Cheers,

Mark

-- 
Mark Triggs
<address@hidden>

--- emacs-wiki-2.69-orig/emacs-wiki-publish.el  2005-04-15 07:49:48.000000000 
+1000
+++ emacs-wiki-2.69/emacs-wiki-publish.el       2005-07-23 13:06:04.000000000 
+1000
@@ -2107,14 +2107,16 @@
 like read-only from being inadvertently deleted."
   (if (null (match-string 2))
       (let ((ws (match-string 4)))
-        (unless (and (< (string-width ws) 6)
-                     (save-excursion
-                       (forward-line)
-                       (or (eolp)
-                           (looking-at "\\S-"))))
-          (emacs-wiki-surround-text (concat "<blockquote>\n<p>\n" ws)
-                                    "\n</p>\n</blockquote>\n"
-                                    'emacs-wiki-forward-paragraph)))
+        (when (save-excursion
+               (forward-line)
+               (or (eolp)
+                   (looking-at "\\S-")))
+         (let ((block-type (if (< (string-width ws) 6)
+                               "blockquote"
+                             "center")))
+           (emacs-wiki-surround-text (format "<%s>\n<p>\n%s" block-type ws)
+                                     (format "\n</p>\n</%s>\n" block-type)
+                                     'emacs-wiki-forward-paragraph))))
     (let ((str (match-string 2)))
       (cond
        ((and (eq (aref str 0) ?-))

reply via email to

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