From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#18730: [PATCH] tildify.el: introduce a `tildify-space-string' variable Date: Thu, 30 Oct 2014 12:27:41 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1414777638 22458 80.91.229.3 (31 Oct 2014 17:47:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 31 Oct 2014 17:47:18 +0000 (UTC) Cc: Milan Zamazal , 18730@debbugs.gnu.org To: Michal Nazarewicz Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Oct 31 18:47:10 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XkGI0-0004mt-Jb for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 Oct 2014 18:47:08 +0100 Original-Received: from localhost ([::1]:40166 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkGI0-0001TD-5y for geb-bug-gnu-emacs@m.gmane.org; Fri, 31 Oct 2014 13:47:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50944) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XkEHy-0005w3-4O for bug-gnu-emacs@gnu.org; Fri, 31 Oct 2014 11:42:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XjsZu-0006LM-SQ for bug-gnu-emacs@gnu.org; Thu, 30 Oct 2014 12:28:10 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48602) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XjsZu-0006LI-Pi for bug-gnu-emacs@gnu.org; Thu, 30 Oct 2014 12:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XjsZu-0007Bn-7o for bug-gnu-emacs@gnu.org; Thu, 30 Oct 2014 12:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 Oct 2014 16:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18730 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 18730-submit@debbugs.gnu.org id=B18730.141468646727613 (code B ref 18730); Thu, 30 Oct 2014 16:28:02 +0000 Original-Received: (at 18730) by debbugs.gnu.org; 30 Oct 2014 16:27:47 +0000 Original-Received: from localhost ([127.0.0.1]:40700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XjsZf-0007BJ-0z for submit@debbugs.gnu.org; Thu, 30 Oct 2014 12:27:47 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:54214) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XjsZc-0007BA-ED for 18730@debbugs.gnu.org; Thu, 30 Oct 2014 12:27:44 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id s9UGRghM026937; Thu, 30 Oct 2014 12:27:42 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id C4995660F3; Thu, 30 Oct 2014 12:27:41 -0400 (EDT) In-Reply-To: (Michal Nazarewicz's message of "Tue, 28 Oct 2014 23:01:53 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5110=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5110> : inlines <1461> : streams <1330539> : uri <1830470> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:95308 > Deprecate `tildify-string-alist' variable and instead introduce > a new `tildify-space-string' variable. The alist was somehow > complicated to use, both for users and in code, and did not work > correctly with derived modes. Instead of trying to make its > handling even more complicated to fix the latter problem, replace > it with `tildify-space-string' buffer-local variable. The patch looks good. Please install it with an appropriate ChangeLog entry (and of course, the same text used as commit message). See comments below, Stefan > + ;; If encoding allows use non-break space character as hard space, oth= erwise > + ;; use numeric entity (so we don't depend on   being defined). You might like to add a FIXME in there deploring the fact that nxml-mode doesn't derive from sgml-mode, which would save us from duplicating this co= de. > + (setq-local tildify-space-string > + (if (memq (coding-system-change-eol-conversion > + buffer-file-coding-system nil) > + (find-coding-systems-string "=A0")) Hmm... I would have used something more like (equal "=A0" (decode-coding-string (encode-coding-string "=A0" buffer-file-coding-system) buffer-file-coding-system)) > +(defcustom tildify-space-string nil I think you could use "=A0" as the default value so you can assume the var only holds a string. > - (sgml-mode . " ") > - (html-mode . sgml-mode) The new code uses " " for those instead. Is this change on purpose? > +This variable is deprecated in favour of `tildify-space-string' > +variable and takes effect only if `tildify-space-string' is not set. Then add a (make-obsolete-variable 'tildify-string-alist 'tildify-space-string' "25.1"). And then check C-h v tildify-string-alist RET since the obsolescence info in there will make part of the above text redundant. > + (tilde (or tildify-space-string > + (tildify--pick-alist-entry tildify-string-alist) > + " ")) Since tildify-string-alist defaults to nil, I would make it take precedence over tildify-space-string. Stefan