all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Claudio Bley <claudio.bley@googlemail.com>
To: Glenn Morris <rgm@gnu.org>
Cc: 15925@debbugs.gnu.org
Subject: bug#15925: 24.3.50; error when customizing whitespace-display-mappings
Date: Wed, 20 Nov 2013 11:35:08 +0100	[thread overview]
Message-ID: <87a9gzuzs3.wl%claudio.bley@gmail.com> (raw)
In-Reply-To: <5xiovo4x5p.fsf@fencepost.gnu.org>

At Tue, 19 Nov 2013 03:24:02 -0500,
Glenn Morris wrote:
> 
> Claudio Bley wrote:
> 
> > I think the regexp should be changed to "\\`\(.\|\n\)\\'" to allow a
> > single newline also.
> 
> We already tried that once; it caused more problems than it solved:
> http://debbugs.gnu.org/2689

I see. So lets get this solved.

At first, changing the regexp is just the right thing to do and
in itself, IMO, does not break anything.

Alas, it does not solve the problem at hand because
`widget-specify-field' behaves /badly/ when the field ends with a
newline.

So, actually, this hunk of your patch trying to work around
this behaviour broke other things.

How about using a special :value-create function for character fields?

Furthermore, the presentation of the character values is bad,
usability-wise, because for nonprintable chars you cannot see what
value the field actually has.

How about displaying those chars in the buffer in another format?
E.g. use escape sequences like \n \r et cetera?

I (rather hackish) way to fix this would be to always insert a ?\n
as part of the value of a character field:

(defun widget-field-char-create (widget)
  "Create an editable character field."
  (let ((value (widget-get widget :value))
	(from (point))
	;; This is changed to a real overlay in `widget-setup'.  We
	;; need the end points to behave differently until
	;; `widget-setup' is called.
	(overlay (cons (make-marker) (make-marker))))
    (widget-put widget :field-overlay overlay)
    (insert value)
    (insert ?\n) ;; EEEK
    (unless (memq widget widget-field-list)
      (setq widget-field-new (cons widget widget-field-new)))
    (move-marker (cdr overlay) (point))
    (set-marker-insertion-type (cdr overlay) nil)
    (insert ?\n)
    (move-marker (car overlay) from)
    (set-marker-insertion-type (car overlay) t)))

What do you think?
-- 
Claudio





  reply	other threads:[~2013-11-20 10:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-19  7:37 bug#15925: 24.3.50; error when customizing whitespace-display-mappings Claudio Bley
2013-11-19  8:24 ` Glenn Morris
2013-11-20 10:35   ` Claudio Bley [this message]
2013-11-20 19:28     ` Stefan Monnier
2020-09-22 15:42 ` Mauro Aranda
2020-09-23 13:46   ` Lars Ingebrigtsen
2020-09-23 15:26     ` Mauro Aranda
2020-09-24 14:38       ` Lars Ingebrigtsen
2020-09-24 15:29         ` Mauro Aranda
2020-09-24 15:36           ` Mauro Aranda
2020-09-25 10:00           ` Lars Ingebrigtsen
2020-09-25 11:06             ` Eli Zaretskii
2020-09-25 11:10             ` Mauro Aranda
2020-09-25 14:32               ` Mauro Aranda
2020-09-26 13:24                 ` Lars Ingebrigtsen
2020-09-26 13:26                 ` Lars Ingebrigtsen
2020-09-26 13:45                   ` Mauro Aranda
2020-09-26 15:10                     ` Lars Ingebrigtsen
     [not found] <<87mwl0vo36.wl%claudio.bley@gmail.com>
     [not found] ` <<CABczVwdS5QJkQh1+GBBoDB4WDtSCCOJRF48whp+it0TyJ1x23Q@mail.gmail.com>
     [not found]   ` <<87a6xgd2rw.fsf@gnus.org>
     [not found]     ` <<CABczVweQk+Jiiix62mS49n1zoHNn-6uifOEB1H4==EKNSV970g@mail.gmail.com>
     [not found]       ` <<871rirb5ot.fsf@gnus.org>
     [not found]         ` <<CABczVweW=gbepHOLzBQZbAxS9yX-Fo3h2_hPDL7FwmhfjAdk6w@mail.gmail.com>
     [not found]           ` <<87ft76rxaw.fsf@gnus.org>
     [not found]             ` <<83v9g2ru8f.fsf@gnu.org>
2020-09-25 16:07               ` Drew Adams

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

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

  git send-email \
    --in-reply-to=87a9gzuzs3.wl%claudio.bley@gmail.com \
    --to=claudio.bley@googlemail.com \
    --cc=15925@debbugs.gnu.org \
    --cc=rgm@gnu.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.