From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Proposal: Change for propertize Date: Wed, 28 Feb 2007 17:16:43 +0100 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1172679394 1629 80.91.229.12 (28 Feb 2007 16:16:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 28 Feb 2007 16:16:34 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Feb 28 17:16:23 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HMRTY-0001sP-4y for ged-emacs-devel@m.gmane.org; Wed, 28 Feb 2007 17:16:20 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HMRTY-0005zn-K2 for ged-emacs-devel@m.gmane.org; Wed, 28 Feb 2007 11:16:20 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HMRTD-0005qk-EE for emacs-devel@gnu.org; Wed, 28 Feb 2007 11:15:59 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HMRTC-0005ph-Ff for emacs-devel@gnu.org; Wed, 28 Feb 2007 11:15:59 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HMRTC-0005pZ-Ap for emacs-devel@gnu.org; Wed, 28 Feb 2007 11:15:58 -0500 Original-Received: from pfepc.post.tele.dk ([195.41.46.237]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HMRTB-0000nW-Qu for emacs-devel@gnu.org; Wed, 28 Feb 2007 11:15:58 -0500 Original-Received: from kfs-l.imdomain.dk.cua.dk (unknown [80.165.4.124]) by pfepc.post.tele.dk (Postfix) with SMTP id 1F6938A006D for ; Wed, 28 Feb 2007 17:15:54 +0100 (CET) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.94 (gnu/linux) X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:67041 Archived-At: 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