From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Claudio Bley Newsgroups: gmane.emacs.bugs Subject: bug#15925: 24.3.50; error when customizing whitespace-display-mappings Date: Wed, 20 Nov 2013 11:35:08 +0100 Message-ID: <87a9gzuzs3.wl%claudio.bley@gmail.com> References: <87mwl0vo36.wl%claudio.bley@gmail.com> <5xiovo4x5p.fsf@fencepost.gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: ger.gmane.org 1384943772 15162 80.91.229.3 (20 Nov 2013 10:36:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 20 Nov 2013 10:36:12 +0000 (UTC) Cc: 15925@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 20 11:36:18 2013 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 1Vj58r-0000Ut-1E for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Nov 2013 11:36:17 +0100 Original-Received: from localhost ([::1]:53863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj58q-00030f-Mq for geb-bug-gnu-emacs@m.gmane.org; Wed, 20 Nov 2013 05:36:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj58i-00030T-G7 for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2013 05:36:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vj58d-0005kB-Ar for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2013 05:36:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48358) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vj58d-0005k7-7G for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2013 05:36:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Vj58c-00020L-J1 for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2013 05:36:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Claudio Bley Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Nov 2013 10:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15925 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15925-submit@debbugs.gnu.org id=B15925.13849437217657 (code B ref 15925); Wed, 20 Nov 2013 10:36:02 +0000 Original-Received: (at 15925) by debbugs.gnu.org; 20 Nov 2013 10:35:21 +0000 Original-Received: from localhost ([127.0.0.1]:34144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vj57x-0001zR-2W for submit@debbugs.gnu.org; Wed, 20 Nov 2013 05:35:21 -0500 Original-Received: from mail-ee0-f47.google.com ([74.125.83.47]:61045) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vj57u-0001zC-EK for 15925@debbugs.gnu.org; Wed, 20 Nov 2013 05:35:19 -0500 Original-Received: by mail-ee0-f47.google.com with SMTP id c50so3313311eek.20 for <15925@debbugs.gnu.org>; Wed, 20 Nov 2013 02:35:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=date:message-id:from:to:cc:subject:in-reply-to:references :user-agent:mime-version:content-type; bh=I2PwFlhqJkfKM21JXG2z8qEvPIx03MtSfge/IHjILhk=; b=rfuxBt0sxhxfgL4ynUwy7NwijTsD+5swPRGuciBL740S9oLsit6KbqYutMJps8ImRn jt0Lw0LusW3RRkiB/T7XSTxJ2wSvOL9UWdZZpRZIyeHcvkhWkxjP2S8HncFCt1NyOump VR27jCyKCq+0/X+3IG7WJz+fc+EnsouzkXp+SKPEKGhGcjO5ZkuZZSFC6eSaVb13W7lb V1OJ9HgL0bPG+gDkj7vj+ZciBm8ganzToitQGQf7Lx8RrJJJwJJbIAlPSoBJ9MnBFlbH qv2o0JPRAC/4Q3o8fgEwiCPI72h3zJOsSfr8STIYEu/BFB8cQ10gdnvKeuRqqHtXljdD NGEg== X-Received: by 10.14.219.198 with SMTP id m46mr2072897eep.41.1384943712580; Wed, 20 Nov 2013 02:35:12 -0800 (PST) Original-Received: from CLAUDIO-PC.localdomain.de (178-24-125-95-dynip.superkabel.de. [178.24.125.95]) by mx.google.com with ESMTPSA id o47sm58172044eem.21.2013.11.20.02.35.10 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 20 Nov 2013 02:35:11 -0800 (PST) In-Reply-To: <5xiovo4x5p.fsf@fencepost.gnu.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?Q?Goj=C5=8D?=) APEL/10.8 Emacs/24.3.50 (i686-pc-mingw32) MULE/6.0 (HANACHIRUSATO) 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:80785 Archived-At: 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