all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Proposal: Change for propertize
@ 2007-02-28 16:16 Kim F. Storm
  2007-02-28 16:30 ` Lennart Borgman (gmail)
  2007-03-01  1:09 ` Richard Stallman
  0 siblings, 2 replies; 4+ messages in thread
From: Kim F. Storm @ 2007-02-28 16:16 UTC (permalink / raw)
  To: emacs-devel


While fixing the places where we have

(propertize message 'face 'minibuffer-prompt)

to do

(apply 'propertize message minibuffer-prompt-properties)

it occurred to me that the following format would be nice:

(propertize message minibuffer-prompt-properties)

i.e. if propertize is called with just two arguments,
the second arg is a list of properties to use.

Here's a patch:

*** editfns.c	16 Feb 2007 16:30:28 +0100	1.434
--- editfns.c	28 Feb 2007 17:11:51 +0100	
***************
*** 3338,3344 ****
         doc: /* Return a copy of STRING with text properties added.
  First argument is the string to copy.
  Remaining arguments form a sequence of PROPERTY VALUE pairs for text
! properties to add to the result.
  usage: (propertize STRING &rest PROPERTIES)  */)
       (nargs, args)
       int nargs;
--- 3338,3345 ----
         doc: /* Return a copy of STRING with text properties added.
  First argument is the string to copy.
  Remaining arguments form a sequence of PROPERTY VALUE pairs for text
! properties to add to the result, or a single argument PROPERTY-LIST
! which is a list of such text property pairs.
  usage: (propertize STRING &rest PROPERTIES)  */)
       (nargs, args)
       int nargs;
***************
*** 3350,3356 ****
  
    /* Number of args must be odd.  */
    if ((nargs & 1) == 0 || nargs < 1)
!     error ("Wrong number of arguments");
  
    properties = string = Qnil;
    GCPRO2 (properties, string);
--- 3351,3358 ----
  
    /* Number of args must be odd.  */
    if ((nargs & 1) == 0 || nargs < 1)
!     if (nargs != 2 || !CONSP (args[1]))
!       error ("Wrong number of arguments");
  
    properties = string = Qnil;
    GCPRO2 (properties, string);
***************
*** 3359,3366 ****
    CHECK_STRING (args[0]);
    string = Fcopy_sequence (args[0]);
  
!   for (i = 1; i < nargs; i += 2)
!     properties = Fcons (args[i], Fcons (args[i + 1], properties));
  
    Fadd_text_properties (make_number (0),
  			make_number (SCHARS (string)),
--- 3361,3371 ----
    CHECK_STRING (args[0]);
    string = Fcopy_sequence (args[0]);
  
!   if (nargs == 2)
!     properties = args[1];
!   else
!     for (i = 1; i < nargs; i += 2)
!       properties = Fcons (args[i], Fcons (args[i + 1], properties));
  
    Fadd_text_properties (make_number (0),
  			make_number (SCHARS (string)),

-- 
Kim F. Storm  http://www.cua.dk

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Proposal: Change for propertize
  2007-02-28 16:16 Proposal: Change for propertize Kim F. Storm
@ 2007-02-28 16:30 ` Lennart Borgman (gmail)
  2007-02-28 17:42   ` Drew Adams
  2007-03-01  1:09 ` Richard Stallman
  1 sibling, 1 reply; 4+ messages in thread
From: Lennart Borgman (gmail) @ 2007-02-28 16:30 UTC (permalink / raw)
  To: Kim F. Storm; +Cc: emacs-devel

Kim F. Storm wrote:
> While fixing the places where we have
> 
> (propertize message 'face 'minibuffer-prompt)
> 
> to do
> 
> (apply 'propertize message minibuffer-prompt-properties)
> 
> it occurred to me that the following format would be nice:
> 
> (propertize message minibuffer-prompt-properties)
> 
> i.e. if propertize is called with just two arguments,
> the second arg is a list of properties to use.


I like the idea.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Proposal: Change for propertize
  2007-02-28 16:30 ` Lennart Borgman (gmail)
@ 2007-02-28 17:42   ` Drew Adams
  0 siblings, 0 replies; 4+ messages in thread
From: Drew Adams @ 2007-02-28 17:42 UTC (permalink / raw)
  To: emacs-devel

> > if propertize is called with just two arguments,
> > the second arg is a list of properties to use.
>
> I like the idea.

Sure, good idea; let's add some more new features now.

I have a list of suggestions right here, in fact, some of which I've been
holding onto since the imminent release in 2002...

;-)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Proposal: Change for propertize
  2007-02-28 16:16 Proposal: Change for propertize Kim F. Storm
  2007-02-28 16:30 ` Lennart Borgman (gmail)
@ 2007-03-01  1:09 ` Richard Stallman
  1 sibling, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2007-03-01  1:09 UTC (permalink / raw)
  To: Kim F. Storm; +Cc: emacs-devel

Your idea for extending propertize could be good
(though perhaps we should go further).
But this is not the time for such changes.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-03-01  1:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-28 16:16 Proposal: Change for propertize Kim F. Storm
2007-02-28 16:30 ` Lennart Borgman (gmail)
2007-02-28 17:42   ` Drew Adams
2007-03-01  1:09 ` Richard Stallman

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.