summaryrefslogtreecommitdiff
path: root/src/fns.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@redhat.com>1993-07-06 14:43:32 +0000
committerJim Blandy <jimb@redhat.com>1993-07-06 14:43:32 +0000
commite90a3ed302f6ca750d9bc80e6dd2638bec38b687 (patch)
tree6fd89bdaaf85752d5f074a6c8bc5169b7b536bb5 /src/fns.c
parentac2edb7c9e5a7a9766d034b4b3be25c5b5dfe270 (diff)
downloademacs-e90a3ed302f6ca750d9bc80e6dd2638bec38b687.tar.gz
* fns.c (Fsubstring, concat): Pass all six arguments to
copy_text_properties. * textprop.c (copy_text_properties): New function, from David Gillespie. * intervals.h: Declare copy_text_properties. * fns.c: #include "intervals.h". (Fsubstring): Copy text properties to result string. (concat): Copy text properties to result string. * ymakefile (fns.o): Note that this depends on INTERVAL_SRC.
Diffstat (limited to 'src/fns.c')
-rw-r--r--src/fns.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/fns.c b/src/fns.c
index 97f3606bc01..18d645dcd17 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -30,6 +30,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "buffer.h"
#include "keyboard.h"
+#include "intervals.h"
Lisp_Object Qstring_lessp, Qprovide, Qrequire;
@@ -305,11 +306,19 @@ concat (nargs, args, target_type, last_special)
if (!CONSP (this))
thislen = Flength (this), thisleni = XINT (thislen);
+ if (XTYPE (this) == Lisp_String && XTYPE (val) == Lisp_String
+ && ! NULL_INTERVAL_P (XSTRING (this)->intervals))
+ {
+ copy_text_properties (make_number (0), thislen, this,
+ make_number (toindex), val, Qnil);
+ }
+
while (1)
{
register Lisp_Object elt;
- /* Fetch next element of `this' arg into `elt', or break if `this' is exhausted. */
+ /* Fetch next element of `this' arg into `elt', or break if
+ `this' is exhausted. */
if (NILP (this)) break;
if (CONSP (this))
elt = Fcar (this), this = Fcdr (this);
@@ -389,6 +398,8 @@ If FROM or TO is negative, it counts from the end.")
Lisp_Object string;
register Lisp_Object from, to;
{
+ Lisp_Object res;
+
CHECK_STRING (string, 0);
CHECK_NUMBER (from, 1);
if (NILP (to))
@@ -404,8 +415,10 @@ If FROM or TO is negative, it counts from the end.")
&& XINT (to) <= XSTRING (string)->size))
args_out_of_range_3 (string, from, to);
- return make_string (XSTRING (string)->data + XINT (from),
- XINT (to) - XINT (from));
+ res = make_string (XSTRING (string)->data + XINT (from),
+ XINT (to) - XINT (from));
+ copy_text_properties (from, to, string, make_number (0), res, Qnil);
+ return res;
}
DEFUN ("nthcdr", Fnthcdr, Snthcdr, 2, 2, 0,