[COMMIT] Rework description of no_conversion coding system, avoiding pdump confusion.
10 years, 11 months
Aidan Kehoe
APPROVE COMMIT
The buildbot showed some problems with my last change, which turned out to
be a result of the pdump infrastructure being confused by the no-conversion
coding system’s zero-sized coding system data. Remove this, maintain the
coding_stream information.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1389902166 0
# Node ID ccaa851ae712e870ceb65d19226426d40d8de48c
# Parent 65d65b52d608ca1f17365a96fc3cf710a3af625c
Rework description of no_conversion coding system, avoiding pdump confusion.
src/ChangeLog addition:
2014-01-16 Aidan Kehoe <kehoea(a)parhasard.net>
* file-coding.c:
* file-coding.c (struct no_conversion_coding_stream):
* file-coding.c (const struct sized_memory_description
no_conversion_coding_stream_description): Removed.
* file-coding.c (coding_system_type_create):
Remove structure and description for struct
no_conversion_coding_system, which confused pdump on some builds
after the last change.
diff -r 65d65b52d608 -r ccaa851ae712 src/ChangeLog
--- a/src/ChangeLog Thu Jan 16 16:27:52 2014 +0000
+++ b/src/ChangeLog Thu Jan 16 19:56:06 2014 +0000
@@ -1,3 +1,14 @@
+2014-01-16 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * file-coding.c:
+ * file-coding.c (struct no_conversion_coding_stream):
+ * file-coding.c (const struct sized_memory_description
+ no_conversion_coding_stream_description): Removed.
+ * file-coding.c (coding_system_type_create):
+ Remove structure and description for struct
+ no_conversion_coding_system, which confused pdump on some builds
+ after the last change.
+
2014-01-16 Aidan Kehoe <kehoea(a)parhasard.net>
Pass character count information from the no-conversion and
diff -r 65d65b52d608 -r ccaa851ae712 src/file-coding.c
--- a/src/file-coding.c Thu Jan 16 16:27:52 2014 +0000
+++ b/src/file-coding.c Thu Jan 16 19:56:06 2014 +0000
@@ -2832,31 +2832,13 @@
#### Shouldn't we _call_ it that, then? And while we're at it,
separate it into "to_internal" and "to_external"? */
-
-struct no_conversion_coding_system
-{
-};
-
struct no_conversion_coding_stream
{
/* Number of characters seen when decoding. */
Charcount characters_seen;
};
-static const struct memory_description no_conversion_coding_system_description[] = {
- { XD_END }
-};
-
-static const struct memory_description no_conversion_coding_stream_description_1 [] = {
- { XD_INT, offsetof (struct no_conversion_coding_stream, characters_seen) },
- { XD_END }
-};
-
-const struct sized_memory_description no_conversion_coding_stream_description = {
- sizeof (struct no_conversion_coding_stream), no_conversion_coding_stream_description_1
-};
-
-DEFINE_CODING_SYSTEM_TYPE_WITH_DATA (no_conversion);
+DEFINE_CODING_SYSTEM_TYPE (no_conversion);
/* This is used when reading in "binary" files -- i.e. files that may
contain all 256 possible byte values and that are not to be
@@ -4740,8 +4722,14 @@
dump_add_opaque_int (&coding_detector_count);
dump_add_opaque_int (&coding_detector_category_count);
- INITIALIZE_CODING_SYSTEM_TYPE_WITH_DATA (no_conversion,
- "no-conversion-coding-system-p");
+ INITIALIZE_CODING_SYSTEM_TYPE (no_conversion,
+ "no-conversion-coding-system-p");
+ /* This is the only coding system type that has coding_stream info but no
+ coding_system info, which is why we're not using
+ INITIALIZE_CODING_SYSTEM_TYPE_WITH_DATA. */
+ no_conversion_coding_system_methods->coding_data_size =
+ sizeof (struct no_conversion_coding_stream);
+
CODING_SYSTEM_HAS_METHOD (no_conversion, convert);
CODING_SYSTEM_HAS_METHOD (no_conversion, character_tell);
--
‘Liston operated so fast that he once accidentally amputated an assistant’s
fingers along with a patient’s leg, […] The patient and the assistant both
died of sepsis, and a spectator reportedly died of shock, resulting in the
only known procedure with a 300% mortality.’ (Atul Gawande, NEJM, 2012)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/XEmacs: kehoea: Increase READ_BUF_SIZE, used in #'insert-file-contents-internal, to #x10000
10 years, 11 months
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/319e18d08654/
Changeset: 319e18d08654
User: kehoea
Date: 2014-01-16 21:26:27
Summary: Increase READ_BUF_SIZE, used in #'insert-file-contents-internal, to #x10000
src/ChangeLog addition:
2014-01-16 Aidan Kehoe <kehoea(a)parhasard.net>
* fileio.c (READ_BUF_SIZE):
Stack sizes > 2**16 elicited bugs back in August 1996, but there's
nothing to indicate this is still the case. GNU uses a block size
of #x10000, and that size works better with the coding system
buffering, improving performance there; move to this value.
Affected #: 2 files
diff -r ccaa851ae712e870ceb65d19226426d40d8de48c -r 319e18d08654e2b6b6a20bc496349fcc959ed69f src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
+2014-01-16 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * fileio.c (READ_BUF_SIZE):
+ Stack sizes > 2**16 elicited bugs back in August 1996, but there's
+ nothing to indicate this is still the case. GNU uses a block size
+ of #x10000, and that size works better with the coding system
+ buffering, improving performance there; move to this value.
+
2014-01-16 Aidan Kehoe <kehoea(a)parhasard.net>
* file-coding.c:
diff -r ccaa851ae712e870ceb65d19226426d40d8de48c -r 319e18d08654e2b6b6a20bc496349fcc959ed69f src/fileio.c
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2870,9 +2870,7 @@
}
-/* Stack sizes > 2**16 is a good way to elicit compiler bugs */
-/* #define READ_BUF_SIZE (2 << 16) */
-#define READ_BUF_SIZE (1 << 15)
+#define READ_BUF_SIZE (2 << 16)
DEFUN ("insert-file-contents-internal", Finsert_file_contents_internal,
1, 7, 0, /*
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/XEmacs: kehoea: Rework description of no_conversion coding system, avoiding pdump confusion.
10 years, 11 months
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/ccaa851ae712/
Changeset: ccaa851ae712
User: kehoea
Date: 2014-01-16 20:56:06
Summary: Rework description of no_conversion coding system, avoiding pdump confusion.
src/ChangeLog addition:
2014-01-16 Aidan Kehoe <kehoea(a)parhasard.net>
* file-coding.c:
* file-coding.c (struct no_conversion_coding_stream):
* file-coding.c (const struct sized_memory_description
no_conversion_coding_stream_description): Removed.
* file-coding.c (coding_system_type_create):
Remove structure and description for struct
no_conversion_coding_system, which confused pdump on some builds
after the last change.
Affected #: 2 files
diff -r 65d65b52d608ca1f17365a96fc3cf710a3af625c -r ccaa851ae712e870ceb65d19226426d40d8de48c src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
+2014-01-16 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * file-coding.c:
+ * file-coding.c (struct no_conversion_coding_stream):
+ * file-coding.c (const struct sized_memory_description
+ no_conversion_coding_stream_description): Removed.
+ * file-coding.c (coding_system_type_create):
+ Remove structure and description for struct
+ no_conversion_coding_system, which confused pdump on some builds
+ after the last change.
+
2014-01-16 Aidan Kehoe <kehoea(a)parhasard.net>
Pass character count information from the no-conversion and
diff -r 65d65b52d608ca1f17365a96fc3cf710a3af625c -r ccaa851ae712e870ceb65d19226426d40d8de48c src/file-coding.c
--- a/src/file-coding.c
+++ b/src/file-coding.c
@@ -2832,31 +2832,13 @@
#### Shouldn't we _call_ it that, then? And while we're at it,
separate it into "to_internal" and "to_external"? */
-
-struct no_conversion_coding_system
-{
-};
-
struct no_conversion_coding_stream
{
/* Number of characters seen when decoding. */
Charcount characters_seen;
};
-static const struct memory_description no_conversion_coding_system_description[] = {
- { XD_END }
-};
-
-static const struct memory_description no_conversion_coding_stream_description_1 [] = {
- { XD_INT, offsetof (struct no_conversion_coding_stream, characters_seen) },
- { XD_END }
-};
-
-const struct sized_memory_description no_conversion_coding_stream_description = {
- sizeof (struct no_conversion_coding_stream), no_conversion_coding_stream_description_1
-};
-
-DEFINE_CODING_SYSTEM_TYPE_WITH_DATA (no_conversion);
+DEFINE_CODING_SYSTEM_TYPE (no_conversion);
/* This is used when reading in "binary" files -- i.e. files that may
contain all 256 possible byte values and that are not to be
@@ -4740,8 +4722,14 @@
dump_add_opaque_int (&coding_detector_count);
dump_add_opaque_int (&coding_detector_category_count);
- INITIALIZE_CODING_SYSTEM_TYPE_WITH_DATA (no_conversion,
- "no-conversion-coding-system-p");
+ INITIALIZE_CODING_SYSTEM_TYPE (no_conversion,
+ "no-conversion-coding-system-p");
+ /* This is the only coding system type that has coding_stream info but no
+ coding_system info, which is why we're not using
+ INITIALIZE_CODING_SYSTEM_TYPE_WITH_DATA. */
+ no_conversion_coding_system_methods->coding_data_size =
+ sizeof (struct no_conversion_coding_stream);
+
CODING_SYSTEM_HAS_METHOD (no_conversion, convert);
CODING_SYSTEM_HAS_METHOD (no_conversion, character_tell);
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[XEMACS PATCH] Have coding systems do some bytecount->charcount work
10 years, 11 months
Aidan Kehoe
With large non-conversion-unix files (in particular, VM buffers), 10% of the
time needed to read them in is spent in bytecount_to_charcount_func(),
working out the byte-character correspondence for the buffer code.
The coding systems in general know exactly where the character boundaries
are, though, and if they record it there’s no need for the buffer insertion
code to do that work. The below patch gives noticeably snappier performance
for me loading large files with reasonable amounts of non-ASCII characters.
It is very very much not ready to commit, I post it to show the idea and
because I don’t anticipate I’ll get to finishing it this month.
diff -r 94a6b8fbd56e src/file-coding.c
--- a/src/file-coding.c Tue Dec 17 20:49:52 2013 +0200
+++ b/src/file-coding.c Thu Dec 19 10:47:01 2013 +0000
@@ -1990,6 +1990,14 @@
return Lstream_seekable_p (str->other_end);
}
+static Charcount
+coding_character_tell (Lstream *stream)
+{
+ struct coding_stream *str = CODING_STREAM_DATA (stream);
+
+ return XCODESYSMETH_OR_GIVEN (str->codesys, character_tell, (str), -1);
+}
+
static int
coding_flusher (Lstream *stream)
{
@@ -2823,7 +2831,31 @@
#### Shouldn't we _call_ it that, then? And while we're at it,
separate it into "to_internal" and "to_external"? */
-DEFINE_CODING_SYSTEM_TYPE (no_conversion);
+
+
+struct no_conversion_coding_system
+{
+};
+
+struct no_conversion_coding_stream
+{
+ Charcount characters_seen;
+};
+
+static const struct memory_description no_conversion_coding_system_description[] = {
+ { XD_END }
+};
+
+static const struct memory_description no_conversion_coding_stream_description_1 [] = {
+ { XD_INT, offsetof (struct no_conversion_coding_stream, characters_seen) },
+ { XD_END }
+};
+
+const struct sized_memory_description no_conversion_coding_stream_description = {
+ sizeof (struct no_conversion_coding_stream), no_conversion_coding_stream_description_1
+};
+
+DEFINE_CODING_SYSTEM_TYPE_WITH_DATA (no_conversion);
/* This is used when reading in "binary" files -- i.e. files that may
contain all 256 possible byte values and that are not to be
@@ -2846,12 +2878,14 @@
DECODE_ADD_BINARY_CHAR (c, dst);
}
+ CODING_STREAM_TYPE_DATA (str, no_conversion)->characters_seen
+ += orign;
+
if (str->eof)
DECODE_OUTPUT_PARTIAL_CHAR (ch, dst);
}
else
{
-
while (n--)
{
c = *src++;
@@ -2893,6 +2927,13 @@
return orign;
}
+static Charcount
+no_conversion_character_tell (struct coding_stream *str)
+{
+#warning "examine the coding character mode too"n
+ return CODING_STREAM_TYPE_DATA (str, no_conversion)->characters_seen;
+}
+
DEFINE_DETECTOR (no_conversion);
DEFINE_DETECTOR_CATEGORY (no_conversion, no_conversion);
@@ -4645,6 +4686,7 @@
LSTREAM_HAS_METHOD (coding, writer);
LSTREAM_HAS_METHOD (coding, rewinder);
LSTREAM_HAS_METHOD (coding, seekable_p);
+ LSTREAM_HAS_METHOD (coding, character_tell);
LSTREAM_HAS_METHOD (coding, marker);
LSTREAM_HAS_METHOD (coding, flusher);
LSTREAM_HAS_METHOD (coding, closer);
@@ -4686,9 +4728,10 @@
dump_add_opaque_int (&coding_detector_count);
dump_add_opaque_int (&coding_detector_category_count);
- INITIALIZE_CODING_SYSTEM_TYPE (no_conversion,
- "no-conversion-coding-system-p");
+ INITIALIZE_CODING_SYSTEM_TYPE_WITH_DATA (no_conversion,
+ "no-conversion-coding-system-p");
CODING_SYSTEM_HAS_METHOD (no_conversion, convert);
+ CODING_SYSTEM_HAS_METHOD (no_conversion, character_tell);
INITIALIZE_DETECTOR (no_conversion);
DETECTOR_HAS_METHOD (no_conversion, detect);
diff -r 94a6b8fbd56e src/file-coding.h
--- a/src/file-coding.h Tue Dec 17 20:49:52 2013 +0200
+++ b/src/file-coding.h Thu Dec 19 10:47:01 2013 +0000
@@ -353,6 +353,9 @@
a result of the stream being rewound. Optional. */
void (*rewind_coding_stream_method) (struct coding_stream *str);
+ /* Return the number of characters processed. Optional. */
+ Charcount (*character_tell_method) (struct coding_stream *str);
+
/* Finalize coding stream method: Clean up the type-specific data
attached to the coding stream (i.e. in struct TYPE_coding_stream).
Happens when the Lstream is deleted using Lstream_delete() or is
@@ -1109,4 +1112,3 @@
int given);
#endif /* INCLUDED_file_coding_h_ */
-
diff -r 94a6b8fbd56e src/fileio.c
--- a/src/fileio.c Tue Dec 17 20:49:52 2013 +0200
+++ b/src/fileio.c Thu Dec 19 10:47:01 2013 +0000
@@ -3196,7 +3196,8 @@
while (1)
{
Bytecount this_len;
- Charcount cc_inserted;
+ Charcount last_tell
+ = Lstream_character_tell (XLSTREAM (stream)), cc_inserted;
QUIT;
this_len = Lstream_read (XLSTREAM (stream), read_buf,
@@ -3209,10 +3210,13 @@
break;
}
- cc_inserted = buffer_insert_raw_string_1 (buf, cur_point, read_buf,
- this_len,
- !NILP (visit)
- ? INSDEL_NO_LOCKING : 0);
+ cc_inserted
+ = buffer_insert_string_1 (buf, cur_point, read_buf, Qnil,
+ 0, this_len, last_tell > 0
+ ? Lstream_character_tell (XLSTREAM
+ (stream))
+ - last_tell : -1,
+ !NILP (visit) ? INSDEL_NO_LOCKING : 0);
inserted += cc_inserted;
cur_point += cc_inserted;
}
diff -r 94a6b8fbd56e src/insdel.c
--- a/src/insdel.c Tue Dec 17 20:49:52 2013 +0200
+++ b/src/insdel.c Thu Dec 19 10:47:01 2013 +0000
@@ -1061,13 +1061,12 @@
buffer_insert_string_1 (struct buffer *buf, Charbpos pos,
const Ibyte *nonreloc, Lisp_Object reloc,
Bytecount offset, Bytecount length,
- int flags)
+ Charcount cclen, int flags)
{
/* This function can GC */
struct gcpro gcpro1;
Bytebpos bytepos;
Bytecount length_in_buffer;
- Charcount cclen;
int move_point = 0;
struct buffer *mbuf;
Lisp_Object bufcons;
@@ -1118,14 +1117,30 @@
bytepos = charbpos_to_bytebpos (buf, pos);
- /* string may have been relocated up to this point */
- if (STRINGP (reloc))
+ if (cclen < 0)
{
- cclen = string_offset_byte_to_char_len (reloc, offset, length);
- nonreloc = XSTRING_DATA (reloc);
+ /* string may have been relocated up to this point */
+ if (STRINGP (reloc))
+ {
+ cclen = string_offset_byte_to_char_len (reloc, offset, length);
+ nonreloc = XSTRING_DATA (reloc);
+ }
+ else
+ cclen = bytecount_to_charcount (nonreloc + offset, length);
}
+#ifdef ERROR_CHECK_TEXT
else
- cclen = bytecount_to_charcount (nonreloc + offset, length);
+ {
+ text_checking_assert (cclen
+ == (STRINGP (reloc) ?
+ string_offset_byte_to_char_len (reloc,
+ offset, length)
+: bytecount_to_charcount (nonreloc + offset,
+ length)));
+
+ }
+#endif
+
/* &&#### Here we check if the text can't fit into the format of the buffer,
and if so convert it to another format (either default or 32-bit-fixed,
according to some flag; if no flag, use default). */
@@ -1286,7 +1301,7 @@
{
/* This function can GC */
return buffer_insert_string_1 (buf, pos, nonreloc, Qnil, 0, length,
- flags);
+ -1, flags);
}
Charcount
@@ -1295,8 +1310,7 @@
{
/* This function can GC */
return buffer_insert_string_1 (buf, pos, 0, str, 0,
- XSTRING_LENGTH (str),
- flags);
+ XSTRING_LENGTH (str), -1, flags);
}
/* Insert the null-terminated string S (in external format). */
@@ -1309,7 +1323,7 @@
const CIbyte *translated = GETTEXT (s);
ASSERT_ASCTEXT_ASCII (s);
return buffer_insert_string_1 (buf, pos, (const Ibyte *) translated, Qnil,
- 0, strlen (translated), flags);
+ 0, strlen (translated), -1, flags);
}
Charcount
@@ -1319,7 +1333,7 @@
/* This function can GC */
Ibyte str[MAX_ICHAR_LEN];
Bytecount len = set_itext_ichar (str, ch);
- return buffer_insert_string_1 (buf, pos, str, Qnil, 0, len, flags);
+ return buffer_insert_string_1 (buf, pos, str, Qnil, 0, len, -1, flags);
}
Charcount
@@ -1339,7 +1353,7 @@
/* This function can GC */
Lisp_Object str = make_string_from_buffer (buf2, pos2, length);
return buffer_insert_string_1 (buf, pos, 0, str, 0,
- XSTRING_LENGTH (str), flags);
+ XSTRING_LENGTH (str), -1, flags);
}
@@ -1674,7 +1688,7 @@
* backward so that it now equals the insertion point.
*/
buffer_insert_string_1 (buf, (movepoint ? -1 : pos),
- newstr, Qnil, 0, newlen, 0);
+ newstr, Qnil, 0, newlen, -1, 0);
}
}
diff -r 94a6b8fbd56e src/insdel.h
--- a/src/insdel.h Tue Dec 17 20:49:52 2013 +0200
+++ b/src/insdel.h Thu Dec 19 10:47:01 2013 +0000
@@ -38,7 +38,7 @@
Charcount buffer_insert_string_1 (struct buffer *buf, Charbpos pos,
const Ibyte *nonreloc, Lisp_Object reloc,
Bytecount offset, Bytecount length,
- int flags);
+ Charcount clen, int flags);
Charcount buffer_insert_raw_string_1 (struct buffer *buf, Charbpos pos,
const Ibyte *nonreloc,
Bytecount length, int flags);
@@ -58,7 +58,7 @@
All of these can GC. */
#define buffer_insert_string(buf, nonreloc, reloc, offset, length) \
- buffer_insert_string_1 (buf, -1, nonreloc, reloc, offset, length, 0)
+ buffer_insert_string_1 (buf, -1, nonreloc, reloc, offset, length, -1, 0)
#define buffer_insert_raw_string(buf, string, length) \
buffer_insert_raw_string_1 (buf, -1, string, length, 0)
#define buffer_insert_ascstring(buf, s) \
diff -r 94a6b8fbd56e src/lstream.c
--- a/src/lstream.c Tue Dec 17 20:49:52 2013 +0200
+++ b/src/lstream.c Thu Dec 19 10:47:01 2013 +0000
@@ -735,6 +735,11 @@
return Lstream_read_1 (lstr, data, size, 0);
}
+Charcount
+Lstream_character_tell (Lstream *lstr)
+{
+ return lstr->imp->character_tell ? lstr->imp->character_tell (lstr) : -1;
+}
/* Push back SIZE bytes of DATA onto the input queue. The next call
to Lstream_read() with the same size will read the same bytes back.
diff -r 94a6b8fbd56e src/lstream.h
--- a/src/lstream.h Tue Dec 17 20:49:52 2013 +0200
+++ b/src/lstream.h Thu Dec 19 10:47:01 2013 +0000
@@ -181,6 +181,8 @@
method. If this method is not present, the result is determined
by whether a rewind method is present. */
int (*seekable_p) (Lstream *stream);
+
+ Charcount (*character_tell) (Lstream *stream);
/* Perform any additional operations necessary to flush the
data in this stream. */
int (*flusher) (Lstream *stream);
@@ -297,8 +299,8 @@
int Lstream_fputc (Lstream *lstr, int c);
int Lstream_fgetc (Lstream *lstr);
void Lstream_fungetc (Lstream *lstr, int c);
-Bytecount Lstream_read (Lstream *lstr, void *data,
- Bytecount size);
+Bytecount Lstream_read (Lstream *lstr, void *data, Bytecount size);
+Charcount Lstream_character_tell (Lstream *);
int Lstream_write (Lstream *lstr, const void *data,
Bytecount size);
int Lstream_was_blocked_p (Lstream *lstr);
diff -r 94a6b8fbd56e src/print.c
--- a/src/print.c Tue Dec 17 20:49:52 2013 +0200
+++ b/src/print.c Thu Dec 19 10:47:01 2013 +0000
@@ -514,7 +514,7 @@
buffer_insert_string_1 (XMARKER (function)->buffer,
spoint, nonreloc, reloc, offset, len,
- 0);
+ -1, 0);
Fset_marker (function, make_fixnum (spoint + cclen),
Fmarker_buffer (function));
}
diff -r 94a6b8fbd56e src/unicode.c
--- a/src/unicode.c Tue Dec 17 20:49:52 2013 +0200
+++ b/src/unicode.c Thu Dec 19 10:47:01 2013 +0000
@@ -1707,6 +1707,7 @@
unsigned char counter;
unsigned char indicated_length;
int seen_char;
+ Charcount characters_seen;
/* encode */
Lisp_Object current_charset;
int current_char_boundary;
@@ -1988,6 +1989,18 @@
write_error_characters_as_such);
}
+static Charcount
+unicode_character_tell (struct coding_stream *str)
+{
+#warning "examine the coding character mode too"n
+ if (CODING_STREAM_TYPE_DATA (str, unicode)->counter == 0)
+ {
+ return CODING_STREAM_TYPE_DATA (str, unicode)->characters_seen;
+ }
+
+ return -1;
+}
+
static Bytecount
unicode_convert (struct coding_stream *str, const UExtbyte *src,
unsigned_char_dynarr *dst, Bytecount n)
@@ -2006,6 +2019,7 @@
unsigned char counter = data->counter;
unsigned char indicated_length
= data->indicated_length;
+ Charcount characters_seen = data->characters_seen;
while (n--)
{
@@ -2020,12 +2034,15 @@
{
/* ASCII. */
decode_unicode_char (c, dst, data, ignore_bom);
+ characters_seen++;
}
else if (0 == (c & 0x40))
{
/* Highest bit set, second highest not--there's
something wrong. */
DECODE_ERROR_OCTET (c, dst, data, ignore_bom);
+ /* This is a character in the buffer. */
+ characters_seen++;
}
else if (0 == (c & 0x20))
{
@@ -2050,7 +2067,7 @@
/* We don't supports lengths longer than 4 in
external-format data. */
DECODE_ERROR_OCTET (c, dst, data, ignore_bom);
-
+ characters_seen++;
}
}
else
@@ -2061,15 +2078,20 @@
indicate_invalid_utf_8(indicated_length,
counter,
ch, dst, data, ignore_bom);
+ /* These are characters our receiver will see, not
+ actual characters we've seen in the input. */
+ characters_seen += (indicated_length - counter);
if (c & 0x80)
{
DECODE_ERROR_OCTET (c, dst, data, ignore_bom);
+ characters_seen++;
}
else
{
/* The character just read is ASCII. Treat it as
such. */
decode_unicode_char (c, dst, data, ignore_bom);
+ characters_seen++;
}
ch = 0;
counter = 0;
@@ -2092,10 +2114,12 @@
counter,
ch, dst, data,
ignore_bom);
+ characters_seen += (indicated_length - counter);
}
else
{
decode_unicode_char (ch, dst, data, ignore_bom);
+ characters_seen++;
}
ch = 0;
}
@@ -2242,6 +2266,7 @@
indicate_invalid_utf_8(indicated_length,
counter, ch, dst, data,
ignore_bom);
+ characters_seen += (indicated_length - counter);
break;
case UNICODE_UTF_16:
@@ -2295,6 +2320,7 @@
data->counter = counter;
data->indicated_length = indicated_length;
+ data->characters_seen = characters_seen;
}
else
{
@@ -3177,6 +3203,8 @@
CODING_SYSTEM_HAS_METHOD (unicode, putprop);
CODING_SYSTEM_HAS_METHOD (unicode, getprop);
+ CODING_SYSTEM_HAS_METHOD (unicode, character_tell);
+
INITIALIZE_DETECTOR (utf_8);
DETECTOR_HAS_METHOD (utf_8, detect);
INITIALIZE_DETECTOR_CATEGORY (utf_8, utf_8);
--
‘Liston operated so fast that he once accidentally amputated an assistant’s
fingers along with a patient’s leg, […] The patient and the assistant both
died of sepsis, and a spectator reportedly died of shock, resulting in the
only known procedure with a 300% mortality.’ (Atul Gawande, NEJM, 2012)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/XEmacs: kehoea: Pass character count from coding systems to buffer insertion code.
10 years, 11 months
Bitbucket
1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/65d65b52d608/
Changeset: 65d65b52d608
User: kehoea
Date: 2014-01-16 17:27:52
Summary: Pass character count from coding systems to buffer insertion code.
src/ChangeLog addition:
2014-01-16 Aidan Kehoe <kehoea(a)parhasard.net>
Pass character count information from the no-conversion and
unicode coding systems to the buffer insertion code, making
#'find-file on large buffers a little snappier (if
ERROR_CHECK_TEXT is not defined).
* file-coding.c:
* file-coding.c (coding_character_tell): New.
* file-coding.c (conversion_coding_stream_description): New.
* file-coding.c (no_conversion_convert):
Update characters_seen when decoding.
* file-coding.c (no_conversion_character_tell): New.
* file-coding.c (lstream_type_create_file_coding): Create the
no_conversion type with data.
* file-coding.c (coding_system_type_create):
Make the character_tell method available here.
* file-coding.h:
* file-coding.h (struct coding_system_methods):
Add a new character_tell() method, passing charcount information
from the coding systems to the buffer code, avoiding duplicate
bytecount-to-charcount work especially with large buffers.
* fileio.c (Finsert_file_contents_internal):
Update this to pass charcount information to
buffer_insert_string_1(), if that is available from the lstream code.
* insdel.c:
* insdel.c (buffer_insert_string_1):
Add a new CCLEN argument, giving the character count of the string
to insert. It can be -1 to indicate that te function should work
it out itself using bytecount_to_charcount(), as it used to.
* insdel.c (buffer_insert_raw_string_1):
* insdel.c (buffer_insert_lisp_string_1):
* insdel.c (buffer_insert_ascstring_1):
* insdel.c (buffer_insert_emacs_char_1):
* insdel.c (buffer_insert_from_buffer_1):
* insdel.c (buffer_replace_char):
Update these functions to use the new calling convention.
* insdel.h:
* insdel.h (buffer_insert_string):
Update this header to reflect the new buffer_insert_string_1()
argument.
* lstream.c (Lstream_character_tell): New.
Return the number of characters *read* and seen by the consumer so
far, taking into account the unget buffer, and buffered reading.
* lstream.c (Lstream_unread):
Update unget_character_count here as appropriate.
* lstream.c (Lstream_rewind):
Reset unget_character_count here too.
* lstream.h:
* lstream.h (struct lstream):
Provide the character_tell method, add a new field,
unget_character_count, giving the number of characters ever passed
to Lstream_unread().
Declare Lstream_character_tell().
Make Lstream_ungetc(), which happens to be unused, an inline
function rather than a macro, in the course of updating it to
modify unget_character_count.
* print.c (output_string):
Use the new argument to buffer_insert_string_1().
* tests.c:
* tests.c (Ftest_character_tell):
New test function.
* tests.c (syms_of_tests):
Make it available.
* unicode.c:
* unicode.c (struct unicode_coding_stream):
* unicode.c (unicode_character_tell):
New method.
* unicode.c (unicode_convert):
Update the character counter as appropriate.
* unicode.c (coding_system_type_create_unicode):
Make the character_tell method available.
Affected #: 11 files
diff -r 4004c3266c09888a9935242a462beb3fb28e02a3 -r 65d65b52d608ca1f17365a96fc3cf710a3af625c src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,82 @@
+2014-01-16 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ Pass character count information from the no-conversion and
+ unicode coding systems to the buffer insertion code, making
+ #'find-file on large buffers a little snappier (if
+ ERROR_CHECK_TEXT is not defined).
+
+ * file-coding.c:
+ * file-coding.c (coding_character_tell): New.
+ * file-coding.c (conversion_coding_stream_description): New.
+ * file-coding.c (no_conversion_convert):
+ Update characters_seen when decoding.
+ * file-coding.c (no_conversion_character_tell): New.
+ * file-coding.c (lstream_type_create_file_coding): Create the
+ no_conversion type with data.
+ * file-coding.c (coding_system_type_create):
+ Make the character_tell method available here.
+ * file-coding.h:
+ * file-coding.h (struct coding_system_methods):
+ Add a new character_tell() method, passing charcount information
+ from the coding systems to the buffer code, avoiding duplicate
+ bytecount-to-charcount work especially with large buffers.
+
+ * fileio.c (Finsert_file_contents_internal):
+ Update this to pass charcount information to
+ buffer_insert_string_1(), if that is available from the lstream code.
+
+ * insdel.c:
+ * insdel.c (buffer_insert_string_1):
+ Add a new CCLEN argument, giving the character count of the string
+ to insert. It can be -1 to indicate that te function should work
+ it out itself using bytecount_to_charcount(), as it used to.
+ * insdel.c (buffer_insert_raw_string_1):
+ * insdel.c (buffer_insert_lisp_string_1):
+ * insdel.c (buffer_insert_ascstring_1):
+ * insdel.c (buffer_insert_emacs_char_1):
+ * insdel.c (buffer_insert_from_buffer_1):
+ * insdel.c (buffer_replace_char):
+ Update these functions to use the new calling convention.
+ * insdel.h:
+ * insdel.h (buffer_insert_string):
+ Update this header to reflect the new buffer_insert_string_1()
+ argument.
+
+ * lstream.c (Lstream_character_tell): New.
+ Return the number of characters *read* and seen by the consumer so
+ far, taking into account the unget buffer, and buffered reading.
+
+ * lstream.c (Lstream_unread):
+ Update unget_character_count here as appropriate.
+ * lstream.c (Lstream_rewind):
+ Reset unget_character_count here too.
+
+ * lstream.h:
+ * lstream.h (struct lstream):
+ Provide the character_tell method, add a new field,
+ unget_character_count, giving the number of characters ever passed
+ to Lstream_unread().
+ Declare Lstream_character_tell().
+ Make Lstream_ungetc(), which happens to be unused, an inline
+ function rather than a macro, in the course of updating it to
+ modify unget_character_count.
+
+ * print.c (output_string):
+ Use the new argument to buffer_insert_string_1().
+ * tests.c:
+ * tests.c (Ftest_character_tell):
+ New test function.
+ * tests.c (syms_of_tests):
+ Make it available.
+ * unicode.c:
+ * unicode.c (struct unicode_coding_stream):
+ * unicode.c (unicode_character_tell):
+ New method.
+ * unicode.c (unicode_convert):
+ Update the character counter as appropriate.
+ * unicode.c (coding_system_type_create_unicode):
+ Make the character_tell method available.
+
2013-12-19 Aidan Kehoe <kehoea(a)parhasard.net>
* text.c:
diff -r 4004c3266c09888a9935242a462beb3fb28e02a3 -r 65d65b52d608ca1f17365a96fc3cf710a3af625c src/file-coding.c
--- a/src/file-coding.c
+++ b/src/file-coding.c
@@ -1990,6 +1990,14 @@
return Lstream_seekable_p (str->other_end);
}
+static Charcount
+coding_character_tell (Lstream *stream)
+{
+ struct coding_stream *str = CODING_STREAM_DATA (stream);
+
+ return XCODESYSMETH_OR_GIVEN (str->codesys, character_tell, (str), -1);
+}
+
static int
coding_flusher (Lstream *stream)
{
@@ -2823,7 +2831,32 @@
#### Shouldn't we _call_ it that, then? And while we're at it,
separate it into "to_internal" and "to_external"? */
-DEFINE_CODING_SYSTEM_TYPE (no_conversion);
+
+
+struct no_conversion_coding_system
+{
+};
+
+struct no_conversion_coding_stream
+{
+ /* Number of characters seen when decoding. */
+ Charcount characters_seen;
+};
+
+static const struct memory_description no_conversion_coding_system_description[] = {
+ { XD_END }
+};
+
+static const struct memory_description no_conversion_coding_stream_description_1 [] = {
+ { XD_INT, offsetof (struct no_conversion_coding_stream, characters_seen) },
+ { XD_END }
+};
+
+const struct sized_memory_description no_conversion_coding_stream_description = {
+ sizeof (struct no_conversion_coding_stream), no_conversion_coding_stream_description_1
+};
+
+DEFINE_CODING_SYSTEM_TYPE_WITH_DATA (no_conversion);
/* This is used when reading in "binary" files -- i.e. files that may
contain all 256 possible byte values and that are not to be
@@ -2846,6 +2879,9 @@
DECODE_ADD_BINARY_CHAR (c, dst);
}
+ CODING_STREAM_TYPE_DATA (str, no_conversion)->characters_seen
+ += orign;
+
if (str->eof)
DECODE_OUTPUT_PARTIAL_CHAR (ch, dst);
}
@@ -2904,6 +2940,12 @@
return orign;
}
+static Charcount
+no_conversion_character_tell (struct coding_stream *str)
+{
+ return CODING_STREAM_TYPE_DATA (str, no_conversion)->characters_seen;
+}
+
DEFINE_DETECTOR (no_conversion);
DEFINE_DETECTOR_CATEGORY (no_conversion, no_conversion);
@@ -4656,6 +4698,7 @@
LSTREAM_HAS_METHOD (coding, writer);
LSTREAM_HAS_METHOD (coding, rewinder);
LSTREAM_HAS_METHOD (coding, seekable_p);
+ LSTREAM_HAS_METHOD (coding, character_tell);
LSTREAM_HAS_METHOD (coding, marker);
LSTREAM_HAS_METHOD (coding, flusher);
LSTREAM_HAS_METHOD (coding, closer);
@@ -4697,9 +4740,10 @@
dump_add_opaque_int (&coding_detector_count);
dump_add_opaque_int (&coding_detector_category_count);
- INITIALIZE_CODING_SYSTEM_TYPE (no_conversion,
- "no-conversion-coding-system-p");
+ INITIALIZE_CODING_SYSTEM_TYPE_WITH_DATA (no_conversion,
+ "no-conversion-coding-system-p");
CODING_SYSTEM_HAS_METHOD (no_conversion, convert);
+ CODING_SYSTEM_HAS_METHOD (no_conversion, character_tell);
INITIALIZE_DETECTOR (no_conversion);
DETECTOR_HAS_METHOD (no_conversion, detect);
diff -r 4004c3266c09888a9935242a462beb3fb28e02a3 -r 65d65b52d608ca1f17365a96fc3cf710a3af625c src/file-coding.h
--- a/src/file-coding.h
+++ b/src/file-coding.h
@@ -353,6 +353,9 @@
a result of the stream being rewound. Optional. */
void (*rewind_coding_stream_method) (struct coding_stream *str);
+ /* Return the number of characters *decoded*. Optional. */
+ Charcount (*character_tell_method) (struct coding_stream *str);
+
/* Finalize coding stream method: Clean up the type-specific data
attached to the coding stream (i.e. in struct TYPE_coding_stream).
Happens when the Lstream is deleted using Lstream_delete() or is
diff -r 4004c3266c09888a9935242a462beb3fb28e02a3 -r 65d65b52d608ca1f17365a96fc3cf710a3af625c src/fileio.c
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3180,6 +3180,7 @@
struct gcpro ngcpro1;
Lisp_Object stream = make_filedesc_input_stream (fd, 0, total,
LSTR_ALLOW_QUIT);
+ Charcount last_tell = -1;
NGCPRO1 (stream);
Lstream_set_buffering (XLSTREAM (stream), LSTREAM_BLOCKN_BUFFERED, 65536);
@@ -3187,6 +3188,7 @@
(XLSTREAM (stream), get_coding_system_for_text_file (codesys, 1),
CODING_DECODE, 0);
Lstream_set_buffering (XLSTREAM (stream), LSTREAM_BLOCKN_BUFFERED, 65536);
+ last_tell = Lstream_character_tell (XLSTREAM (stream));
record_unwind_protect (delete_stream_unwind, stream);
@@ -3196,7 +3198,7 @@
while (1)
{
Bytecount this_len;
- Charcount cc_inserted;
+ Charcount cc_inserted, this_tell = last_tell;
QUIT;
this_len = Lstream_read (XLSTREAM (stream), read_buf,
@@ -3209,12 +3211,17 @@
break;
}
- cc_inserted = buffer_insert_raw_string_1 (buf, cur_point, read_buf,
- this_len,
- !NILP (visit)
- ? INSDEL_NO_LOCKING : 0);
+ cc_inserted
+ = buffer_insert_string_1 (buf, cur_point, read_buf, Qnil,
+ 0, this_len, last_tell >= 0
+ ? (this_tell
+ = Lstream_character_tell (XLSTREAM
+ (stream)))
+ - last_tell : -1,
+ !NILP (visit) ? INSDEL_NO_LOCKING : 0);
inserted += cc_inserted;
cur_point += cc_inserted;
+ last_tell = this_tell;
}
if (!NILP (used_codesys))
{
diff -r 4004c3266c09888a9935242a462beb3fb28e02a3 -r 65d65b52d608ca1f17365a96fc3cf710a3af625c src/insdel.c
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -1039,14 +1039,15 @@
#endif
}
-/* Insert a string into BUF at Charbpos POS. The string data comes
- from one of two sources: constant, non-relocatable data (specified
- in NONRELOC), or a Lisp string object (specified in RELOC), which
- is relocatable and may have extent data that needs to be copied
- into the buffer. OFFSET and LENGTH specify the substring of the
- data that is actually to be inserted. As a special case, if POS
- is -1, insert the string at point and move point to the end of the
- string.
+/* Insert a string into BUF at Charbpos POS. The string data comes from one
+ of two sources: constant, non-relocatable data (specified in NONRELOC),
+ or a Lisp string object (specified in RELOC), which is relocatable and
+ may have extent data that needs to be copied into the buffer. OFFSET and
+ LENGTH specify the substring of the data that is actually to be inserted.
+ As a special case, if POS is -1, insert the string at point and move
+ point to the end of the string. CCLEN is the character count of the data
+ to be inserted, and can be -1 to indicate that buffer_insert_string_1 ()
+ should work this out itself with bytecount_to_charcount().
Normally, markers at the insertion point end up before the
inserted string. If INSDEL_BEFORE_MARKERS is set in flags, however,
@@ -1061,13 +1062,12 @@
buffer_insert_string_1 (struct buffer *buf, Charbpos pos,
const Ibyte *nonreloc, Lisp_Object reloc,
Bytecount offset, Bytecount length,
- int flags)
+ Charcount cclen, int flags)
{
/* This function can GC */
struct gcpro gcpro1;
Bytebpos bytepos;
Bytecount length_in_buffer;
- Charcount cclen;
int move_point = 0;
struct buffer *mbuf;
Lisp_Object bufcons;
@@ -1118,14 +1118,27 @@
bytepos = charbpos_to_bytebpos (buf, pos);
- /* string may have been relocated up to this point */
- if (STRINGP (reloc))
+ if (cclen < 0)
{
- cclen = string_offset_byte_to_char_len (reloc, offset, length);
- nonreloc = XSTRING_DATA (reloc);
+ /* string may have been relocated up to this point */
+ if (STRINGP (reloc))
+ {
+ cclen = string_offset_byte_to_char_len (reloc, offset, length);
+ nonreloc = XSTRING_DATA (reloc);
+ }
+ else
+ cclen = bytecount_to_charcount (nonreloc + offset, length);
}
else
- cclen = bytecount_to_charcount (nonreloc + offset, length);
+ {
+ text_checking_assert (cclen > 0 && cclen
+ == (STRINGP (reloc) ?
+ string_offset_byte_to_char_len (reloc, offset,
+ length)
+: bytecount_to_charcount (nonreloc + offset,
+ length)));
+ }
+
/* &&#### Here we check if the text can't fit into the format of the buffer,
and if so convert it to another format (either default or 32-bit-fixed,
according to some flag; if no flag, use default). */
@@ -1286,7 +1299,7 @@
{
/* This function can GC */
return buffer_insert_string_1 (buf, pos, nonreloc, Qnil, 0, length,
- flags);
+ -1, flags);
}
Charcount
@@ -1295,8 +1308,7 @@
{
/* This function can GC */
return buffer_insert_string_1 (buf, pos, 0, str, 0,
- XSTRING_LENGTH (str),
- flags);
+ XSTRING_LENGTH (str), -1, flags);
}
/* Insert the null-terminated string S (in external format). */
@@ -1309,7 +1321,7 @@
const CIbyte *translated = GETTEXT (s);
ASSERT_ASCTEXT_ASCII (s);
return buffer_insert_string_1 (buf, pos, (const Ibyte *) translated, Qnil,
- 0, strlen (translated), flags);
+ 0, strlen (translated), -1, flags);
}
Charcount
@@ -1319,7 +1331,7 @@
/* This function can GC */
Ibyte str[MAX_ICHAR_LEN];
Bytecount len = set_itext_ichar (str, ch);
- return buffer_insert_string_1 (buf, pos, str, Qnil, 0, len, flags);
+ return buffer_insert_string_1 (buf, pos, str, Qnil, 0, len, -1, flags);
}
Charcount
@@ -1339,7 +1351,7 @@
/* This function can GC */
Lisp_Object str = make_string_from_buffer (buf2, pos2, length);
return buffer_insert_string_1 (buf, pos, 0, str, 0,
- XSTRING_LENGTH (str), flags);
+ XSTRING_LENGTH (str), -1, flags);
}
@@ -1674,7 +1686,7 @@
* backward so that it now equals the insertion point.
*/
buffer_insert_string_1 (buf, (movepoint ? -1 : pos),
- newstr, Qnil, 0, newlen, 0);
+ newstr, Qnil, 0, newlen, -1, 0);
}
}
diff -r 4004c3266c09888a9935242a462beb3fb28e02a3 -r 65d65b52d608ca1f17365a96fc3cf710a3af625c src/insdel.h
--- a/src/insdel.h
+++ b/src/insdel.h
@@ -38,7 +38,7 @@
Charcount buffer_insert_string_1 (struct buffer *buf, Charbpos pos,
const Ibyte *nonreloc, Lisp_Object reloc,
Bytecount offset, Bytecount length,
- int flags);
+ Charcount clen, int flags);
Charcount buffer_insert_raw_string_1 (struct buffer *buf, Charbpos pos,
const Ibyte *nonreloc,
Bytecount length, int flags);
@@ -58,7 +58,7 @@
All of these can GC. */
#define buffer_insert_string(buf, nonreloc, reloc, offset, length) \
- buffer_insert_string_1 (buf, -1, nonreloc, reloc, offset, length, 0)
+ buffer_insert_string_1 (buf, -1, nonreloc, reloc, offset, length, -1, 0)
#define buffer_insert_raw_string(buf, string, length) \
buffer_insert_raw_string_1 (buf, -1, string, length, 0)
#define buffer_insert_ascstring(buf, s) \
diff -r 4004c3266c09888a9935242a462beb3fb28e02a3 -r 65d65b52d608ca1f17365a96fc3cf710a3af625c src/lstream.c
--- a/src/lstream.c
+++ b/src/lstream.c
@@ -735,6 +735,134 @@
return Lstream_read_1 (lstr, data, size, 0);
}
+Charcount
+Lstream_character_tell (Lstream *lstr)
+{
+ Charcount ctell = lstr->imp->character_tell ?
+ lstr->imp->character_tell (lstr) : -1;
+
+ if (ctell >= 0)
+ {
+ /* Our implementation's character tell code doesn't know about the
+ unget buffer, update its figure to reflect it. */
+ ctell += lstr->unget_character_count;
+
+ if (lstr->unget_buffer_ind > 0)
+ {
+ /* The character count should not include those characters
+ currently *in* the unget buffer, subtract that count. */
+ Ibyte *ungot, *ungot_ptr;
+ Bytecount ii = lstr->unget_buffer_ind, impartial, sevenflen;
+
+ ungot_ptr = ungot
+ = alloca_ibytes (lstr->unget_buffer_ind) + MAX_ICHAR_LEN;
+
+ /* Make sure the string starts with a valid ibyteptr, otherwise
+ validate_ibyte_string_backward could run off the beginning. */
+ sevenflen = set_itext_ichar (ungot, (Ichar) 0x7f);
+ ungot_ptr += sevenflen;
+
+ /* Internal format data, but in reverse order. There's not
+ actually a need to alloca here, we could work out the character
+ count directly from the reversed bytes, but the alloca approach
+ is more robust to changes in our internal format, and the unget
+ buffer is not going to blow the stack. */
+ while (ii > 0)
+ {
+ *ungot_ptr++ = lstr->unget_buffer[--ii];
+ }
+
+ impartial
+ = validate_ibyte_string_backward (ungot, ungot_ptr - ungot);
+
+ /* Move past the character we added. */
+ impartial -= sevenflen;
+ INC_IBYTEPTR (ungot);
+
+ if (impartial > 0 && !valid_ibyteptr_p (ungot))
+ {
+ Ibyte *newstart = ungot, *limit = ungot + impartial;
+ /* Our consumer has the start of a partial character, we
+ have the rest. */
+
+ while (!valid_ibyteptr_p (newstart) && newstart < limit)
+ {
+ newstart++, impartial--;
+ }
+
+ /* Remove this character from the count, since the
+ end-consumer hasn't seen the full character. */
+ ctell--;
+ ungot = newstart;
+ }
+ else if (valid_ibyteptr_p (ungot)
+ && rep_bytes_by_first_byte (*ungot) > impartial)
+ {
+ /* Rest of a partial character has yet to be read, its first
+ octet has probably been unread by Lstream_read_1(). We
+ included it in the accounting in Lstream_unread(), adjust
+ the figure here appropriately. */
+ ctell--;
+ }
+
+ /* bytecount_to_charcount will throw an assertion failure if we're
+ not at the start of a character. */
+ text_checking_assert (impartial == 0 || valid_ibyteptr_p (ungot));
+
+ /* The character length of this text is included in
+ unget_character_count; if the bytes are still in the unget
+ buffer, then our consumers haven't seen them, and so the
+ character tell figure shouldn't reflect them. Subtract it from
+ the total. */
+ ctell -= bytecount_to_charcount (ungot, impartial);
+ }
+
+ if (lstr->in_buffer_ind < lstr->in_buffer_current)
+ {
+ Ibyte *inbuf = lstr->in_buffer + lstr->in_buffer_ind;
+ Bytecount partial = lstr->in_buffer_current - lstr->in_buffer_ind,
+ impartial;
+
+ if (!valid_ibyteptr_p (inbuf))
+ {
+ Ibyte *newstart = inbuf;
+ Ibyte *limit = lstr->in_buffer + lstr->in_buffer_current;
+ /* Our consumer has the start of a partial character, we
+ have the rest. */
+
+ while (newstart < limit && !valid_ibyteptr_p (newstart))
+ {
+ newstart++;
+ }
+
+ /* Remove this character from the count, since the
+ end-consumer hasn't seen the full character. */
+ ctell--;
+ inbuf = newstart;
+ partial = limit - newstart;
+ }
+
+ if (valid_ibyteptr_p (inbuf))
+ {
+ /* There's at least one valid starting char in the string,
+ validate_ibyte_string_backward won't run off the
+ begining. */
+ impartial =
+ validate_ibyte_string_backward (inbuf, partial);
+ }
+ else
+ {
+ impartial = 0;
+ }
+
+ ctell -= bytecount_to_charcount (inbuf, impartial);
+ }
+
+ text_checking_assert (ctell >= 0);
+ }
+
+ return ctell;
+}
/* Push back SIZE bytes of DATA onto the input queue. The next call
to Lstream_read() with the same size will read the same bytes back.
@@ -755,7 +883,12 @@
/* Bytes have to go on in reverse order -- they are reversed
again when read back. */
while (size--)
- lstr->unget_buffer[lstr->unget_buffer_ind++] = p[size];
+ {
+ lstr->unget_buffer[lstr->unget_buffer_ind++] = p[size];
+ /* If we see a valid first byte, that is the last octet in a
+ character, so increase the count of ungot characters. */
+ lstr->unget_character_count += valid_ibyteptr_p (p + size);
+ }
}
/* Rewind the stream to the beginning. */
@@ -768,6 +901,7 @@
if (Lstream_flush (lstr) < 0)
return -1;
lstr->byte_count = 0;
+ lstr->unget_character_count = 0;
return (lstr->imp->rewinder) (lstr);
}
diff -r 4004c3266c09888a9935242a462beb3fb28e02a3 -r 65d65b52d608ca1f17365a96fc3cf710a3af625c src/lstream.h
--- a/src/lstream.h
+++ b/src/lstream.h
@@ -181,6 +181,10 @@
method. If this method is not present, the result is determined
by whether a rewind method is present. */
int (*seekable_p) (Lstream *stream);
+
+ /* Return the number of complete characters read so far. Respects
+ buffering and unget. Returns -1 if unknown or not implemented. */
+ Charcount (*character_tell) (Lstream *stream);
/* Perform any additional operations necessary to flush the
data in this stream. */
int (*flusher) (Lstream *stream);
@@ -250,8 +254,9 @@
similarly has to push the data on backwards. */
unsigned char *unget_buffer; /* holds characters pushed back onto input */
Bytecount unget_buffer_size; /* allocated size of buffer */
- Bytecount unget_buffer_ind; /* pointer to next buffer spot
- to write a character */
+ Bytecount unget_buffer_ind; /* Next buffer spot to write a character */
+
+ Charcount unget_character_count; /* Count of complete characters ever ungot. */
Bytecount byte_count;
int flags;
@@ -297,8 +302,8 @@
int Lstream_fputc (Lstream *lstr, int c);
int Lstream_fgetc (Lstream *lstr);
void Lstream_fungetc (Lstream *lstr, int c);
-Bytecount Lstream_read (Lstream *lstr, void *data,
- Bytecount size);
+Bytecount Lstream_read (Lstream *lstr, void *data, Bytecount size);
+Charcount Lstream_character_tell (Lstream *);
int Lstream_write (Lstream *lstr, const void *data,
Bytecount size);
int Lstream_was_blocked_p (Lstream *lstr);
@@ -353,19 +358,28 @@
reverse order they were pushed back -- most recent first. (This is
necessary for consistency -- if there are a number of bytes that
have been unread and I read and unread a byte, it needs to be the
- first to be read again.) This is a macro and so it is very
- efficient. The C argument is only evaluated once but the STREAM
- argument is evaluated more than once.
- */
+ first to be read again.) */
-#define Lstream_ungetc(stream, c) \
-/* Add to the end if it won't overflow buffer; otherwise call the \
- function equivalent */ \
- ((stream)->unget_buffer_ind >= (stream)->unget_buffer_size ? \
- Lstream_fungetc (stream, c) : \
- (void) ((stream)->byte_count--, \
- ((stream)->unget_buffer[(stream)->unget_buffer_ind++] = \
- (unsigned char) (c))))
+DECLARE_INLINE_HEADER (
+void
+Lstream_ungetc (Lstream *lstr, int c)
+)
+{
+ /* Add to the end if it won't overflow buffer; otherwise call the
+ function equivalent */
+ if (lstr->unget_buffer_ind >= lstr->unget_buffer_size)
+ {
+ Lstream_fungetc (lstr, c);
+ }
+ else
+ {
+ lstr->byte_count--;
+ lstr->unget_buffer[lstr->unget_buffer_ind] = (unsigned char) (c);
+ lstr->unget_character_count
+ += valid_ibyteptr_p (lstr->unget_buffer + lstr->unget_buffer_ind);
+ lstr->unget_buffer_ind++;
+ }
+}
#define Lstream_data(stream) ((void *) ((stream)->data))
#define Lstream_byte_count(stream) ((stream)->byte_count)
diff -r 4004c3266c09888a9935242a462beb3fb28e02a3 -r 65d65b52d608ca1f17365a96fc3cf710a3af625c src/print.c
--- a/src/print.c
+++ b/src/print.c
@@ -514,7 +514,7 @@
buffer_insert_string_1 (XMARKER (function)->buffer,
spoint, nonreloc, reloc, offset, len,
- 0);
+ -1, 0);
Fset_marker (function, make_fixnum (spoint + cclen),
Fmarker_buffer (function));
}
diff -r 4004c3266c09888a9935242a462beb3fb28e02a3 -r 65d65b52d608ca1f17365a96fc3cf710a3af625c src/tests.c
--- a/src/tests.c
+++ b/src/tests.c
@@ -558,6 +558,186 @@
return conversion_result;
}
+DEFUN ("test-character-tell", Ftest_character_tell, 0, 0, "", /*
+Return list of results of tests of the stream character offset code.
+For use by the automated test suite. See tests/automated/c-tests.
+
+Each element is a list (DESCRIPTION, STATUS, REASON).
+DESCRIPTION is a string describing the test.
+STATUS is a symbol, either t (pass) or nil (fail).
+REASON is nil or a string describing the failure (not required).
+*/
+ ())
+{
+ Extbyte ext_unix[]= "\n\nfoo\nbar\n\nf\372b\343\340\nfoo\nbar\n";
+ /* Previous string in UTF-8. */
+ Extbyte ext_utf_8_unix[]
+ = "\n\nfoo\nbar\n\nf\303\272b\303\243\303\240\nfoo\nbar\n";
+ Charcount ext_utf_8_unix_char_len = 25;
+ Ibyte shortbuf[13], longbuf[512];
+ Lisp_Object stream =
+ make_fixed_buffer_input_stream (ext_unix, sizeof (ext_unix) - 1);
+ Lisp_Object result = Qnil, string = Qnil;
+ Charcount count;
+ Bytecount bytecount;
+ struct gcpro gcpro1, gcpro2, gcpro3;
+
+#define CHARACTER_TELL_ASSERT(assertion, description, failing_case) \
+ do \
+ { \
+ if (assertion) \
+ result = Fcons (list3 (build_cistring (description), \
+ Qt, Qnil), result); \
+ else \
+ result = Fcons (list3 (build_cistring (description), \
+ Qnil, build_ascstring (failing_case)), \
+ result); \
+ } \
+ while (0)
+
+ GCPRO3 (stream, result, string);
+
+ Lstream_set_buffering (XLSTREAM (stream), LSTREAM_BLOCKN_BUFFERED, 65536);
+ stream = make_coding_input_stream
+ (XLSTREAM (stream), Ffind_coding_system (intern ("no-conversion-unix")),
+ CODING_DECODE, 0);
+ Lstream_set_buffering (XLSTREAM (stream), LSTREAM_BLOCKN_BUFFERED, 65536);
+
+ bytecount = Lstream_read (XLSTREAM (stream), longbuf, sizeof (longbuf));
+
+ CHARACTER_TELL_ASSERT (Lstream_character_tell (XLSTREAM (stream))
+ == sizeof (ext_unix) -1,
+ "basic character tell, no-conversion-unix",
+ "basic character tell failed");
+
+ string = build_extstring (ext_unix,
+ Ffind_coding_system (intern
+ ("no-conversion-unix")));
+
+ CHARACTER_TELL_ASSERT (Lstream_character_tell (XLSTREAM (stream))
+ == string_char_length (string),
+ "repeat basic character tell, no-conversion-unix",
+ "repeat basic character tell failed with string");
+
+ count = Lstream_character_tell (XLSTREAM (stream));
+
+ Lstream_unread (XLSTREAM (stream), "r\n", 2);
+
+ /* This should give the same result as before the unread. */
+ CHARACTER_TELL_ASSERT (Lstream_character_tell (XLSTREAM (stream))
+ == count, "checking post-unread character tell",
+ "post-unread character tell failed");
+ bytecount += Lstream_read (XLSTREAM (stream), longbuf + bytecount,
+ sizeof (longbuf) - bytecount);
+
+ CHARACTER_TELL_ASSERT (Lstream_character_tell (XLSTREAM (stream))
+ == count + 2,
+ "checking post-unread+read character tell",
+ "post-unread+read character tell failed");
+
+ /* This seems to be buggy for my purposes. */
+ /* Lstream_rewind (XLSTREAM (stream)); */
+ Lstream_close (XLSTREAM (stream));
+ Lstream_delete (XLSTREAM (stream));
+
+ stream = make_fixed_buffer_input_stream (ext_unix, sizeof (ext_unix) - 1);
+ Lstream_set_buffering (XLSTREAM (stream), LSTREAM_BLOCKN_BUFFERED, 65536);
+ Lstream_unset_character_mode (XLSTREAM (stream));
+ stream = make_coding_input_stream
+ (XLSTREAM (stream), Ffind_coding_system (intern ("no-conversion-unix")),
+ CODING_DECODE, 0);
+ Lstream_set_buffering (XLSTREAM (stream), LSTREAM_BLOCKN_BUFFERED, 65536);
+ Lstream_unset_character_mode (XLSTREAM (stream));
+
+ bytecount = Lstream_read (XLSTREAM (stream), shortbuf, sizeof (shortbuf));
+
+ CHARACTER_TELL_ASSERT (Lstream_character_tell (XLSTREAM (stream))
+ /* This should be equal to sizeof (shortbuf) on
+ non-mule. */
+ == sizeof (shortbuf) - !(byte_ascii_p (0xff)),
+ "character tell with short read, no-conversion-unix",
+ "short read character tell failed");
+
+ Lstream_close (XLSTREAM (stream));
+ Lstream_delete (XLSTREAM (stream));
+
+ stream
+ = make_fixed_buffer_input_stream (ext_utf_8_unix,
+ sizeof (ext_utf_8_unix) - 1);
+ Lstream_set_buffering (XLSTREAM (stream), LSTREAM_BLOCKN_BUFFERED, 65536);
+ stream = make_coding_input_stream
+ (XLSTREAM (stream), Ffind_coding_system (intern ("utf-8-unix")),
+ CODING_DECODE, 0);
+ Lstream_set_buffering (XLSTREAM (stream), LSTREAM_BLOCKN_BUFFERED, 65536);
+
+ bytecount = Lstream_read (XLSTREAM (stream), longbuf, sizeof (longbuf));
+
+ CHARACTER_TELL_ASSERT (Lstream_character_tell (XLSTREAM (stream))
+ == ext_utf_8_unix_char_len,
+ "utf-8 character tell, utf-8-unix",
+ "utf-8 character tell failed");
+
+ string = build_extstring (ext_utf_8_unix,
+ Ffind_coding_system (intern
+ ("utf-8-unix")));
+
+ CHARACTER_TELL_ASSERT (Lstream_character_tell (XLSTREAM (stream))
+ == string_char_length (string),
+ "repeat utf-8 character tell, utf-8-unix",
+ "repeat utf-8 character tell failed with string");
+
+ count = Lstream_character_tell (XLSTREAM (stream));
+
+ Lstream_unread (XLSTREAM (stream), "r\n", 2);
+
+ /* This should give the same result as before the unread. */
+ CHARACTER_TELL_ASSERT (Lstream_character_tell (XLSTREAM (stream))
+ == count, "checking post-unread utf-8 tell",
+ "post-unread utf-8 tell failed");
+ bytecount += Lstream_read (XLSTREAM (stream), longbuf + bytecount,
+ sizeof (longbuf) - bytecount);
+
+ CHARACTER_TELL_ASSERT (Lstream_character_tell (XLSTREAM (stream))
+ == count + 2,
+ "checking post-unread+read utf-8 tell",
+ "post-unread+read utf-8 tell failed");
+
+ /* This seems to be buggy for my purposes. */
+ /* Lstream_rewind (XLSTREAM (stream)); */
+ Lstream_close (XLSTREAM (stream));
+ Lstream_delete (XLSTREAM (stream));
+
+ stream = make_fixed_buffer_input_stream (ext_utf_8_unix, sizeof (ext_utf_8_unix) - 1);
+ Lstream_set_buffering (XLSTREAM (stream), LSTREAM_BLOCKN_BUFFERED, 65536);
+ Lstream_set_character_mode (XLSTREAM (stream));
+
+ stream = make_coding_input_stream
+ (XLSTREAM (stream), Ffind_coding_system (intern ("utf-8-unix")),
+ CODING_DECODE, 0);
+ Lstream_set_buffering (XLSTREAM (stream), LSTREAM_BLOCKN_BUFFERED, 65536);
+ Lstream_set_character_mode (XLSTREAM (stream));
+
+ bytecount = Lstream_read (XLSTREAM (stream), shortbuf, sizeof (shortbuf));
+
+ CHARACTER_TELL_ASSERT
+ (bytecount == (sizeof (shortbuf) - 1),
+ "utf-8 Lstream_read, character mode, checking partial char not read",
+ "partial char appars to have been read when it shouldn't");
+
+ CHARACTER_TELL_ASSERT
+ (Lstream_character_tell (XLSTREAM (stream))
+ /* This is shorter, because it's in the middle of a character. */
+ == sizeof (shortbuf) - 1,
+ "utf-8 tell with short read, character mode, utf-8-unix",
+ "utf-8 read character tell, character mode failed");
+
+ Lstream_close (XLSTREAM (stream));
+ Lstream_delete (XLSTREAM (stream));
+
+ UNGCPRO;
+ return result;
+}
+
/* Hash Table testing */
@@ -724,6 +904,7 @@
Vtest_function_list = Qnil;
TESTS_DEFSUBR (Ftest_data_format_conversion);
+ TESTS_DEFSUBR (Ftest_character_tell);
TESTS_DEFSUBR (Ftest_hash_tables);
TESTS_DEFSUBR (Ftest_store_void_in_lisp);
/* Add other test functions here with TESTS_DEFSUBR */
diff -r 4004c3266c09888a9935242a462beb3fb28e02a3 -r 65d65b52d608ca1f17365a96fc3cf710a3af625c src/unicode.c
--- a/src/unicode.c
+++ b/src/unicode.c
@@ -1707,6 +1707,7 @@
unsigned char counter;
unsigned char indicated_length;
int seen_char;
+ Charcount characters_seen;
/* encode */
Lisp_Object current_charset;
int current_char_boundary;
@@ -1988,6 +1989,17 @@
write_error_characters_as_such);
}
+static Charcount
+unicode_character_tell (struct coding_stream *str)
+{
+ if (CODING_STREAM_TYPE_DATA (str, unicode)->counter == 0)
+ {
+ return CODING_STREAM_TYPE_DATA (str, unicode)->characters_seen;
+ }
+
+ return -1;
+}
+
static Bytecount
unicode_convert (struct coding_stream *str, const UExtbyte *src,
unsigned_char_dynarr *dst, Bytecount n)
@@ -2006,6 +2018,7 @@
unsigned char counter = data->counter;
unsigned char indicated_length
= data->indicated_length;
+ Charcount characters_seen = data->characters_seen;
while (n--)
{
@@ -2020,12 +2033,15 @@
{
/* ASCII. */
decode_unicode_char (c, dst, data, ignore_bom);
+ characters_seen++;
}
else if (0 == (c & 0x40))
{
/* Highest bit set, second highest not--there's
something wrong. */
DECODE_ERROR_OCTET (c, dst, data, ignore_bom);
+ /* This is a character in the buffer. */
+ characters_seen++;
}
else if (0 == (c & 0x20))
{
@@ -2050,7 +2066,7 @@
/* We don't supports lengths longer than 4 in
external-format data. */
DECODE_ERROR_OCTET (c, dst, data, ignore_bom);
-
+ characters_seen++;
}
}
else
@@ -2061,15 +2077,20 @@
indicate_invalid_utf_8(indicated_length,
counter,
ch, dst, data, ignore_bom);
+ /* These are characters our receiver will see, not
+ actual characters we've seen in the input. */
+ characters_seen += (indicated_length - counter);
if (c & 0x80)
{
DECODE_ERROR_OCTET (c, dst, data, ignore_bom);
+ characters_seen++;
}
else
{
/* The character just read is ASCII. Treat it as
such. */
decode_unicode_char (c, dst, data, ignore_bom);
+ characters_seen++;
}
ch = 0;
counter = 0;
@@ -2092,10 +2113,12 @@
counter,
ch, dst, data,
ignore_bom);
+ characters_seen += (indicated_length - counter);
}
else
{
decode_unicode_char (ch, dst, data, ignore_bom);
+ characters_seen++;
}
ch = 0;
}
@@ -2242,6 +2265,7 @@
indicate_invalid_utf_8(indicated_length,
counter, ch, dst, data,
ignore_bom);
+ characters_seen += (indicated_length - counter);
break;
case UNICODE_UTF_16:
@@ -2295,6 +2319,7 @@
data->counter = counter;
data->indicated_length = indicated_length;
+ data->characters_seen = characters_seen;
}
else
{
@@ -3177,6 +3202,8 @@
CODING_SYSTEM_HAS_METHOD (unicode, putprop);
CODING_SYSTEM_HAS_METHOD (unicode, getprop);
+ CODING_SYSTEM_HAS_METHOD (unicode, character_tell);
+
INITIALIZE_DETECTOR (utf_8);
DETECTOR_HAS_METHOD (utf_8, detect);
INITIALIZE_DETECTOR_CATEGORY (utf_8, utf_8);
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
Only call `activate-timer' on non-active-timers.
10 years, 11 months
Michael Sperber
org-mode calls `timer-activate-when-idle' on live timers, which makes
our version barf.
2013-12-03 Michael Sperber <mike(a)xemacs.org>
* timer.el (timer-activate-when-idle): Only call `activate-timer'
on non-active-timers.
I intend to push on Wednesday if nobody objects.
--
Regards,
Mike
diff --git a/timer.el b/timer.el
--- a/timer.el
+++ b/timer.el
@@ -113,8 +113,10 @@
(defun timer-activate-when-idle (timer &optional dont-wait)
"Arrange to activate TIMER whenever Emacs is next idle.
DONT-WAIT is for Emacs compatibility and is currently ignored."
- (set-itimer-is-idle timer t)
- (activate-itimer timer))
+ (when (and (not (itimer-live-p timer))
+ (not (get-itimer (itimer-name timer))))
+ (set-itimer-is-idle timer t)
+ (activate-itimer timer)))
;; can't do this, different kind of timer
;;(defalias 'disable-timeout 'cancel-timer)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/fsf-compat: 2 new changesets
10 years, 11 months
Bitbucket
2 new commits in fsf-compat:
https://bitbucket.org/xemacs/fsf-compat/commits/9ca2a22d7c94/
Changeset: 9ca2a22d7c94
User: sperber
Date: 2013-02-20 11:30:13
Summary: Add `copy-overlay', `remove-overlays' functions from GNU Emacs.
2013-02-20 Michael Sperber <mike(a)xemacs.org>
* overlay.el (copy-overlay, remove-overlays): Add functions from
GNU Emacs.
Affected #: 2 files
diff -r 65d33b7ebc516f9bba2e936a6bdc005a2d806e7e -r 9ca2a22d7c9445bb86ea46d702faf681d22bc78b ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-02-20 Michael Sperber <mike(a)xemacs.org>
+
+ * overlay.el (copy-overlay, remove-overlays): Add functions from
+ GNU Emacs.
+
2009-08-14 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 1.19 released.
diff -r 65d33b7ebc516f9bba2e936a6bdc005a2d806e7e -r 9ca2a22d7c9445bb86ea46d702faf681d22bc78b overlay.el
--- a/overlay.el
+++ b/overlay.el
@@ -291,6 +291,49 @@
prop)))
(set-extent-property overlay prop value))
+(defun copy-overlay (o)
+ "Return a copy of overlay O."
+ (let ((o1 (if (overlay-buffer o)
+ (make-overlay (overlay-start o) (overlay-end o)
+ ;; FIXME: there's no easy way to find the
+ ;; insertion-type of the two markers.
+ (overlay-buffer o))
+ (let ((o1 (make-overlay (point-min) (point-min))))
+ (delete-overlay o1)
+ o1)))
+ (props (overlay-properties o)))
+ (while props
+ (overlay-put o1 (pop props) (pop props)))
+ o1))
+
+(defun remove-overlays (&optional beg end name val)
+ "Clear BEG and END of overlays whose property NAME has value VAL.
+Overlays might be moved and/or split.
+BEG and END default respectively to the beginning and end of buffer."
+ ;; This speeds up the loops over overlays.
+ (unless beg (setq beg (point-min)))
+ (unless end (setq end (point-max)))
+ (overlay-recenter end)
+ (if (< end beg)
+ (setq beg (prog1 end (setq end beg))))
+ (save-excursion
+ (dolist (o (overlays-in beg end))
+ (when (eq (overlay-get o name) val)
+ ;; Either push this overlay outside beg...end
+ ;; or split it to exclude beg...end
+ ;; or delete it entirely (if it is contained in beg...end).
+ (if (< (overlay-start o) beg)
+ (if (> (overlay-end o) end)
+ (progn
+ (move-overlay (copy-overlay o)
+ (overlay-start o) beg)
+ (move-overlay o end (overlay-end o)))
+ (move-overlay o (overlay-start o) beg))
+ (if (> (overlay-end o) end)
+ (move-overlay o end (overlay-end o))
+ (delete-overlay o)))))))
+
+
(provide 'overlay)
;;; overlay.el ends here
https://bitbucket.org/xemacs/fsf-compat/commits/62743319f0c0/
Changeset: 62743319f0c0
User: sperber
Date: 2014-01-05 11:57:49
Summary: Only call `activate-timer' on non-active-timers.
2013-12-03 Michael Sperber <mike(a)xemacs.org>
* timer.el (timer-activate-when-idle): Only call `activate-timer'
on non-active-timers.
Affected #: 2 files
diff -r 9ca2a22d7c9445bb86ea46d702faf681d22bc78b -r 62743319f0c0cdf939832d8d6101c5273b1e8c90 ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-12-03 Michael Sperber <mike(a)xemacs.org>
+
+ * timer.el (timer-activate-when-idle): Only call `activate-timer'
+ on non-active-timers.
+
2013-02-20 Michael Sperber <mike(a)xemacs.org>
* overlay.el (copy-overlay, remove-overlays): Add functions from
diff -r 9ca2a22d7c9445bb86ea46d702faf681d22bc78b -r 62743319f0c0cdf939832d8d6101c5273b1e8c90 timer.el
--- a/timer.el
+++ b/timer.el
@@ -113,8 +113,10 @@
(defun timer-activate-when-idle (timer &optional dont-wait)
"Arrange to activate TIMER whenever Emacs is next idle.
DONT-WAIT is for Emacs compatibility and is currently ignored."
- (set-itimer-is-idle timer t)
- (activate-itimer timer))
+ (when (and (not (itimer-live-p timer))
+ (not (get-itimer (itimer-name timer))))
+ (set-itimer-is-idle timer t)
+ (activate-itimer timer)))
;; can't do this, different kind of timer
;;(defalias 'disable-timeout 'cancel-timer)
Repository URL: https://bitbucket.org/xemacs/fsf-compat/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/xemacs-packages: 3 new changesets
10 years, 11 months
Bitbucket
3 new commits in xemacs-packages:
https://bitbucket.org/xemacs/xemacs-packages/commits/7723a8b5a2a3/
Changeset: 7723a8b5a2a3
User: Norbert Koch
Date: 2014-01-07 09:45:21
Summary: update edit-utils
Affected #: 1 file
diff -r b13d71d77a816f8dde41af11bb8aee2b23bd81f9 -r 7723a8b5a2a36a6717673e6abaacdc3d7cc4976d .hgsubstate
--- a/.hgsubstate
+++ b/.hgsubstate
@@ -33,7 +33,7 @@
5200706cfcb56eeefed3d21d8f63f32dd491ca85 xemacs-packages/ede
7f290f0c522c3031e9101047df3949d87789de35 xemacs-packages/edebug
68569d2f5904bfc32cc5f9beececfb6e56b6f152 xemacs-packages/ediff
-987a8f165ca55d13410e6a0546928278d7bbf66c xemacs-packages/edit-utils
+69fa5e2612ce0c0525092ab1c8dde9e3f6070846 xemacs-packages/edit-utils
94f1da97c08e96f1bf1fd5a255934956e6a37a05 xemacs-packages/edt
e52f7777d685b7d272d63cf0098fe52217f8b725 xemacs-packages/efs
2f441d6442dac751f54b36f78fbfdab0848f6bbc xemacs-packages/eicq
https://bitbucket.org/xemacs/xemacs-packages/commits/5be8e63c129b/
Changeset: 5be8e63c129b
User: Norbert Koch
Date: 2014-01-07 09:45:52
Summary: XEmacs Package Release
Affected #: 1 file
diff -r 7723a8b5a2a36a6717673e6abaacdc3d7cc4976d -r 5be8e63c129b521fcf6ef88252ea7dddaf46116c ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-01-07 Norbert Koch <viteno(a)xemacs.org>
+
+ * Packages released: edit-utils.
+
2013-12-19 Norbert Koch <viteno(a)xemacs.org>
* Packages released: xemacs-base.
https://bitbucket.org/xemacs/xemacs-packages/commits/beeb6d6c0d31/
Changeset: beeb6d6c0d31
User: Norbert Koch
Date: 2014-01-07 09:55:37
Summary: pre-release edit-utils
Affected #: 1 file
diff -r 5be8e63c129b521fcf6ef88252ea7dddaf46116c -r beeb6d6c0d319659f114447d737110aceebe3908 .hgsubstate
--- a/.hgsubstate
+++ b/.hgsubstate
@@ -33,7 +33,7 @@
5200706cfcb56eeefed3d21d8f63f32dd491ca85 xemacs-packages/ede
7f290f0c522c3031e9101047df3949d87789de35 xemacs-packages/edebug
68569d2f5904bfc32cc5f9beececfb6e56b6f152 xemacs-packages/ediff
-69fa5e2612ce0c0525092ab1c8dde9e3f6070846 xemacs-packages/edit-utils
+d31456930643cd907725bb4358892ba4a5a88a8a xemacs-packages/edit-utils
94f1da97c08e96f1bf1fd5a255934956e6a37a05 xemacs-packages/edt
e52f7777d685b7d272d63cf0098fe52217f8b725 xemacs-packages/efs
2f441d6442dac751f54b36f78fbfdab0848f6bbc xemacs-packages/eicq
Repository URL: https://bitbucket.org/xemacs/xemacs-packages/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/edit-utils: 2 new changesets
10 years, 11 months
Bitbucket
2 new commits in edit-utils:
https://bitbucket.org/xemacs/edit-utils/commits/d8c3d283f61c/
Changeset: d8c3d283f61c
User: Norbert Koch
Date: 2014-01-07 09:45:52
Summary: XEmacs Package Release 2.52
Affected #: 2 files
diff -r 69fa5e2612ce0c0525092ab1c8dde9e3f6070846 -r d8c3d283f61cd0160ce5c2e0200f7882f4c0e9e7 ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2014-01-07 Norbert Koch <viteno(a)xemacs.org>
+
+ * Makefile (VERSION): XEmacs package 2.52 released.
+
2013-1-1 Steve Mitchell <smitchel(a)bnin.net>
Byrel Mitchell <byrel.mitchell(a)gmail.com>
diff -r 69fa5e2612ce0c0525092ab1c8dde9e3f6070846 -r d8c3d283f61cd0160ce5c2e0200f7882f4c0e9e7 Makefile
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@
# This XEmacs package contains independent single file lisp packages
-VERSION = 2.51
+VERSION = 2.52
AUTHOR_VERSION =
MAINTAINER = XEmacs Development Team <xemacs-beta(a)xemacs.org>
PACKAGE = edit-utils
https://bitbucket.org/xemacs/edit-utils/commits/d31456930643/
Changeset: d31456930643
User: Norbert Koch
Date: 2014-01-07 09:45:52
Summary: Added tag edit-utils-2_52 for changeset d8c3d283f61c
Affected #: 1 file
diff -r d8c3d283f61cd0160ce5c2e0200f7882f4c0e9e7 -r d31456930643cd907725bb4358892ba4a5a88a8a .hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -157,3 +157,4 @@
0465ba201528499f75e1f5e880c1f716eb024384 edit-utils-2_49
16e2ea4308300af77a25d51d9b77bd65c9099ffb edit-utils-2_50
d2323673ec99bc79928dd4ad15d45f60e0e288c7 edit-utils-2_51
+d8c3d283f61cd0160ce5c2e0200f7882f4c0e9e7 edit-utils-2_52
Repository URL: https://bitbucket.org/xemacs/edit-utils/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/edit-utils: Steve Mitchell: Removed icon-themes.el from edit-utils; refactoring into seperate package
10 years, 11 months
Bitbucket
1 new commit in edit-utils:
https://bitbucket.org/xemacs/edit-utils/commits/69fa5e2612ce/
Changeset: 69fa5e2612ce
User: Steve Mitchell
Date: 2014-01-03 21:10:20
Summary: Removed icon-themes.el from edit-utils; refactoring into seperate package
Affected #: 2 files
diff -r 0fb7a0efa2fe7c9b30bbb59baefcaa0dee2e5c37 -r 69fa5e2612ce0c0525092ab1c8dde9e3f6070846 Makefile
--- a/Makefile
+++ b/Makefile
@@ -40,11 +40,10 @@
reportmail.elc resume.elc rsz-minibuf.elc saveconf.elc savehist.elc \
saveplace.elc scroll-in-place.elc shell-font.elc tempo.elc \
toolbar-utils.elc tree-menu.elc uniquify.elc where-was-i-db.elc \
- winring.elc vertical-mode.elc power-macros.elc icon-themes.elc \
- search-buffers.elc setnu.elc align.elc autorevert.elc allout.elc \
- narrow-stack.elc highline.elc crm.elc wide-edit.elc buffer-colors.elc \
- list-register.elc which-func.elc find-lisp.elc register-menu.elc \
- register-toolbar.elc
+ winring.elc vertical-mode.elc power-macros.elc search-buffers.elc \
+ setnu.elc align.elc autorevert.elc allout.elc narrow-stack.elc \
+ highline.elc crm.elc wide-edit.elc buffer-colors.elc list-register.elc \
+ which-func.elc find-lisp.elc register-menu.elc register-toolbar.elc \
diff -r 0fb7a0efa2fe7c9b30bbb59baefcaa0dee2e5c37 -r 69fa5e2612ce0c0525092ab1c8dde9e3f6070846 icon-themes.el
--- a/icon-themes.el
+++ /dev/null
@@ -1,447 +0,0 @@
-;;-------- icon-themes.el
-;; This implements themes for icons in the toolbar
-;; and adds a menu item "icon-themes"
-;; each theme is a list of icon files and sizes
-;; all stored in the file "icon-themes-list.el"
-;; see that file for a template to add themes.
-;;
-;; Authors:
-;; Byrel Mitchell byrel.mitchell(a)gmail.com
-;; Steve Mitchell smitchel(a)bnin.net
-;;
-;; Copyright (C) 2011 Byrel Mitchell <byrel.mitchell(a)gmail.com>
-;; Copyright (C) 2011 Steven Mitchell <smitchel(a)bnin.net>
-;;
-;;
-;; This file is part of XEmacs.
-
-;; XEmacs is free software; you can redistribute it and/or modify it
-;; under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; XEmacs is distributed in the hope that it will be useful, but
-;; WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-;; General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with XEmacs; see the file COPYING. If not, write to the
-;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
-
-;;; Synched up with: Not in FSF.
-;;
-
-
-(require 'menubar) ;contains add-sub-menu
-
-;---- declare variables for icon-themes ------------------------------
-
-(defvar theme-theme-list nil
- "A list of all currently loaded themes.")
-;;---- function definitions -----------------------------------------
-
-;--- General Procedure to update the toolbar:
-;--- first save a copy of the default toolbar.
-;--- then remove the toolbar,
-;--- then put the saved copy back in, which updates the toolbar
-;--- doesn't seem to be any other way...
-(defun theme-update-toolbar ()
- (let ((toolbar (copy-specifier default-toolbar)))
- (remove-specifier default-toolbar)
- (sit-for 0)
- (set-specifier default-toolbar toolbar)))
-
-
-
-;--- adds theme-icon-search-path to the data-directory-list path
-(defun theme-expand-path (file)
- (setq file (substitute-in-file-name file))
- (if (file-name-absolute-p file)
- (if (file-exists-p file)
- file
- nil)
- (locate-file file (append theme-icon-search-path data-directory-list)))) ; when this is a package, would this path already be set?
-
-
-
-;--- theme check files confirms the list of icons in icon-themes-list-el
-;--- to exist on disk so we don't get any missing icon file problems
-;;;###autoload
-(defun theme-check-files ()
- "Check to make sure all files can be found in all loaded themes."
- (interactive)
- (catch 'check-abort
- (loop for theme-symbol in theme-theme-list
- for theme = (symbol-value theme-symbol)
- for theme-name = (car theme) do
- (loop for (x y . buttons) in (cdr theme) do
- (loop for (target . icons) in buttons do
- (unless (assq target themeable-icons)
- (unless (y-or-n-p (concat (prin1-to-string target) " not in themable icons, in theme " theme-name ". Continue? ")) ;or should it be continue checking?
- (throw 'check-abort nil)))
- (if (eq (type-of icons) 'string)
- (setq icons (list icons)))
- (loop for image in icons do
- (when image
- (unless (theme-expand-path image)
- (unless (y-or-n-p (concat (prin1-to-string image) " (from theme " theme-name ") not found in path. Continue? "))
- (throw 'check-abort nil))))))))
- t))
-
-
-; takes the icons of a given theme/size and makes glyphs of them
-(defun theme-load-theme ( theme-list )
- "Loads theme given by `THEME-LIST' into appropriate glyphs."
- (loop for (target . icons) in theme-list
- for target-var = (cdr (assq target themeable-icons))
- for target-icon = (when (boundp target-var)
- (symbol-value target-var)) do
- (when target-var ; Only update icon variable if target is listed in themable icons
- (unless (boundp target-var) ;if not defined, define target variable
- (set target-var nil))
- (if (eq (type-of icons) 'string)
- (setq icons (list icons)))
- (when (> (length icons) (length target-icon)) ;length of our list vs target list, includes "pressed",etc. up to 6 items in list
- (setf (nthcdr (length target-icon) target-icon) (nthcdr (length target-icon) icons))) ;make sure target list is at least as long as the source list
- (loop for a from 0 to (1- (min (length target-icon) (length icons)))
- for source = (nth a icons) do
- (if source
- (if (theme-expand-path source) ;If we can resolve it to a file, use that. If it doesn't look like a filename, use the string as a glyph
- (setf (nth a target-icon) (make-glyph (theme-expand-path source)))
- (unless (string-match "\\.\\(jpe?g\\|xpm\\|png\\)$" source)
- (setf (nth a target-icon) (make-glyph source))))
- (setf (nth a target-icon) nil)))))
- (theme-update-toolbar)) ; at the end, update the toolbar
-
-
-;;;###autoload
-(defun theme-read-theme (theme-list &rest expressions)
- "Used for loading a theme.
-A theme definition file should contain this function with the theme as
-an argument. If there are any further arguments after a theme definition,
-they are evaluated and run as lisp commands."
- (let ((theme-name (downcase (car theme-list))) ;Tango for instance has uppercase "T" in name
- theme-symbol)
- (while (string-match "[ \t\n]" theme-name)
- (setq theme-name (replace-match "-" nil nil theme-name)))
- (setq theme-symbol (intern
- (concat "theme-"
- theme-name
- "-theme-def")))
- (set theme-symbol theme-list)
- (unless (member theme-symbol theme-theme-list)
- (push theme-symbol theme-theme-list)))
- (eval `(progn ,@expressions))) ;the part that evals any additional commands
- ;it is used in the text icons to set the
- ; toolbar face to bold.
-
-
-;--- when a new theme is chosen, this function
-;--- sets the toolbar height and sets the current theme
-; variables and loads the theme.
-;;;###autoload
-(defun theme-set-theme (symbol theme-symbol &optional x y)
- "Set the customizable variable theme-current-theme.
-Also set theme-current-size if `X' and `Y' are specified.
-`SYMBOL' is ignored."
- (if (symbol-value theme-symbol)
- (progn
- (unless (and x y) ;unless an x and y are specified
- (setq x (caadr (symbol-value theme-symbol)) ; get x from 1st size in theme
- y (cadadr (symbol-value theme-symbol)))) ;get y from first size in theme
- (let ((oursize
- (loop for (newx newy . icon-list) in (cdr (symbol-value theme-symbol))
- until (and (eq x newx) ;once we find a size that matches
- (eq y newy))
- finally return icon-list))) ;return the size we found
- (theme-load-theme oursize) ;loads the theme with the size
- (set-default 'theme-current-theme theme-symbol) ; set name of current theme
- (set-specifier default-toolbar-height (+ 4 y)) ; set toolbar height to match icon height
- (set-default 'theme-current-size (cons x y)))) ; set current size of theme
- (when theme-symbol
- (setq theme-current-theme theme-symbol)) ;update current theme name
- (when x
- (setf (car theme-current-size) x)) ;update width of icons
- (when y
- (setf (cdr theme-current-size) y)))) ;update height of icons
-
-
-
-;--- theme-set-size sets the size of the current theme
-;--- and checks that it is a legitimate size
-;;;###autoload
-(defun theme-set-size (symbol size)
- "Setting function for `theme-current-size' customizable variable."
- (if (zerop (loop for (newx newy . icon-list) in (cdr (symbol-value theme-current-theme))
- count (and (eq (car size) newx)
- (eq (cdr size) newy))))
- (message "No such size found")
- (setq theme-current-size size)))
-
-
-;--- theme-load-menu adds the new menu-item "icon-themes"
-;--- the "current: <theme name>" is added to the title line
-; of the submenu that lists available themes (by reading
-; the file "theme-theme-list.el").
-;--- the section below starting with "collect (vector..."
-; is to populate a sub-menu for each theme,
-; showing sizes available in that theme
-;
-;;;###autoload
-(defun theme-load-menu (menu-path &optional before)
- "Adds an icon-themes menu to the toolbar.
-`menu-path' is a list representing the menu to add the icon theme menu
-to. `before' is a string indicating what element to add it before. For
-more details, see `current-menubar'."
- (add-submenu menu-path
- '( "Icon Themes" :filter
- (lambda (list)
- (cons [ "Current: " :suffix (or (car (symbol-value theme-current-theme) ) "none")] ;shows name of cur. theme (or none)
- ;in submenu title
- (loop for theme-symbol in theme-theme-list
- for theme = (symbol-value theme-symbol)
- collect (cons (car theme) ;
- (loop for (x yo) in (cdr theme)
- for y = (eval yo)
- collect (vector (format "%i x %i" x y) ; assemble a string of x y sizes
- `(theme-set-theme nil (quote ,theme-symbol) ,x ,y)
- :style 'radio :selected `(and (eq (quote ,theme-symbol) theme-current-theme)
- (eq ,x (car theme-current-size))
- (eq ,y (cdr theme-current-size))))))))))
- before))
-
-
-(theme-read-theme
-'("Text-Icons"
- (32 (+ 10 (string-to-number (custom-face-font-size 'toolbar )))
- ; adjust 2nd number above for button height w/your font
- ;height needs to be 4-6 pixels higher than font height
- ;or text won't show in the toolbar buttons,
- ;but buttons will still work
- (open " Open " nil nil nil nil nil) ; to compact the length of toolbar
- (dired " Dired " nil nil nil nil nil) ; remove the leading/trailing spaces
- (save " Save " nil nil nil nil nil) ; and abbrev. the strings as desired.
- (print " Print " nil nil nil nil nil)
- (cut " Cut " nil nil nil nil nil)
- (copy " Copy " nil nil nil nil nil)
- (paste " Paste " nil nil nil nil nil)
- (prev-window " Prev-win " nil nil nil nil nil)
- (next-window " Next-win " nil nil nil nil nil)
- (replace " Find-Replace " nil nil nil nil nil)
- (spell " Spell " nil nil nil nil nil)
- (undo " Undo " nil nil nil nil nil)
- (compile " Compile " nil nil nil nil nil)
- (debug " Debug " nil nil nil nil nil)
- (email " Email " nil nil nil nil nil)
- (info " Info " nil nil nil nil nil)
- (news-reader " News-Reader " nil nil nil nil nil)))
- ;after the list of icons, any lisp commands here will be eval'd
- (custom-set-face-bold 'toolbar t )) ;set toolbar face, bold on
-
-
-(theme-read-theme
- '("Default-Icons"
- (28 (cond ((specifier-instance toolbar-buttons-captioned-p) 38) (30))
- (open "toolbar/file-up.xpm"
- nil
- "toolbar/file-xx.xpm"
- "toolbar/file-cap-up.xpm"
- nil
- "toolbar/file-cap-xx.xpm")
- (dired "toolbar/folder-up.xpm"
- nil
- "toolbar/folder-xx.xpm"
- "toolbar/folder-cap-up.xpm"
- nil
- "toolbar/folder-cap-xx.xpm")
- (save "toolbar/disk-up.xpm"
- nil
- "toolbar/disk-xx.xpm"
- "toolbar/disk-cap-up.xpm"
- nil
- "toolbar/disk-cap-xx.xpm")
- (print "toolbar/printer-up.xpm"
- nil
- "toolbar/printer-xx.xpm"
- "toolbar/printer-cap-up.xpm"
- nil
- "toolbar/printer-cap-xx.xpm")
- (cut "toolbar/cut-up.xpm"
- nil
- "toolbar/cut-xx.xpm"
- "toolbar/cut-cap-up.xpm"
- nil
- "toolbar/cut-cap-xx.xpm")
- (copy "toolbar/copy-up.xpm"
- nil
- "toolbar/copy-xx.xpm"
- "toolbar/copy-cap-up.xpm"
- nil
- "toolbar/copy-cap-xx.xpm")
- (paste "toolbar/paste-up.xpm"
- nil
- "toolbar/paste-xx.xpm"
- "toolbar/paste-cap-up.xpm"
- nil
- "toolbar/paste-cap-xx.xpm")
- (prev-window "toolbar/last-win-up.xpm"
- nil
- "toolbar/last-win-xx.xpm"
- "toolbar/last-win-cap-up.xpm"
- nil
- "toolbar/last-win-cap-xx.xpm")
- (next-window "toolbar/next-win-up.xpm"
- nil
- "toolbar/next-win-xx.xpm"
- "toolbar/next-win-cap-up.xpm"
- nil
- "toolbar/next-win-cap-xx.xpm")
- (replace "toolbar/replace-up.xpm"
- nil
- "toolbar/replace-xx.xpm"
- "toolbar/replace-cap-up.xpm"
- nil
- "toolbar/replace-cap-xx.xpm")
- (spell "toolbar/spell-up.xpm"
- nil
- "toolbar/spell-xx.xpm"
- "toolbar/spell-cap-up.xpm"
- nil
- "toolbar/spell-cap-xx.xpm")
- (undo "toolbar/undo-up.xpm"
- nil
- "toolbar/undo-xx.xpm"
- "toolbar/undo-cap-up.xpm"
- nil
- "toolbar/undo-cap-xx.xpm")
- (info "toolbar/info-def-up.xpm"
- nil
- "toolbar/info-xx.xpm"
- "toolbar/info-cap-up.xpm"
- nil
- "toolbar/info-cap-xx.xpm")
- (compile "toolbar/compile-up.xpm"
- nil
- "toolbar/compile-xx.xpm"
- "toolbar/compile-cap-up.xpm"
- nil
- "toolbar/compile-cap-xx.xpm")
- (debug "toolbar/debug-up.xpm"
- nil
- "toolbar/debug-xx.xpm"
- "toolbar/debug-cap-up.xpm"
- nil
- "toolbar/debug-cap-xx.xpm")
- (email "toolbar/mail-up.xpm"
- nil
- "toolbar/mail-xx.xpm"
- "toolbar/mail-cap-up.xpm"
- nil
- "toolbar/mail-cap-xx.xpm")
- (news-reader "toolbar/news-up.xpm"
- nil
- "toolbar/news-xx.xpm"
- "toolbar/news-cap-up.xpm"
- nil
- "toolbar/news-cap-xx.xpm"))))
-
-;;;;--- initialize icon-themes ------------------------------------------
-
-(theme-load-menu '("Options") "Display")
-
-
-;;;;---- customize group and variables for icon-themes ------------------------------
-
-(defgroup icon-theme nil
- "Icon theme customize group")
-
-(defcustom theme-current-size '(28 28)
- "The current icon theme size.
-Should be a list of two numbers, (x y)."
-:type '(cons integer integer)
-:version "21.5"
-:set (lambda (unused size)
- (theme-set-size nil size))
-:group 'icon-theme
-:initialize 'custom-initialize-default)
-
-
-(defcustom theme-current-theme 'theme-default-icons-theme-def
- "Current icon theme."
-:initialize 'custom-initialize-default
-:type 'variable
-:version "21.5"
-:set (lambda (unused theme)
- (theme-set-theme nil theme))
-:group 'icon-theme)
-
-
-(defcustom theme-icon-search-path '("/usr/local/share/xemacs/xemacs-packages/etc/icon-themes")
- "A list of directories to search for icons with relative path names.
-This is in addition to the contents of 'data-directory-list'."
-:type '(repeat :tag "Path" (string :tag "Directory"))
-:version "21.5")
-
-(defcustom themeable-icons '((open . toolbar-file-icon)
- (dired . toolbar-folder-icon)
- (save . toolbar-disk-icon)
- (print . toolbar-printer-icon)
- (cut . toolbar-cut-icon)
- (copy . toolbar-copy-icon)
- (paste . toolbar-paste-icon)
- (prev-window . toolbar-last-win-icon)
- (next-window . toolbar-next-win-icon)
- (replace . toolbar-replace-icon)
- (spell . toolbar-spell-icon)
- (undo . toolbar-undo-icon)
- (compile . toolbar-compile-icon)
- (debug . toolbar-debug-icon)
- (email . toolbar-mail-icon)
- (calc . toolbar-calc-icon)
- (news-reader . toolbar-news-icon)
- (info . toolbar-info-icon)
- (info-exit . info::toolbar-exit-icon)
- (info-next . info::toolbar-next-icon)
- (info-prev . info::toolbar-prev-icon)
- (info-up . info::toolbar-up-icon)
- (xpm-show-chars . xpm-show-chars-icon)
- (xpm-hide-chars . xpm-hide-chars-icon)
- (xpm-add-color . xpm-color-icon)
- (xpm-crop . xpm-crop-icon)
- (xpm-pad . xpm-enlarge-icon)
- (xpm-help . xpm-help-icon)
- (xpm-mirror-h . xpm-m-horiz-icon)
- (xpm-mirror-v . xpm-m-vert-icon)
- (xpm-rotate-ccw . xpm-r-ccw-icon)
- (xpm-rotate-cw . xpm-r-cw-icon)
- (xpm-save . xpm-save-icon)
- (xpm-shift-d . xpm-sh-d-icon)
- (xpm-shift-l . xpm-sh-l-icon)
- (xpm-shift-r . xpm-sh-r-icon)
- (xpm-shift-u . xpm-sh-u-icon)
- (xpm-undo . xpm-undo-icon)
- (w3-back . w3-toolbar-back-icon)
- (w3-find . w3-toolbar-find-icon)
- (w3-forward . w3-toolbar-forw-icon)
- (w3-help . w3-toolbar-help-icon)
- (w3-home . w3-toolbar-home-icon)
- (w3-hotlink . w3-toolbar-hotl-icon)
- (w3-image . w3-toolbar-imag-icon)
- (w3-open . w3-toolbar-open-icon)
- (w3-print . w3-toolbar-print-icon)
- (w3-reload . w3-toolbar-reld-icon)
- (w3-stop . w3-toolbar-stop-icon))
- "Association list of icon names to variables they are stored in."
-:type '(repeat
- (cons
- (symbol :tag "Name")
- (variable :tag "Variable")))
-:tag "Themable Icons"
-:version "21.5")
-
-
-(provide 'icon-themes)
-
-;; icon-themes.el ends here
Repository URL: https://bitbucket.org/xemacs/edit-utils/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches