unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Michal Nazarewicz <mina86@mina86.com>
Cc: Milan Zamazal <pdm@zamazal.org>, 18730@debbugs.gnu.org
Subject: bug#18730: [PATCH] tildify.el: introduce a `tildify-space-string' variable
Date: Thu, 30 Oct 2014 12:27:41 -0400	[thread overview]
Message-ID: <jwvoasta64f.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <xa1td29b7t0u.fsf@mina86.com> (Michal Nazarewicz's message of "Tue, 28 Oct 2014 23:01:53 +0100")

> 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, otherwise
> +  ;; use numeric entity (so we don't depend on &nbsp; 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 code.

> +  (setq-local tildify-space-string
> +              (if (memq (coding-system-change-eol-conversion
> +                         buffer-file-coding-system nil)
> +                        (find-coding-systems-string " "))

Hmm... I would have used something more like

   (equal " " (decode-coding-string (encode-coding-string
                                     " " buffer-file-coding-system)
                                    buffer-file-coding-system))

> +(defcustom tildify-space-string nil

I think you could use " " as the default value so you can assume the var
only holds a string.

> -    (sgml-mode . "&nbsp;")
> -    (html-mode . sgml-mode)

The new code uses "&#160" 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





  reply	other threads:[~2014-10-30 16:27 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-15  8:01 bug#18730: [PATCH] tildify.el: Add `auto-tildify' and `auto-tildify-mode' Michal Nazarewicz
2014-10-15 14:35 ` Stefan Monnier
2014-10-16  9:34   ` Michal Nazarewicz
2014-10-16 14:03     ` Stefan Monnier
2014-10-16 14:57       ` Stefan Monnier
2014-10-16 16:07       ` Michal Nazarewicz
2014-10-16 19:39         ` Stefan Monnier
2014-10-17  8:44           ` Michal Nazarewicz
2014-10-17 13:06             ` Stefan Monnier
2014-10-22 23:19               ` Michal Nazarewicz
2014-10-24 22:51                 ` Stefan Monnier
2014-10-28 22:01                   ` bug#18730: [PATCH] tildify.el: introduce a `tildify-space-string' variable Michal Nazarewicz
2014-10-30 16:27                     ` Stefan Monnier [this message]
2014-11-03 15:59                       ` Michal Nazarewicz
2014-11-03 17:00                         ` Stefan Monnier
2014-11-17 15:41                           ` bug#18730: [PATCH 1/3] " Michal Nazarewicz
2014-11-17 15:41                             ` bug#18730: [PATCH 2/3] tildify.el: introduce a `tildify-pattern' variable Michal Nazarewicz
2014-11-17 15:41                             ` bug#18730: [PATCH 3/3] tildify.el: introduce a `tildify-foreach-region-function' variable Michal Nazarewicz
2014-11-17 17:38                             ` bug#18730: [PATCH 1/3] tildify.el: introduce a `tildify-space-string' variable Stefan Monnier
2014-10-16 13:17 ` bug#18730: [PATCH] tildify.el: Add `auto-tildify' and `auto-tildify-mode' Ted Zlatanov
2014-10-16 14:16   ` Michal Nazarewicz
2014-10-16 14:55     ` Stefan Monnier
2014-10-16 17:17       ` Ted Zlatanov
2014-10-16 13:19 ` Ted Zlatanov
2014-10-16 15:34 ` bug#18730: [PATCHv2 1/2] tildify.el (tildify--pick-alist-entry): rename from tildify-mode-alist Michal Nazarewicz
2014-10-16 15:34   ` bug#18730: [PATCHv2 2/2] tildify.el: Add `auto-tildify' and `auto-tildify-mode' Michal Nazarewicz
2014-10-16 19:30   ` bug#18730: [PATCHv2 1/2] tildify.el (tildify--pick-alist-entry): rename from tildify-mode-alist Stefan Monnier
2014-11-24 14:20 ` bug#18730: [PATCH 1/2] tildify.el: Add `tildify-space' and `tildify-mode' Michal Nazarewicz
2014-11-24 14:20   ` bug#18730: [PATCH 2/2] tildify.el: Add `tildify-double-space-undos' Michal Nazarewicz
2014-12-10 17:44   ` bug#18730: [PATCH 1/2] tildify.el: Add `tildify-space' and `tildify-mode' Michal Nazarewicz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvoasta64f.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=18730@debbugs.gnu.org \
    --cc=mina86@mina86.com \
    --cc=pdm@zamazal.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).