emacs-orgmode
[Top][All Lists]
Advanced

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

[Orgmode] [PATCH] org-attach-commit: Split by nulls and two typos.


From: Mikael Fornius
Subject: [Orgmode] [PATCH] org-attach-commit: Split by nulls and two typos.
Date: Mon, 29 Mar 2010 18:11:48 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1.92 (gnu/linux)

I got a problem when doing attachments (C-c C-a c/m/c). My *Messages*
buffer is flooded with:

  "fatal: pathspec 'x' did not match any files"

messages. This is because the `split-string' function call in
`org-attach-commit' does not split correctly in my emacs version
(23.1.92.1).

Maybe other emacs versions split by NULL-characters when SEPARATORS is
the empty string but mine does not so I suggest the attached change.

It fixes this problem for me and is also correcting two other typos
found when recompiling.

Patch is against the current git head.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 23e2426..58703ed 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
+2010-03-29  Mikael Fornius  <address@hidden>
+
+       * org-html.el (org-export-html-preprocess): Fix typo.
+
+       * org-publish.el (org-publish-sanitize-plist): Fix typo.
+
+       * org-attach.el (org-attach-commit): Split by null character fix.
+
 2010-03-29  Carsten Dominik  <address@hidden>
 
        * org-agenda.el (org-diary-last-run-time): New variable.
diff --git a/lisp/org-attach.el b/lisp/org-attach.el
index 8533a75..52a91ca 100644
--- a/lisp/org-attach.el
+++ b/lisp/org-attach.el
@@ -246,11 +246,10 @@ This checks for the existence of a \".git\" directory in 
that directory."
        (cd dir)
        (shell-command "git add .")
        (shell-command "git ls-files --deleted -z" t)
-       (mapc '(lambda (file)
-                (unless (string= file "")
-                  (shell-command
-                   (concat "git rm \"" file "\""))))
-             (split-string (buffer-string) ""))
+       (mapc (lambda (file)
+               (shell-command
+                (concat "git rm \"" file "\"")))
+             (split-string (buffer-string) "[\0]" t))
        (shell-command "git commit -m 'Synchronized attachments'")))))
 
 (defun org-attach-tag (&optional off)
diff --git a/lisp/org-html.el b/lisp/org-html.el
index b8925e7..4ae694d 100644
--- a/lisp/org-html.el
+++ b/lisp/org-html.el
@@ -443,7 +443,7 @@ This may also be a function, building and inserting the 
postamble.")
          (if (string-match "\\`[a-z]\\{1,10\\}:\\(.+\\)" label)
              (setq l1 (substring label (match-beginning 1)))
            (setq l1 label)))
-       (replace-match (format "[[#%s][l1]]" label l1) t t)))))
+       (replace-match (format "[[#%s][%s]]" label l1) t t)))))
 
 ;;;###autoload
 (defun org-export-as-html-and-open (arg)
diff --git a/lisp/org-publish.el b/lisp/org-publish.el
index c8b06c5..8633140 100644
--- a/lisp/org-publish.el
+++ b/lisp/org-publish.el
@@ -42,11 +42,11 @@
 
 (defun org-publish-sanitize-plist (plist)
   (mapcar (lambda (x)
-           (or (cdr (assoq x '((:index-filename . :sitemap-filename)
-                               (:index-title . :sitemap-title)
-                               (:index-function . :sitemap-function)
-                               (:index-style . :sitemap-style)
-                               (:auto-index . :auto-sitemap))))
+           (or (cdr (assq x '((:index-filename . :sitemap-filename)
+                              (:index-title . :sitemap-title)
+                              (:index-function . :sitemap-function)
+                              (:index-style . :sitemap-style)
+                              (:auto-index . :auto-sitemap))))
                x))
          plist))
 
-- 
Mikael Fornius

reply via email to

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