all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Customize: Space char in `character' specification
Date: Sun, 21 May 2006 12:23:01 +0200	[thread overview]
Message-ID: <44703F85.7020400@gmx.at> (raw)

[-- Attachment #1: Type: text/plain, Size: 32 bytes --]

Try the attached patch.

martin

[-- Attachment #2: wid-edit.patch --]
[-- Type: text/plain, Size: 1196 bytes --]

*** wid-edit.el	Tue Apr 11 16:23:54 2006
--- wid-edit.el	Sun May 21 12:18:38 2006
***************
*** 3380,3385 ****
--- 3380,3386 ----
    :value 0
    :size 1
    :format "%{%t%}: %v\n"
+   :value-get 'widget-character-value-get
    :valid-regexp "\\`.\\'"
    :error "This field should contain a single character"
    :value-to-internal (lambda (widget value)
***************
*** 3393,3398 ****
--- 3394,3395 ----
    :match (lambda (widget value)
  	   (char-valid-p value)))

+ (defun widget-character-value-get (widget)
+   "Return character value."
+   (let ((from (widget-field-start widget))
+ 	(to (widget-field-end widget))
+ 	(buffer (widget-field-buffer widget))
+ 	(secret (widget-get widget :secret))
+ 	(old (current-buffer)))
+     (if (and from to)
+ 	(progn
+ 	  (set-buffer buffer)
+ 	  (let ((result (buffer-substring-no-properties from to)))
+ 	    (when secret
+ 	      (let ((index 0))
+ 		(while (< (+ from index) to)
+ 		  (aset result index
+ 			(get-char-property (+ from index) 'secret))
+ 		  (setq index (1+ index)))))
+ 	    (set-buffer old)
+ 	    result))
+       (widget-get widget :value))))
+ 
  (define-widget 'list 'group
    "A Lisp list."
    :tag "List"

[-- Attachment #3: Type: text/plain, Size: 152 bytes --]

_______________________________________________
help-gnu-emacs mailing list
help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

         reply	other threads:[~2006-05-21 10:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-20 12:40 Customize: Space char in `character' specification Reiner Steib
2006-05-21 10:23 ` martin rudalics [this message]
2006-05-21 20:22   ` Reiner Steib
2006-05-22  9:42   ` martin rudalics
2006-05-22 12:39     ` Reiner Steib
2006-05-23  9:38       ` martin rudalics

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=44703F85.7020400@gmx.at \
    --to=rudalics@gmx.at \
    --cc=help-gnu-emacs@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.