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

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

[emacs-wiki-discuss] patch to planner-log-edit.el: quote filenames with


From: Dryice Liu
Subject: [emacs-wiki-discuss] patch to planner-log-edit.el: quote filenames with "="
Date: Mon, 13 Dec 2004 10:34:12 +0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (berkeley-unix)

I'm using planner-log-edit.el a lot and it is really great to look at
all the changes I've made at the end of the day :) One problem I've
got is that some of my file/directory names are in CamelCase so they
are rendered as an empty wiki name, which is pretty annoying.

The attached path to planner-log-edit.el add a new variable,
planner-log-edit-quote-filenames, which if is set to t, the
file/directory names will be quoted with "=" so they are no longer
rendered as a wiki name. The variable is set to nil by default to keep
the original behavior.

======================================================================
--- planner-log-edit.el.orig    Mon Dec  6 10:57:22 2004
+++ planner-log-edit.el Sun Dec 12 23:57:38 2004
@@ -41,6 +41,12 @@
   :type 'boolean
   :group 'planner-log-edit)
 
+(defcustom planner-log-edit-quote-filenames
+  nil
+  "Non-nil means quote the file names with \"=\". "
+  :type 'boolean
+  :group 'planner-log-edit)
+
 (defcustom planner-log-edit-notice-commit-function t
   "Function that should return non-nil if this commit should be noted.
 The function will be run in the log buffer."
@@ -49,6 +55,15 @@
           function)
   :group 'planner-log-edit)
   
+(defun planner-log-edit-quote-maybe ()
+  (if planner-log-edit-quote-filenames
+      (format "=")
+    (format "")))
+
+(defun planner-log-edit-quote-file-maybe (arg)
+  (format "%s%s%s" (planner-log-edit-quote-maybe) arg
+         (planner-log-edit-quote-maybe)))
+
 (defun planner-log-edit-add-note ()
   "Add a note describing the commit to the current planner page."
   (let* ((buffer (current-buffer))
@@ -64,11 +79,14 @@
           (save-window-excursion
             (planner-create-note nil)
             (insert "Commit"
-                    (when module-name (concat " in " module-name)))
+                    (when module-name (concat " in "
+                                             (planner-log-edit-quote-maybe)
+                                             module-name
+                                             (planner-log-edit-quote-maybe))))
             (newline)
             (when planner-log-edit-include-files-flag
               (insert "Files: ")
-              (insert (mapconcat 'identity files " "))
+              (insert (mapconcat 'planner-log-edit-quote-file-maybe files " "))
               (newline)(newline))
             (insert-buffer-substring buffer))))))
====================================================================== 


-- 
Cheers,
Dryice

http://dryice.3322.org





reply via email to

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