<feed xmlns="http://www.w3.org/2005/Atom" xmlns:foaf="http://xmlns.com/foaf/0.1/"><title>norman.walsh.name: Comments on /2005/02/09/subversion</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2005/02/09/subversion"/><id>http://norman.walsh.name/2005/02/09/subversion/comments.atom</id><updated>2012-02-13T08:41:38.122329Z</updated><entry><title>Comment 1 on /2005/02/09/subversion</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2005/02/09/subversion#comment0001"/><id>http://norman.walsh.name/2010/09/25/oauth#comment0001</id><published>2005-02-10T11:48:13Z</published><updated>2005-02-10T11:48:13Z</updated><author><name>Anne</name><foaf:mbox_sha1sum>da39a3ee5e6b4b0d3255bfef95601890afd80709</foaf:mbox_sha1sum></author><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
    <p>What will happen when you need to insert a paragraph? Or delete? Will al unique links shift or stay the same?</p>
  </div></content></entry><entry><title>Comment 2 on /2005/02/09/subversion</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2005/02/09/subversion#comment0002"/><id>http://norman.walsh.name/2010/09/25/oauth#comment0002</id><published>2005-02-10T12:28:36Z</published><updated>2005-02-10T12:28:36Z</updated><author><name>Norman Walsh</name><foaf:mbox_sha1sum>da39a3ee5e6b4b0d3255bfef95601890afd80709</foaf:mbox_sha1sum></author><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
    <p>Adding a new paragraph won't change any of the existing IDs. The ID-generating code just adds a new one. Deleting a paragraph would remove its ID, but I'll probably avoid deleting paragraphs for that reason.

FWIW, here's my current hack for adding IDs:

</p>
    <pre> (defun blog:idparas () 
  (interactive)
  (save-excursion
    (let ((paracount 0)
	  (paraid 0))
      (beginning-of-buffer)
      (re-search-forward "\/info\\|\/essayinfo" nil t nil)
      (while (re-search-forward "\\|]*\\)&gt;"
				nil t nil)
	(if (match-string 3)
	    (let ((attributes (match-string 3)))
	      (if (string-match " id=[\"\']\\([^\"\']+\\)[\"\']" attributes)
		  (let ((id (match-string 1 attributes)))
		    (if (string-match "^p\\([0-9]+\\)$" id)
			(let ((idnum (string-to-number (match-string 1 id))))
			  (if (&gt; idnum paraid)
			      (setq paraid idnum)))))))))
      (setq paraid (+ paraid 1))
      (beginning-of-buffer)
      (re-search-forward "\/info\\|\/essayinfo" nil t nil)
      (while (re-search-forward "\\|]*\\)&gt;"
				nil t nil)
	(if (or (not (match-string 3))
		(not (string-match " id=[\"\']\\([^\"\']+\\)[\"\']" (match-string 3))))
	    (progn
	      (forward-char -1)
	      (insert (format " id='p27" paraid))
	      (setq paracount (+ paracount 1))
	      (setq paraid (+ paraid 1)))))
      (message (format "Inserted IDs" paracount)))))(defun blog:idparas () 
  (interactive)
  (save-excursion
    (let ((paracount 0)
	  (paraid 0))
      (beginning-of-buffer)
      (re-search-forward "\/info\\|\/essayinfo" nil t nil)
      (while (re-search-forward "\\|]*\\)&gt;"
				nil t nil)
	(if (match-string 3)
	    (let ((attributes (match-string 3)))
	      (if (string-match " id=[\"\']\\([^\"\']+\\)[\"\']" attributes)
		  (let ((id (match-string 1 attributes)))
		    (if (string-match "^p\\([0-9]+\\)$" id)
			(let ((idnum (string-to-number (match-string 1 id))))
			  (if (&gt; idnum paraid)
			      (setq paraid idnum)))))))))
      (setq paraid (+ paraid 1))
      (beginning-of-buffer)
      (re-search-forward "\/info\\|\/essayinfo" nil t nil)
      (while (re-search-forward "\\|]*\\)&gt;"
				nil t nil)
	(if (or (not (match-string 3))
		(not (string-match " id=[\"\']\\([^\"\']+\\)[\"\']" (match-string 3))))
	    (progn
	      (forward-char -1)
	      (insert (format " id='p27" paraid))
	      (setq paracount (+ paracount 1))
	      (setq paraid (+ paraid 1)))))
      (message (format "Inserted IDs" paracount)))))
</pre>

<p>I think I'd rather do that with XSLT, but I haven't bothered to get that working just yet.</p>
  </div></content></entry><entry><title>Comment 3 on /2005/02/09/subversion</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2005/02/09/subversion#comment0003"/><id>http://norman.walsh.name/2010/09/25/oauth#comment0003</id><published>2005-02-10T12:59:04Z</published><updated>2005-02-10T12:59:04Z</updated><author><name>Norman Walsh</name><foaf:mbox_sha1sum>da39a3ee5e6b4b0d3255bfef95601890afd80709</foaf:mbox_sha1sum></author><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
    <p>Except, of course, "id=" in that code should now be "xml:id=". For the time being, at least.</p>
  </div></content></entry><entry><title>Comment 4 on /2005/02/09/subversion</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2005/02/09/subversion#comment0004"/><id>http://norman.walsh.name/2010/09/25/oauth#comment0004</id><published>2005-02-10T14:32:03Z</published><updated>2005-02-10T14:32:03Z</updated><author><name>Anne</name><foaf:mbox_sha1sum>da39a3ee5e6b4b0d3255bfef95601890afd80709</foaf:mbox_sha1sum></author><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
    <p>Hmm, I hope they are not going to change it to <code>xmlid</code> just because some specfication is flawed. The discussion it generates on www-tag is interesting though. Especially about other specifications introducing backwards incompatible changes in the new namespace. (As far as I understand it.)</p>
  </div></content></entry><entry><title>Comment 5 on /2005/02/09/subversion</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2005/02/09/subversion#comment0005"/><id>http://norman.walsh.name/2010/09/25/oauth#comment0005</id><published>2005-02-10T15:04:40Z</published><updated>2005-02-10T15:04:40Z</updated><author><name>Norman Walsh</name><foaf:mbox_sha1sum>da39a3ee5e6b4b0d3255bfef95601890afd80709</foaf:mbox_sha1sum></author><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
    <p>I hope so too. Alas, I don't expect the TAG to get a chance to discuss it before the 21st and perhaps not before the plenary.</p>
  </div></content></entry><entry><title>Comment 6 on /2005/02/09/subversion</title><link rel="alternate" type="text/html" href="http://norman.walsh.name/2005/02/09/subversion#comment0006"/><id>http://norman.walsh.name/2010/09/25/oauth#comment0006</id><published>2005-02-14T14:15:21Z</published><updated>2005-02-14T14:15:21Z</updated><author><name>Norman Walsh</name><foaf:mbox_sha1sum>da39a3ee5e6b4b0d3255bfef95601890afd80709</foaf:mbox_sha1sum></author><content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
    <p>The comments feeds have now been upgraded to Atom Format 05 too.</p>
  </div></content></entry></feed>

