Package: docdiff
Severity: wishlist
Version: 0.3.2-1
Hi,
It would be nice if there is a feature to embed anchor to HTML output,
so that editors can optionally embed location information to input,
and browser could jump to the current editing location.
http://www.netfort.gr.jp/~dancer/diary/200601.html.ja#2006-Jan-7-18:24:36
Here is a patch against view.rb, and a sample implementation of a user
of the patch.
The following patch against view.rb in docdiff is useful if you have
the following kind of elisp, which shows a docdiff of the current file
controlled with svn. Mozilla will jump to the current point.
Enjoy.
--dancerj (7 Jan 2006, Junichi Uekawa <[EMAIL PROTECTED]>)
(defun svndocdiff-current ()
"Invoke svn docdiff for the current buffer,
and run mozilla-firefox -remote openfile(filename)
to preview the diff"
(interactive)
(let* ((currentname
(buffer-file-name (current-buffer)))
(svnorigname
(concat default-directory
".svn/text-base/"
(file-name-nondirectory
(buffer-file-name (current-buffer)))
".svn-base"))
(diff-command
"/usr/bin/docdiff --html %s %s > %s")
(mozilla-command-line
"mozilla-firefox -remote 'openurl(file://%s#currentloc)'")
(moztmpfile-name
(concat default-directory
".svn/.docdifftmp.html")))
(insert "")
(save-buffer)
(backward-delete-char 1)
(shell-command
(format diff-command
svnorigname
currentname
moztmpfile-name)
"*svndocdiff*" "*svndocdiff-err*")
(shell-command
(format mozilla-command-line
moztmpfile-name)
"*svndocdiff*" "*svndocdiff-err*")))
--- view.rb.orig 2006-01-07 18:14:08.000000000 +0900
+++ view.rb 2006-01-07 18:15:50.000000000 +0900
@@ -261,7 +261,8 @@
[(@eol_char||"") + '</body></html>' + (@eol_char||"")]
end
HTMLEscapeDic = {'<'=>'<', '>'=>'>', '&'=>'&', '
'=>' ',
- "\r\n" => "<br />\r\n", "\r" => "<br />\r", "\n" => "<br
/>\n"}
+ "\r\n" => "<br />\r\n", "\r" => "<br />\r", "\n" => "<br
/>\n",
+ "" => "<a name=\"currentloc\"></a>"}
HTMLEscapePat =
/(\r\n|#{HTMLEscapeDic.keys.collect{|k|Regexp.quote(k)}.join('|')})/m
def html_tags()
{:outside_escape_dic => HTMLEscapeDic,
regards,
junichi
--
[EMAIL PROTECTED],netfort.gr.jp} Debian Project