From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: Converting a string to valid XHTML id? Date: Thu, 2 Dec 2010 03:54:48 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1291258522 10043 80.91.229.12 (2 Dec 2010 02:55:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 2 Dec 2010 02:55:22 +0000 (UTC) Cc: emacs-devel@gnu.org To: Kevin Rodgers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 02 03:55:18 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PNzKI-0004fJ-55 for ged-emacs-devel@m.gmane.org; Thu, 02 Dec 2010 03:55:18 +0100 Original-Received: from localhost ([127.0.0.1]:55347 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNzKH-0005bl-IC for ged-emacs-devel@m.gmane.org; Wed, 01 Dec 2010 21:55:17 -0500 Original-Received: from [140.186.70.92] (port=54291 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PNzKB-0005W2-JW for emacs-devel@gnu.org; Wed, 01 Dec 2010 21:55:12 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PNzKA-00018D-3n for emacs-devel@gnu.org; Wed, 01 Dec 2010 21:55:11 -0500 Original-Received: from mail-ew0-f41.google.com ([209.85.215.41]:49679) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PNzK9-000180-VD for emacs-devel@gnu.org; Wed, 01 Dec 2010 21:55:10 -0500 Original-Received: by ewy27 with SMTP id 27so17714945ewy.0 for ; Wed, 01 Dec 2010 18:55:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=K/jL2TEHta5fzDCHu3p8izcdD+i17s2uKgI6KdtOt4g=; b=BucHTQkK+l7wGYwX9ws0OJn2qVioU8kLr5mbQIsaKTRzeKOAm3jJxDlOHDw2l99D9O 6mw/74qMlDt9iBl+bI4WPLTMlmRgp04OBSgPZFZWmLagjxaqSmetfVwCY6yrJTnwDw00 +rK0qUX3Z/AYEZCTlxQpO8LtxMO9RIQKIvQSg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=T5qiGgGQHUXkEriiF/6SUPuq795VcQqc/KCtceQWVGpfoR6tldzBQW/NZcDm1ZYOU7 1862pR5y5EkuJykBeHTM3UELgS4mmyOyEentj6iDRpKgaf1ZGgEPCogJTJc2/YuJsC5y nyy1AgHDeewDIZg9zn91gqtPL4qFc6+ILz2lY= Original-Received: by 10.213.15.139 with SMTP id k11mr5241740eba.97.1291258508940; Wed, 01 Dec 2010 18:55:08 -0800 (PST) Original-Received: by 10.213.29.8 with HTTP; Wed, 1 Dec 2010 18:54:48 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:133300 Archived-At: On Thu, Dec 2, 2010 at 3:37 AM, Kevin Rodgers w= rote: > On 12/1/10 12:51 PM, Lennart Borgman wrote: >> >> On Wed, Dec 1, 2010 at 4:51 PM, Stefan Monnier >> =C2=A0wrote: >>>>> >>>>> collapsing two different strings to the same ID, resulting in >>>>> invalid html. >>> >>> I have no idea what those ids are for, but wouldn't a cryptographic has= h >>> work as well? >> >> It is just the value of the id attribute, for example like this: >> >> =C2=A0 =C2=A0 > > Is the point of your function to create a syntactically valid XHTML id fr= om > a > string that is assumed to be unique within the context of the current > document, > or is it to generate a syntactically valid, unique XHTML id every time it= is > called (even when called multiple times with the same string)? Currently unique within the current document. In the context where it is used it is for export of org-mode files to xhtml. Obviously if there are links to anchors within other files my approach will fails. So, hm, maybe I should reset this variable when starting a directory tree export or a single file export rather than making it buffer local. (But then I have to look into the export of directory trees in org-mode which I have not done yet.)