emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Escape slashes in ARCHIVE_OLPATH
@ 2012-11-05 13:13 Takafumi Arakaki
  2012-11-09  8:57 ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Takafumi Arakaki @ 2012-11-05 13:13 UTC (permalink / raw)
  To: emacs-orgmode

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

Currently information about tree structure is lost if you have a slash
in node headings.  This patch fixes the problem by escaping slashes in
headings before concatenating them.

Takafumi

[-- Attachment #2: archive_olpath.patch --]
[-- Type: application/octet-stream, Size: 701 bytes --]

diff --git a/lisp/org-archive.el b/lisp/org-archive.el
index d41a1d3..774443f 100644
--- a/lisp/org-archive.el
+++ b/lisp/org-archive.el
@@ -219,7 +219,12 @@ this heading."
 	    (file (abbreviate-file-name
 		   (or (buffer-file-name (buffer-base-buffer))
 		       (error "No file associated to buffer"))))
-	    (olpath (mapconcat 'identity (org-get-outline-path) "/"))
+	    (olpath (mapconcat
+		     (lambda (s)
+		       (setq s (replace-regexp-in-string "\\\\" "\\\\\\\\" s))
+		       (setq s (replace-regexp-in-string "/" "\\\\/" s))
+		       s)
+		     (org-get-outline-path) "/"))
 	    (time (format-time-string
 		   (substring (cdr org-time-stamp-formats) 1 -1)
 		   (current-time)))

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-11-09 15:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-05 13:13 [PATCH] Escape slashes in ARCHIVE_OLPATH Takafumi Arakaki
2012-11-09  8:57 ` Nicolas Goaziou
2012-11-09 13:26   ` Takafumi Arakaki
2012-11-09 13:28     ` Nicolas Goaziou
2012-11-09 14:41       ` Takafumi Arakaki
2012-11-09 15:27         ` Nicolas Goaziou

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).