emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] org-attach-commit: Split by nulls and two typos.
@ 2010-03-29 16:11 Mikael Fornius
  0 siblings, 0 replies; only message in thread
From: Mikael Fornius @ 2010-03-29 16:11 UTC (permalink / raw)
  To: Org Mode

[-- Attachment #1: Type: text/plain, Size: 560 bytes --]


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.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: org-attach-commit-and-typos --]
[-- Type: text/x-patch, Size: 2432 bytes --]

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  <mfo@abc.se>
+
+	* 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  <carsten.dominik@gmail.com>
 
 	* 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))
 

[-- Attachment #3: Type: text/plain, Size: 20 bytes --]


-- 
Mikael Fornius

[-- Attachment #4: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-03-29 16:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-29 16:11 [PATCH] org-attach-commit: Split by nulls and two typos Mikael Fornius

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).