[COMMIT] Eliminate a non-Mule build failure from my last Unicode change
17 years, 1 month
Aidan Kehoe
Ar an ceathrú lá déag de mí na Samhain, scríobh Vin Shelton:
> Aidan,
>
> With current 21.5 CVS, I'm getting the following errors:
>
> icc -c -Os -ip -Demacs -I. -I/opt/src/xemacs-21.5-2007-11-14/src
> -DHAVE_CONFIG_H -I/opt/include
> /opt/src/xemacs-21.5-2007-11-14/src/unicode.c
> /opt/src/xemacs-21.5-2007-11-14/src/unicode.c(2865): error: identifier
> "Vnumber_of_jit_charsets" is undefined
> staticpro (&Vnumber_of_jit_charsets);
> ^
>
> /opt/src/xemacs-21.5-2007-11-14/src/unicode.c(2867): error: identifier
> "Vlast_jit_charset_final" is undefined
> staticpro (&Vlast_jit_charset_final);
> ^
>
> /opt/src/xemacs-21.5-2007-11-14/src/unicode.c(2869): error: identifier
> "Vcharset_descr" is undefined
> staticpro (&Vcharset_descr);
> ^
>
> compilation aborted for /opt/src/xemacs-21.5-2007-11-14/src/unicode.c (code 2)
> make[1]: *** [unicode.o] Error 2
> make[1]: Leaving directory `/opt/build/xemacs-21.5-2007-11-14/src'
> make: *** [src] Error 2
>
> Is this related to your change?
Yes--the attached change fixes the non-Mule build for me. (The absence of
Mule was the difference between what I tested locally and what your
Installation file said.) Thank you for the report!
APPROVE COMMIT
NOTE: This patch has been committed.
src/ChangeLog addition:
2007-11-15 Aidan Kehoe <kehoea(a)parhasard.net>
* unicode.c (coding_system_type_create_unicode):
* unicode.c (vars_of_unicode):
Move the initialisation of Vnumber_of_jit_charsets,
Vlast_jit_charset_final, Vcharset_descr to an #ifdef MULE block in
vars_of_unicode. Fixes a build failure reported by Vin
Shelton--thank you Vin!
XEmacs Trunk source patch:
Diff command: cvs -q diff -u
Files affected: src/unicode.c
===================================================================
RCS
Index: src/unicode.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/unicode.c,v
retrieving revision 1.39
diff -u -r1.39 unicode.c
--- src/unicode.c 2007/11/14 19:41:09 1.39
+++ src/unicode.c 2007/11/15 10:02:34
@@ -2862,14 +2862,6 @@
void
coding_system_type_create_unicode (void)
{
- staticpro (&Vnumber_of_jit_charsets);
- Vnumber_of_jit_charsets = make_int (0);
- staticpro (&Vlast_jit_charset_final);
- Vlast_jit_charset_final = make_char (0x30);
- staticpro (&Vcharset_descr);
- Vcharset_descr
- = build_string ("Mule charset for otherwise unknown Unicode code points.");
-
INITIALIZE_CODING_SYSTEM_TYPE_WITH_DATA (unicode, "unicode-coding-system-p");
CODING_SYSTEM_HAS_METHOD (unicode, print);
CODING_SYSTEM_HAS_METHOD (unicode, convert);
@@ -2907,6 +2899,14 @@
Fprovide (intern ("unicode"));
#ifdef MULE
+ staticpro (&Vnumber_of_jit_charsets);
+ Vnumber_of_jit_charsets = make_int (0);
+ staticpro (&Vlast_jit_charset_final);
+ Vlast_jit_charset_final = make_char (0x30);
+ staticpro (&Vcharset_descr);
+ Vcharset_descr
+ = build_string ("Mule charset for otherwise unknown Unicode code points.");
+
staticpro (&Vlanguage_unicode_precedence_list);
Vlanguage_unicode_precedence_list = Qnil;
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpo de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[COMMIT] Correct the dumped information for the Unicode JIT infrastructure
17 years, 1 month
Aidan Kehoe
APPROVE COMMIT
The chief issue that this fixes is that the first you go beyond the first Mule
JIT charset in allocating Unicode code points, you get an error. The next
time it succeeds. This change makes it work the first time.
NOTE: This patch has been committed.
src/ChangeLog addition:
2007-11-14 Aidan Kehoe <kehoea(a)parhasard.net>
* lread.c (read_unicode_escape):
Correct the range check for Unicode characters specified with
source-level escapes.
* unicode.c:
* unicode.c (unicode_to_ichar):
* unicode.c (coding_system_type_create_unicode):
Correct the dump behaviour for just-in-time Unicode code
points. Update the docstring for #'unicode-to-char to indicate
that code points will run out above around 400,000 in a session.
lisp/ChangeLog addition:
2007-11-14 Aidan Kehoe <kehoea(a)parhasard.net>
* unicode.el (unicode-error-default-translation-table):
* unicode.el (unicode-error-sequence-regexp-range):
* unicode.el (frob-unicode-errors-region):
Make these variables and the single function available to
make-docfile, by moving them to the start of the line. This
conflicts with normal indentation of Lisp, unfortunately.
XEmacs Trunk source patch:
Diff command: cvs -q diff -Nu
Files affected: lisp/unicode.el
===================================================================
RCS src/unicode.c
===================================================================
RCS src/lread.c
===================================================================
RCS
Index: src/lread.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/lread.c,v
retrieving revision 1.82
diff -u -u -r1.82 lread.c
--- src/lread.c 2007/08/04 20:00:24 1.82
+++ src/lread.c 2007/11/14 19:33:48
@@ -1694,7 +1694,7 @@
}
}
- if (i > 0x110000 || i < 0)
+ if (i >= 0x110000 || i < 0)
{
syntax_error ("Not a Unicode code point", make_int(i));
}
Index: src/unicode.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/unicode.c,v
retrieving revision 1.38
diff -u -u -r1.38 unicode.c
--- src/unicode.c 2007/08/04 20:00:24 1.38
+++ src/unicode.c 2007/11/14 19:33:48
@@ -336,6 +336,11 @@
Lisp_Object Qlast_allocated_character;
Lisp_Object Qccl_encode_to_ucs_2;
+Lisp_Object Vnumber_of_jit_charsets;
+Lisp_Object Vlast_jit_charset_final;
+Lisp_Object Vcharset_descr;
+
+
/************************************************************************/
/* Unicode implementation */
@@ -1080,8 +1085,6 @@
int code_levels;
int i;
int n = Dynarr_length (charsets);
- static int number_of_jit_charsets;
- static Ascbyte last_jit_charset_final;
type_checking_assert (code >= 0);
/* This shortcut depends on the representation of an Ichar, see text.c.
@@ -1124,33 +1127,21 @@
(-1 == (i = get_free_codepoint(Vcurrent_jit_charset))))
{
Ibyte setname[32];
- Lisp_Object charset_descr = build_string
- ("Mule charset for otherwise unknown Unicode code points.");
-
- struct gcpro gcpro1;
+ int number_of_jit_charsets = XINT (Vnumber_of_jit_charsets);
+ Ascbyte last_jit_charset_final = XCHAR (Vlast_jit_charset_final);
- if ('\0' == last_jit_charset_final)
- {
- /* This final byte shit is, umm, not that cool. */
- last_jit_charset_final = 0x30;
- }
+ /* This final byte shit is, umm, not that cool. */
+ assert (last_jit_charset_final >= 0x30);
/* Assertion added partly because our Win32 layer doesn't
support snprintf; with this, we're sure it won't overflow
the buffer. */
assert(100 > number_of_jit_charsets);
-
- qxesprintf(setname, "jit-ucs-charset-%d", number_of_jit_charsets++);
- /* Aside: GCPROing here would be overkill according to the FSF's
- philosophy. make-charset cannot currently GC, but is intended
- to be called from Lisp, with its arguments protected by the
- Lisp reader. We GCPRO in case it GCs in the future and no-one
- checks all the C callers. */
+ qxesprintf(setname, "jit-ucs-charset-%d", number_of_jit_charsets);
- GCPRO1 (charset_descr);
Vcurrent_jit_charset = Fmake_charset
- (intern((const CIbyte *)setname), charset_descr,
+ (intern((const CIbyte *)setname), Vcharset_descr,
/* Set encode-as-utf-8 to t, to have this character set written
using UTF-8 escapes in escape-quoted and ctext. This
sidesteps the fact that our internal character -> Unicode
@@ -1159,12 +1150,16 @@
nconc2 (list6(Qcolumns, make_int(1), Qchars, make_int(96),
Qdimension, make_int(2)),
list6(Qregistries, Qunicode_registries,
- Qfinal, make_char(last_jit_charset_final++),
+ Qfinal, make_char(last_jit_charset_final),
/* This CCL program is initialised in
unicode.el. */
Qccl_program, Qccl_encode_to_ucs_2))));
- UNGCPRO;
+ /* Record for the Unicode infrastructure that we've created
+ this character set. */
+ Vnumber_of_jit_charsets = make_int (number_of_jit_charsets + 1);
+ Vlast_jit_charset_final = make_char (last_jit_charset_final + 1);
+
i = get_free_codepoint(Vcurrent_jit_charset);
}
@@ -1421,10 +1416,15 @@
If the CODE would not otherwise be converted to an XEmacs character, and the
list of character sets to be consulted is nil or the default, a new XEmacs
character will be created for it in one of the `jit-ucs-charset' Mule
-character sets, and that character will be returned. There is scope for
-tens of thousands of separate Unicode code points in every session using
-this technique, so despite XEmacs' internal encoding not being based on
-Unicode, your data won't be trashed.
+character sets, and that character will be returned.
+
+This is limited to around 400,000 characters per XEmacs session, though, so
+while normal usage will not be problematic, things like:
+
+\(dotimes (i #x110000) (decode-char 'ucs i))
+
+will eventually error. The long-term solution to this is Unicode as an
+internal encoding.
*/
(code, USED_IF_MULE (charsets)))
{
@@ -2862,6 +2862,14 @@
void
coding_system_type_create_unicode (void)
{
+ staticpro (&Vnumber_of_jit_charsets);
+ Vnumber_of_jit_charsets = make_int (0);
+ staticpro (&Vlast_jit_charset_final);
+ Vlast_jit_charset_final = make_char (0x30);
+ staticpro (&Vcharset_descr);
+ Vcharset_descr
+ = build_string ("Mule charset for otherwise unknown Unicode code points.");
+
INITIALIZE_CODING_SYSTEM_TYPE_WITH_DATA (unicode, "unicode-coding-system-p");
CODING_SYSTEM_HAS_METHOD (unicode, print);
CODING_SYSTEM_HAS_METHOD (unicode, convert);
Index: lisp/unicode.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/unicode.el,v
retrieving revision 1.26
diff -u -u -r1.26 unicode.el
--- lisp/unicode.el 2007/10/13 14:08:30 1.26
+++ lisp/unicode.el 2007/11/14 19:33:48
@@ -494,36 +494,40 @@
(char-syntax ascii-or-latin-1))
syntax-table))
- ;; Create all the Unicode error sequences, normally as jit-ucs-charset-0
- ;; characters starting at U+200000 (which isn't a valid Unicode code
- ;; point). Make them available to user code.
- (defvar unicode-error-default-translation-table
- (loop
- with char-table = (make-char-table 'char)
- for i from ?\x00 to ?\xFF
- do
- (put-char-table (aref
- ;; #xd800 is the first leading surrogate;
- ;; trailing surrogates must be in the range
- ;; #xdc00-#xdfff. These examples are not, so we
- ;; intentionally provoke an error sequence.
- (decode-coding-string (format "\xd8\x00\x00%c" i)
- 'utf-16-be)
- 3)
- i
- char-table)
- finally return char-table)
- "Translation table mapping Unicode error sequences to Latin-1 chars.
+;; *Sigh*, declarations needs to be at the start of the line to be picked up
+;; by make-docfile. Not so much an issue with ccl-encode-to-ucs-2, which we
+;; don't necessarily want to advertise, but the following are important.
+
+;; Create all the Unicode error sequences, normally as jit-ucs-charset-0
+;; characters starting at U+200000 (which isn't a valid Unicode code
+;; point). Make them available to user code.
+(defvar unicode-error-default-translation-table
+ (loop
+ with char-table = (make-char-table 'char)
+ for i from ?\x00 to ?\xFF
+ do
+ (put-char-table (aref
+ ;; #xd800 is the first leading surrogate;
+ ;; trailing surrogates must be in the range
+ ;; #xdc00-#xdfff. These examples are not, so we
+ ;; intentionally provoke an error sequence.
+ (decode-coding-string (format "\xd8\x00\x00%c" i)
+ 'utf-16-be)
+ 3)
+ i
+ char-table)
+ finally return char-table)
+ "Translation table mapping Unicode error sequences to Latin-1 chars.
To transform XEmacs Unicode error sequences to the Latin-1 characters that
correspond to the octets on disk, you can use this variable. ")
- (defvar unicode-error-sequence-regexp-range
- (format "%c%c-%c"
- (aref (decode-coding-string "\xd8\x00\x00\x00" 'utf-16-be) 0)
- (aref (decode-coding-string "\xd8\x00\x00\x00" 'utf-16-be) 3)
- (aref (decode-coding-string "\xd8\x00\x00\xFF" 'utf-16-be) 3))
- "Regular expression range to match Unicode error sequences in XEmacs.
+(defvar unicode-error-sequence-regexp-range
+ (format "%c%c-%c"
+ (aref (decode-coding-string "\xd8\x00\x00\x00" 'utf-16-be) 0)
+ (aref (decode-coding-string "\xd8\x00\x00\x00" 'utf-16-be) 3)
+ (aref (decode-coding-string "\xd8\x00\x00\xFF" 'utf-16-be) 3))
+ "Regular expression range to match Unicode error sequences in XEmacs.
Invalid Unicode sequences on input are represented as XEmacs
characters with values stored as the keys in
@@ -559,14 +563,14 @@
nil
(format "Could not find char ?\\x%x in buffer" i))))
- (defun frob-unicode-errors-region (frob-function begin end &optional buffer)
- "Call FROB-FUNCTION on the Unicode error sequences between BEGIN and END.
+(defun frob-unicode-errors-region (frob-function begin end &optional buffer)
+ "Call FROB-FUNCTION on the Unicode error sequences between BEGIN and END.
Optional argument BUFFER specifies the buffer that should be examined for
such sequences. "
- (check-argument-type #'functionp frob-function)
- (check-argument-range begin (point-min buffer) (point-max buffer))
- (check-argument-range end (point-min buffer) (point-max buffer))
+ (check-argument-type #'functionp frob-function)
+ (check-argument-range begin (point-min buffer) (point-max buffer))
+ (check-argument-range end (point-min buffer) (point-max buffer))
(save-excursion
(save-restriction
(if buffer (set-buffer buffer))
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[COMMIT] Make string-to-list, string-to-sequence faster, simpler (change from GNU)
17 years, 1 month
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
lisp/ChangeLog addition:
2007-11-14 Aidan Kehoe <kehoea(a)parhasard.net>
* subr.el (string-to-sequence):
* subr.el (string-to-list):
* subr.el (string-to-vector):
(append STRING nil) is faster than (mapcar #'identity STRING),
(vconcat STRING) is faster than (mapcar #'identity STRING). Change
from GNU.
XEmacs Trunk source patch:
Diff command: cvs -q diff -Nu
Files affected: lisp/subr.el
===================================================================
RCS
Index: lisp/subr.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/subr.el,v
retrieving revision 1.43
diff -u -u -r1.43 subr.el
--- lisp/subr.el 2007/11/14 18:51:31 1.43
+++ lisp/subr.el 2007/11/14 19:23:25
@@ -947,17 +947,17 @@
TYPE should be `list' or `vector'."
(ecase type
(list
- (mapcar #'identity string))
+ (append string nil))
(vector
- (mapvector #'identity string))))
+ (vconcat string))))
(defun string-to-list (string)
"Return a list of characters in STRING."
- (mapcar #'identity string))
+ (append string nil))
(defun string-to-vector (string)
"Return a vector of characters in STRING."
- (mapvector #'identity string))
+ (vconcat string))
(defun store-substring (string idx obj)
"Embed OBJ (string or character) at index IDX of STRING."
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[PATCH] Import Simon Marshall's unique.el
17 years, 1 month
Aidan Kehoe
Since we use it in font-lock.el, my only doubt here is as to whether it
would be better to have this code in core. What do you think?
xemacs-packages/elib/ChangeLog addition:
2007-11-14 Aidan Kehoe <kehoea(a)parhasard.net>
* unique.el:
Import Simon Marshall's unique.el. We use his code in
font-lock.el, and it is of general utility.
XEmacs Packages source patch:
Diff command: cvs -q diff -Nu
Files affected: xemacs-packages/elib/unique.el
===================================================================
RCS
Index: xemacs-packages/elib/unique.el
===================================================================
RCS file: unique.el
diff -N unique.el
--- /dev/null Wed Nov 14 20:06:33 2007
+++ unique.el Wed Nov 14 20:06:34 2007
@@ -0,0 +1,389 @@
+;;; unique.el --- functions and commands to uniquify
+
+;; Copyright (C) 1994 Simon Marshall.
+
+;; Author: Simon Marshall <Simon.Marshall(a)mail.esrin.esa.it>
+;; Keywords: unix unique
+;; Version: 1.01
+
+;; LCD Archive Entry:
+;; unique|Simon Marshall|Simon.Marshall(a)mail.esrin.esa.it|
+;; Functions and commands to uniquify lists or buffer text (cf. sort).|
+;; 28-Jun-1994|1.01|~/misc/unique.el.Z|
+;; The archive is archive.cis.ohio-state.edu in /pub/gnu/emacs/elisp-archive.
+
+;;; This file is not part of GNU Emacs.
+
+;;; This program 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 2, or (at your option)
+;;; any later version.
+
+;;; This program 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 GNU Emacs; see the file COPYING. If not, write to
+;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+;;; Commentary:
+
+;; Purpose:
+;;
+;; This package provides functions to uniquify lists, and commands to uniquify
+;; buffer text.
+
+;; Provided are uniquification functions `unique' and `uniq'. Their
+;; differences and relative performances are described below.
+;;
+;; The function `unique' takes the list to be uniquified and a destructor
+;; function as args. This function takes an element and list as args. It
+;; returns the list minus occurrences of the element. This destructor function
+;; is called for each item in the list to be uniquified, with the rest of the
+;; list, and `unique' is therefore polynomial (as a function of the square of
+;; the length of the list, i.e., it is quadratic) iff the destructor function
+;; never removes any items from the list.
+;;
+;; The function `uniq' takes the list to be uniquified and a comparator
+;; function as args. This function takes two elements. It returns non-nil if
+;; the two elements are equivalent, the latter duplicate is removed. This
+;; comparator function is called for each item in the list to be uniquified,
+;; except the last, and `uniq' is therefore polynomial (as a function of the
+;; length of the list, i.e., it is linear) iff the comparator function never
+;; returns non-nil (no items are removed from the list).
+;;
+;; For example, the uniquification function `unique':
+;;
+;; (unique '("a" "b" "b" "b" "c" "d" "d" "e") 'delete)
+;; => ("a" "b" "c" "d" "e")
+;;
+;; Note that non-adjacent duplicate items are removed too:
+;;
+;; (unique '("foo" "bar" "is" "fubar" "as" "well" "as" "foo" "bar") 'delete)
+;; => ("foo" "bar" "is" "fubar" "as" "well")
+;;
+;; If you want to remove all but the last duplicate, reverse the list before
+;; and after uniquification:
+;;
+;; (let ((list '("foo" "bar" "is" "fubar" "as" "well" "as" "foo" "bar")))
+;; (nreverse (unique (nreverse list) 'delete)))
+;; => ("is" "fubar" "well" "as" "foo" "bar")
+;;
+;; However, the uniquification function `uniq' only removes adjacent duplicate
+;; items, like the Un*x command "uniq":
+;;
+;; (uniq '("foo" "bar" "is" "fubar" "as" "well" "as" "foo" "bar")
+;; 'string-equal)
+;; => ("foo" "bar" "is" "fubar" "as" "well" "as" "foo" "bar")
+;;
+;; To work on non-adjacent duplicate items, you must sort the list first.
+;; However, using `sort' changes the order of the list and is relatively slow:
+;;
+;; (let ((list '("foo" "bar" "is" "fubar" "as" "well" "as" "foo" "bar")))
+;; (uniq (sort list 'string-lessp) 'string-equal))
+;; => ("as" "bar" "foo" "fubar" "is" "well")
+;;
+;; So why is it provided? Good question. If the list is already sorted, and
+;; most items are unique anyway, `uniq' is quicker than `unique'. See below.
+;;
+;; With strings:
+;;
+;; For example, running these functions on the list of one-character strings
+;; built from the file .../lisp/comint.el (89146 strings, 98 (0.11%) unique):
+;;
+;; `uniq' 6.0 s (pre-sorted) 0.008 s (pre-uniqed pre-sorted)
+;; `unique' 11.4 s 0.047 s (pre-uniqued)
+;; `sort' 43.8 s 0.013 s (pre-uniqed pre-sorted)
+;; 0.017 s (pre-uniqued)
+;; Speedup: 1.9x (0.23x incl. `sort')
+;;
+;; For example, running these functions on the list of word strings built from
+;; the file .../lisp/comint.el (12727 words, 2034 (16.0%) unique):
+;;
+;; `uniq' 0.78 s (pre-sorted) 0.14 s (pre-uniqed pre-sorted)
+;; `unique' 58.8 s 15.9 s (pre-uniqued)
+;; `sort' 4.80 s 0.440 s (pre-uniqed pre-sorted)
+;; 0.638 s (pre-uniqued)
+;; Speedup: 75x (10x incl. `sort')
+;;
+;; For example, running these functions on the list of lines built from
+;; the file .../lisp/comint.el (2073 lines, 1736 (83.7%) unique):
+;;
+;; `uniq' 0.14 s (pre-sorted) 0.12 s (pre-uniqed pre-sorted)
+;; `unique' 10.8 s 10.6 s (pre-uniqued)
+;; `sort' 0.65 s 0.356 s (pre-uniqed pre-sorted)
+;; 0.509 s (pre-uniqued)
+;; Speedup: 77x (14x incl. `sort')
+;;
+;; With numbers:
+;;
+;; For example, running these functions on a list of 1024 random integers in
+;; the interval [0, 102400) (typically 99.5% unique):
+;;
+;; `uniq' 0.066 s (pre-sorted)
+;; `unique' 0.841 s
+;; `sort' 0.277 s
+;; Speedup: 12.7x (2.45x incl. `sort')
+;;
+;; For example, running these functions on a list of 5120 random integers in
+;; the interval [0, 512000) (typically 99.5% unique):
+;;
+;; `uniq' 0.336 s (pre-sorted)
+;; `unique' 18.85 s
+;; `sort' 1.707 s
+;; Speedup: 56x (9.23x incl. `sort')
+;;
+;; For example, running these functions on a list of 10240 random integers in
+;; the interval [0, 1024000) (typically 99.5% unique):
+;;
+;; `uniq' 0.671 s (pre-sorted)
+;; `unique' 73.88 s
+;; `sort' 3.759 s
+;; Speedup: 110x (16.7x incl. `sort')
+;;
+;; Note how `uniq' runs in approximately linear time w.r.t. the length of the
+;; list (and `sort' is almost linear---probably n*log2(n)---see a book),
+;; whereas `unique' runs in approximately polynomial (square) time. Double the
+;; length of the list, quadruple the evaluation time. Therefore, if the list
+;; is almost entirely unique, the speedup of `uniq' (sorting excluded) over
+;; `unique' is almost the same as the increase in list size.
+;;
+;; From the above, we can see that rather than deciding when you should use
+;; `uniq' rather than `unique' it is the other way around (wibble). If (1) you
+;; care about list order and/or (2) you know that hardly any items are unique,
+;; then you should use `unique'. Otherwise, use `uniq' and `sort'.
+
+;; Provided are uniquification commands:
+;;
+;; `unique-lines' for the removal of duplicate lines, `unique-words' for words
+;; and `unique-sentences' for sentences. They can be invoked as extended
+;; commands or bound to keys:
+;;
+;; M-x unique-lines
+;;
+;; (local-set-key "\C-cl" 'unique-lines)
+;;
+;; Typing C-c l invokes `unique-lines' on the currently selected region.
+
+;; Installation:
+;;
+;; To use, put in your package that uses these functions:
+;;
+;; (require 'unique)
+;;
+;; or autoload in your ~/.emacs the specific functions you require:
+;;
+;; (autoload 'unique "unique"
+;; "Uniquify LIST, deleting elements using PREDICATE.")
+;; (autoload 'uniq "unique"
+;; "Uniquify LIST, comparing adjacent elements using PREDICATE.")
+;;
+;; (autoload 'unique-lines "unique" "Uniquify lines in region." t)
+;; (autoload 'unique-words "unique" "Uniquify words in region." t)
+;; (autoload 'unique-sentences "unique" "Uniquify sentences in region." t)
+
+;; Feedback:
+;;
+;; This is hand written software. Use it at your own risk.
+;;
+;; Please send me bug reports, bug fixes, and extensions, so that I can
+;; merge them into the master source.
+;; - Simon Marshall (Simon.Marshall(a)mail.esrin.esa.it)
+;; Don't forget the version number of the package.
+
+;; History:
+;;
+;; - 1.00--1.01:
+;; Analysis of the performance of `uniq' (and `sort') vs. `unique'.
+;; Corrected Copyleft.
+
+;; Guts of the list-processing code
+
+(defun unique (list predicate)
+ "Uniquify LIST, deleting elements using PREDICATE.
+Return the list with subsequent duplicate items removed by side effects.
+PREDICATE is called with an element of LIST and a list of elements from LIST,
+and should return the list of elements with occurrences of the element removed.
+This function will work even if LIST is unsorted. See also `uniq'."
+ (let ((list list))
+ (while list
+ (setq list (setcdr list (funcall predicate (car list) (cdr list))))))
+ list)
+
+(defun uniq (list predicate)
+ "Uniquify LIST, comparing adjacent elements using PREDICATE.
+Return the list with adjacent duplicate items removed by side effects.
+PREDICATE is called with two elements of LIST, and should return non-nil if the
+first element is \"equal to\" the second.
+This function will only work as expected if LIST is sorted, as with the Un*x
+command of the same name. See also `sort' and `unique'."
+ (let ((list list))
+ (while list
+ (while (funcall predicate (car list) (nth 1 list))
+ (setcdr list (nthcdr 2 list)))
+ (setq list (cdr list))))
+ list)
+
+;; Guts of the buffer-processing code
+
+;; Might as well reuse as much code as we can. This is always the first sort
+;; function called.
+(autoload 'sort-build-lists "sort")
+
+(eval-when-compile
+ (require 'sort))
+
+(defvar unique-fold-case nil
+ "*Non-nil if the buffer unique functions should ignore case.")
+
+(defun unique-subr (nextrecfun endrecfun &optional startkeyfun endkeyfun)
+ "General text unique routine to divide buffer into records and uniquify them.
+Arguments are NEXTRECFUN ENDRECFUN and optional STARTKEYFUN ENDKEYFUN.
+
+We divide the accessible portion of the buffer into disjoint pieces called
+unique records (they are the same as sort records). A portion of each unique
+record (perhaps all of it) is designated as the unique key. The records are
+rearranged in the buffer by their unique keys. The records may or may not be
+contiguous.
+
+The four arguments are functions to be called to move point across a unique
+record. They will be called many times from within unique-subr.
+
+NEXTRECFUN is called with point at the end of the previous record. It moves
+point to the start of the next record. It should move point to the end of the
+buffer if there are no more records. The first record is assumed to start at
+the position of point when unique-subr is called.
+
+ENDRECFUN is called with point within the record. It should move point to the
+end of the record.
+
+STARTKEYFUN moves from the start of the record to the start of the key. It may
+return either a non-nil value to be used as the key, or else the key is the
+substring between the values of point after STARTKEYFUN and ENDKEYFUN are
+called. If STARTKEYFUN is nil, the key starts at the beginning of the record.
+
+ENDKEYFUN moves from the start of the unique key to the end of the unique key.
+ENDKEYFUN may be nil if STARTKEYFUN returns a value or if it would be the
+same as ENDRECFUN."
+ ;; Heuristically try to avoid messages if uniquifying a small amt of text.
+ (let ((messages (> (- (point-max) (point-min)) 10000))
+ (case-fold-search unique-fold-case) (unique-lists ()))
+ (save-excursion
+ (if messages (message "Finding unique keys..."))
+ (setq unique-lists (nreverse (sort-build-lists nextrecfun endrecfun
+ startkeyfun endkeyfun)))
+ (if (null unique-lists)
+ (if messages (message "Finding unique keys...none found"))
+ (if messages (message "Uniquifying records..."))
+ (setq unique-lists (unique unique-lists
+ (if (consp (car (car unique-lists)))
+ 'unique-delete-buffer-substrings
+ 'delete)))
+ (if messages (message "Reordering buffer..."))
+ (unique-reorder-buffer unique-lists)
+ (if messages (message "Reordering buffer...done"))))))
+
+(defun unique-delete-buffer-substrings (a blist)
+ ;; Return BLIST without occurrences of the text referred to by unique key A.
+ (let ((bl blist)
+ (unique-equal-buffer-substrings
+ ;; Is the text refered to by the unique keys A and B the same?
+ (function (lambda (a b) (zerop (compare-buffer-substrings
+ nil (car (car a)) (cdr (car a))
+ nil (car (car b)) (cdr (car b))))))))
+ (while bl
+ (while (funcall unique-equal-buffer-substrings a (nth 1 bl))
+ (setcdr bl (nthcdr 2 bl)))
+ (setq bl (cdr bl)))
+ (if (funcall unique-equal-buffer-substrings a (car blist))
+ (cdr blist)
+ blist)))
+
+(defun unique-reorder-buffer (unique-lists)
+ (let ((inhibit-quit t)
+ (last (point-min))
+ (min (point-min)) (max (point-max)))
+ ;; Make sure insertions done for reordering
+ ;; do not go after any markers at the end of the uniquified region,
+ ;; by inserting a space to separate them.
+ (goto-char (point-max))
+ (insert-before-markers " ")
+ (narrow-to-region min (1- (point-max)))
+ (while unique-lists
+ (goto-char (point-max))
+ (insert-buffer-substring (current-buffer)
+ (nth 1 (car unique-lists))
+ (1+ (cdr (cdr (car unique-lists)))))
+ (setq unique-lists (cdr unique-lists)))
+ ;; Delete the original copy of the text.
+ (delete-region min max)
+ ;; Get rid of the separator " ".
+ (goto-char (point-max))
+ (narrow-to-region min (1+ (point)))
+ (delete-region (point) (1+ (point)))))
+
+;;; Commands
+
+(defun unique-lines (beg end)
+ "Uniquify lines in region.
+Called from a program, there are two arguments: BEG and END (the region)."
+ (interactive "r")
+ (save-excursion
+ (save-restriction
+ (narrow-to-region beg end)
+ (goto-char (point-min))
+ (unique-subr 'forward-line 'end-of-line))))
+
+(defun unique-words (beg end)
+ "Uniquify words in region.
+Called from a program, there are two arguments: BEG and END (the region)."
+ (interactive "r")
+ (save-excursion
+ (save-restriction
+ (narrow-to-region beg end)
+ (goto-char (point-min))
+ (unique-subr (function (lambda () (skip-chars-forward "\n \t\f")))
+ (function (lambda () (forward-word 1)))))))
+
+(defun unique-sentences (beg end)
+ "Uniquify sentences in region.
+Called from a program, there are two arguments: BEG and END (the region)."
+ (interactive "r")
+ (save-excursion
+ (save-restriction
+ (narrow-to-region beg end)
+ (goto-char (point-min))
+ (unique-subr (function (lambda () (skip-chars-forward "\n \t\f")))
+ (function (lambda () (forward-sentence 1)
+ (or (zerop (skip-chars-forward "\n \t\f"))
+ (backward-char 1))))))))
+
+;;; Functions for emacs-18
+
+(or (fboundp 'delete)
+ (defun delete (elt list)
+ "Delete by side effect any occurrences of ELT as a member of LIST.
+The modified LIST is returned. Comparison is done with `equal'.
+If the first member of LIST is ELT there is no way to remove it by side effect;
+therefore, write `(setq foo (delete element foo))'
+to be sure of changing the value of `foo'."
+ (let ((list list))
+ (while list
+ (while (equal elt (nth 1 list))
+ (setcdr list (nthcdr 2 list)))
+ (setq list (cdr list))))
+ (if (equal elt (car list)) (cdr list) list)))
+
+;; Maybe one day `compare-buffer-substrings' too. But then again, maybe not.
+(or (fboundp 'compare-buffer-substrings)
+ (defun compare-buffer-substrings (buffer1 start1 end1 buffer2 start2 end2)
+ "In GNU Emacs 19 this function compares two substrings of two buffers."
+ (let ((version (emacs-version)))
+ (error "Function `compare-buffer-substrings' is not provided in %s"
+ (substring version 0 (string-match "\\.[0-9]+ " version))))))
+
+(provide 'unique)
+
+;;; unique.el ends here
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[COMMIT] Import make-temp-name (the functionality of mkstemp(3)) from GNU
17 years, 1 month
Aidan Kehoe
Yes, the CODING-SYSTEM-OR-MUSTBENEW argument is ugly. No, I don’t see a
better approach to this which would be compatible with GNU, given that our
CODING-SYSTEM argument was already in 21.4.
APPROVE COMMIT
NOTE: This patch has been committed.
lisp/ChangeLog addition:
2007-11-14 Aidan Kehoe <kehoea(a)parhasard.net>
* code-files.el (write-region):
Provide a new arg, CODING-SYSTEM-OR-MUSTBENEW, for compatibility
both with GNU (where it has the MUSTBENEW meaning) and earlier
XEmacs code (where it has the CODING-SYSTEM meaning).
* files.el:
* files.el (normal-backup-enable-predicate):
* files.el (auto-save-file-name-transforms):
Correct the docstrings of #'normal-backup-enable-predicate,
#'auto-save-file-name-transforms.
* files.el (make-temp-file): New.
Merge from GNU.
* subr.el:
Document that #'make-temp-name is now in files.el.
src/ChangeLog addition:
2007-11-14 Aidan Kehoe <kehoea(a)parhasard.net>
* editfns.c (vars_of_editfns):
Correct the docstring of user-full-name.
* fileio.c:
* fileio.c (Fmake_temp_name):
Document that make-temp-file is available and the best approach to
this.
* fileio.c (Fwrite_region_internal):
Take a new arg, MUSTBENEW, to error if the file to be written
already exists.
* fileio.c (auto_save_1):
Update a call to Fwrite_region_internal to pass the new argument.
* fileio.c (syms_of_fileio):
Provide 'excl as a symbol, for the calls to
write-region-internal.
XEmacs Trunk source patch:
Diff command: cvs -q diff -Nu
Files affected: src/fileio.c
===================================================================
RCS src/editfns.c
===================================================================
RCS lisp/subr.el
===================================================================
RCS lisp/files.el
===================================================================
RCS lisp/code-files.el
===================================================================
RCS
Index: lisp/code-files.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/code-files.el,v
retrieving revision 1.22
diff -u -u -r1.22 code-files.el
--- lisp/code-files.el 2007/10/02 20:09:01 1.22
+++ lisp/code-files.el 2007/11/14 18:34:22
@@ -514,7 +514,8 @@
corresponding arguments in the call to `write-region'.")
(defun write-region (start end filename
- &optional append visit lockname coding-system)
+ &optional append visit lockname
+ coding-system-or-mustbenew)
"Write current region into specified file.
By default the file's existing contents are replaced by the specified region.
Called interactively, prompts for a file name. With a prefix arg, prompts
@@ -536,25 +537,40 @@
use for locking and unlocking, overriding FILENAME and VISIT.
Kludgy feature: if START is a string, then that string is written
to the file, instead of any buffer contents, and END is ignored.
-Optional seventh argument CODING-SYSTEM specifies the coding system
- used to encode the text when it is written out, and defaults to
- the value of `buffer-file-coding-system' in the current buffer.
+
+Optional seventh argument CODING-SYSTEM-OR-MUSTBENEW has a rather kludgy
+ interpretation. If it is a coding system it describes the coding system
+ used to encode the text when it is written out, defaulting to to the value
+ of `buffer-file-coding-system' in the current buffer.
+
+If CODING-SYSTEM-OR-MUSTBENEW is non-nil and not a coding system, it means
+ that a check for an existing file with the same name should be made; with
+ a value of 'excl XEmacs will error if the file already exists and never
+ overwrite it. If it is some other non-nil non-coding-system value, the
+ user will be asked for confirmation if the file already exists, and the
+ file will be overwritten if confirmation is given.
+
See also `write-region-pre-hook' and `write-region-post-hook'."
(interactive "r\nFWrite region to file: \ni\ni\ni\nZCoding-system: ")
- (setq coding-system
- (or coding-system-for-write
- (run-hook-with-args-until-success
- 'write-region-pre-hook
- start end filename append visit lockname coding-system)
- coding-system
- buffer-file-coding-system
- (find-file-coding-system-for-write-from-filename filename)
- ))
- (if (consp coding-system)
- ;; One of the `write-region-pre-hook' functions wrote the file
- coding-system
- (let ((func
- (coding-system-property coding-system 'pre-write-conversion)))
+ (let (mustbenew coding-system func hook-result)
+ (setq hook-result
+ (or coding-system-for-write
+ (run-hook-with-args-until-success
+ 'write-region-pre-hook
+ start end filename append visit lockname
+ coding-system-or-mustbenew)
+ coding-system
+ buffer-file-coding-system
+ (find-file-coding-system-for-write-from-filename filename)))
+ (if (consp hook-result)
+ ;; One of the `write-region-pre-hook' functions wrote the file.
+ hook-result
+ ;; The hooks didn't do the work; do it ourselves.
+ (setq mustbenew (unless (coding-system-p coding-system-or-mustbenew)
+ coding-system-or-mustbenew)
+ coding-system (cond ((coding-system-p hook-result) hook-result)
+ ((null mustbenew) coding-system-or-mustbenew))
+ func (coding-system-property coding-system 'pre-write-conversion))
(if func
(let ((curbuf (current-buffer))
(tempbuf (generate-new-buffer " *temp-write-buffer*"))
@@ -569,7 +585,8 @@
append
(if (eq visit t) nil visit)
lockname
- coding-system))
+ coding-system
+ mustbenew))
;; leaving a buffer associated with file will cause problems
;; when next visiting.
(kill-buffer tempbuf)
@@ -579,7 +596,7 @@
(set-buffer-modified-p nil)
(if (buffer-file-name) (set-visited-file-modtime))))))
(write-region-internal start end filename append visit lockname
- coding-system)))
+ coding-system mustbenew)))
(run-hook-with-args 'write-region-post-hook
start end filename append visit lockname
coding-system)))
Index: lisp/files.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/files.el,v
retrieving revision 1.79
diff -u -u -r1.79 files.el
--- lisp/files.el 2007/08/31 08:34:27 1.79
+++ lisp/files.el 2007/11/14 18:34:23
@@ -163,8 +163,8 @@
(defun normal-backup-enable-predicate (name)
"Default `backup-enable-predicate' function.
-Checks for files in `temporary-file-directory' or
-`small-temporary-file-directory'."
+Checks for files in the directory returned by `temp-directory' or specified
+by `small-temporary-file-directory'."
(let ((temporary-file-directory (temp-directory)))
(not (or (let ((comp (compare-strings temporary-file-directory 0 nil
name 0 nil)))
@@ -330,9 +330,8 @@
When one transform applies, its result is final;
no further transforms are tried.
-The default value is set up to put the auto-save file into the
-temporary directory (see the variable `temporary-file-directory') for
-editing a remote file."
+The default value is set up to put the auto-save file into the temporary
+directory (see the function `temp-directory') for editing a remote file."
:group 'auto-save
:type '(repeat (list (string :tag "Regexp") (string :tag "Replacement")))
;:version "21.1"
@@ -715,6 +714,51 @@
(setq newname (expand-file-name tem (file-name-directory newname)))
(setq count (1- count))))
newname))
+
+(defun make-temp-file (prefix &optional dir-flag suffix)
+ "Create a temporary file.
+The returned file name (created by appending some random characters at the
+end of PREFIX, and expanding against the return value of `temp-directory' if
+necessary), is guaranteed to point to a newly created empty file. You can
+then use `write-region' to write new data into the file.
+
+If DIR-FLAG is non-nil, create a new empty directory instead of a file.
+
+If SUFFIX is non-nil, add that at the end of the file name.
+
+This function is analagous to mkstemp(3) under POSIX, avoiding the race
+condition between testing for the existence of the generated filename (under
+POSIX with mktemp(3), under Emacs Lisp with `make-temp-name') and creating
+it."
+ (let ((umask (default-file-modes))
+ (temporary-file-directory (temp-directory))
+ file)
+ (unwind-protect
+ (progn
+ ;; Create temp files with strict access rights. It's easy to
+ ;; loosen them later, whereas it's impossible to close the
+ ;; time-window of loose permissions otherwise.
+ (set-default-file-modes #o700)
+ (while (condition-case ()
+ (progn
+ (setq file
+ (make-temp-name
+ (expand-file-name prefix
+ temporary-file-directory)))
+ (if suffix
+ (setq file (concat file suffix)))
+ (if dir-flag
+ (make-directory file)
+ (write-region "" nil file nil 'silent nil 'excl))
+ nil)
+ (file-already-exists t))
+ ;; the file was somehow created by someone else between
+ ;; `make-temp-name' and `write-region', let's try again.
+ nil)
+ file)
+ ;; Reset the umask.
+ (set-default-file-modes umask))))
+
(defun switch-to-other-buffer (arg)
"Switch to the previous buffer. With a numeric arg, n, switch to the nth
Index: lisp/subr.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/subr.el,v
retrieving revision 1.42
diff -u -u -r1.42 subr.el
--- lisp/subr.el 2007/10/01 08:07:41 1.42
+++ lisp/subr.el 2007/11/14 18:34:23
@@ -1678,7 +1678,7 @@
;; assq-del-all in obsolete.el.
-;; (defun make-temp-file (prefix &optional dir-flag suffix) #### doesn't exist.
+;; make-temp-file in files.el.
;; add-minor-mode in modeline.el.
Index: src/editfns.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/editfns.c,v
retrieving revision 1.54
diff -u -u -r1.54 editfns.c
--- src/editfns.c 2007/10/02 19:31:31 1.54
+++ src/editfns.c 2007/11/14 18:34:23
@@ -2541,8 +2541,8 @@
DEFVAR_LISP ("user-full-name", &Vuser_full_name /*
*The name of the user.
-The function `user-full-name', which will return the value of this
- variable, when called without arguments.
+The function `user-full-name' will return the value of this variable, when
+called without arguments.
This is initialized to the value of the NAME environment variable.
*/ );
/* Initialized at run-time. */
Index: src/fileio.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/fileio.c,v
retrieving revision 1.112
diff -u -u -r1.112 fileio.c
--- src/fileio.c 2007/02/22 16:19:43 1.112
+++ src/fileio.c 2007/11/14 18:34:24
@@ -122,6 +122,7 @@
static Lisp_Object Vinhibit_file_name_operation;
Lisp_Object Qfile_already_exists;
+Lisp_Object Qexcl;
Lisp_Object Qauto_save_hook;
Lisp_Object Qauto_save_error;
@@ -623,11 +624,12 @@
In addition, this function makes an attempt to choose a name that
does not specify an existing file. To make this work, PREFIX should
-be an absolute file name. A reasonable idiom is
+be an absolute file name.
-\(make-temp-name (expand-file-name "myprefix" (temp-directory)))
-
-which puts the file in the OS-specified temporary directory.
+This function is analagous to mktemp(3) under POSIX, and as with it, there
+exists a race condition between the test for the existence of the new file
+and its creation. See `make-temp-name' for a function which avoids this
+race condition by specifying the appropriate flags to `write-region'.
*/
(prefix))
{
@@ -3313,21 +3315,31 @@
return Qnil;
}
-DEFUN ("write-region-internal", Fwrite_region_internal, 3, 7,
+DEFUN ("write-region-internal", Fwrite_region_internal, 3, 8,
"r\nFWrite region to file: ", /*
Write current region into specified file; no coding-system frobbing.
-This function is identical to `write-region' except for the handling
-of the CODESYS argument under XEmacs/Mule. (When Mule support is not
-present, both functions are identical and ignore the CODESYS argument.)
-If support for Mule exists in this Emacs, the file is encoded according
-to the value of CODESYS. If this is nil, no code conversion occurs.
+
+This function is almost identical to `write-region'; see that function for
+documentation of the START, END, FILENAME, APPEND, VISIT, and LOCKNAME
+arguments. CODESYS specifies the encoding to be used for the file; if it is
+nil, no code conversion occurs. (With `write-region' the coding system is
+determined automatically if not specified.)
+
+MUSTBENEW specifies that a check for an existing file of the same name
+should be made. If it is 'excl, XEmacs will error on detecting such a file
+and never write it. If it is some other non-nil value, the user will be
+prompted to confirm the overwriting of an existing file. If it is nil,
+existing files are silently overwritten when file system permissions allow
+this.
As a special kludge to support auto-saving, when START is nil START and
END are set to the beginning and end, respectively, of the buffer,
regardless of any restrictions. Don't use this feature. It is documented
here because write-region handler writers need to be aware of it.
+
*/
- (start, end, filename, append, visit, lockname, codesys))
+ (start, end, filename, append, visit, lockname, codesys,
+ mustbenew))
{
/* This function can call lisp. GC checked 2000-07-28 ben */
int desc;
@@ -3372,6 +3384,9 @@
{
Lisp_Object handler;
+ if (!NILP (mustbenew) && !EQ (mustbenew, Qexcl))
+ barf_or_query_if_file_exists (filename, "overwrite", 1, NULL);
+
if (visiting_other)
visit_file = Fexpand_file_name (visit, Qnil);
else
@@ -3433,12 +3448,14 @@
desc = -1;
if (!NILP (append))
{
- desc = qxe_open (XSTRING_DATA (fn), O_WRONLY | OPEN_BINARY, 0);
+ desc = qxe_open (XSTRING_DATA (fn), O_WRONLY | OPEN_BINARY
+ | (EQ (mustbenew, Qexcl) ? O_EXCL : 0), 0);
}
if (desc < 0)
{
desc = qxe_open (XSTRING_DATA (fn),
- O_WRONLY | O_TRUNC | O_CREAT | OPEN_BINARY,
+ O_WRONLY | (EQ (mustbenew, Qexcl) ? O_EXCL : O_TRUNC)
+ | O_CREAT | OPEN_BINARY,
auto_saving ? auto_save_mode_bits : CREAT_MODE);
}
@@ -4007,11 +4024,11 @@
Fwrite_region_internal (Qnil, Qnil, a, Qnil, Qlambda, Qnil,
#if 1 /* #### Kyle wants it changed to not use escape-quoted. Think
carefully about how this works. */
- Qescape_quoted
+ Qescape_quoted,
#else
- current_buffer->buffer_file_coding_system
+ current_buffer->buffer_file_coding_system,
#endif
- );
+ Qnil);
}
static Lisp_Object
@@ -4367,6 +4384,7 @@
DEFSYMBOL (Qverify_visited_file_modtime);
DEFSYMBOL (Qset_visited_file_modtime);
DEFSYMBOL (Qcar_less_than_car); /* Vomitous! */
+ DEFSYMBOL (Qexcl);
DEFSYMBOL (Qauto_save_hook);
DEFSYMBOL (Qauto_save_error);
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[COMMIT] Document how one can include a trailing backslash in a raw string
17 years, 1 month
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
man/ChangeLog addition:
2007-11-14 Aidan Kehoe <kehoea(a)parhasard.net>
* lispref/objects.texi (String Type):
Describe how one can include a trailing backslash in a raw string,
by means of the Unicode escape syntax.
XEmacs Trunk source patch:
Diff command: cvs -q diff -Nu
Files affected: man/lispref/objects.texi
===================================================================
RCS
Index: man/lispref/objects.texi
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/man/lispref/objects.texi,v
retrieving revision 1.9
diff -u -u -r1.9 objects.texi
--- man/lispref/objects.texi 2006/08/04 22:55:10 1.9
+++ man/lispref/objects.texi 2007/11/14 18:17:54
@@ -1084,10 +1084,13 @@
a string, each character following a backslash is included literally in
the string, and all backslashes are left in the string. This means that
@code{#r"\""} is a valid string literal with two characters, a backslash and a
-double-quote. It also means that a string with this syntax @emph{cannot end
-in a single backslash}. As with Python, from where this syntax was
+double-quote. It also means that a string with this syntax cannot end
+in a single backslash. As with Python, from where this syntax was
taken, you can specify @code{u} or @code{U} after the @code{#r} to
-specify that interpretation of Unicode escapes should be done.
+specify that interpretation of Unicode escapes should be
+done---@pxref{Character Type}---and if you use @code{#ru} for your raw
+strings, the restriction on the trailing backslash can be worked around
+like so: @code{#ru"Backslash: \u005C"}.
The newline character is not special in the read syntax for strings;
if you write a new line between the double-quotes, it becomes a
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[COMMIT] Correct some documentation on character representation and display
17 years, 1 month
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
man/ChangeLog addition:
2007-11-14 Aidan Kehoe <kehoea(a)parhasard.net>
* xemacs/keystrokes.texi (Character Representation):
Clarify the description of which characters are displayed as
themselves and which as octal escapes bzw. "control" characters
with an initial caret.
XEmacs Trunk source patch:
Diff command: cvs -q diff -Nu
Files affected: man/xemacs/keystrokes.texi
===================================================================
RCS
Index: man/xemacs/keystrokes.texi
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/man/xemacs/keystrokes.texi,v
retrieving revision 1.5
diff -u -u -r1.5 keystrokes.texi
--- man/xemacs/keystrokes.texi 2005/12/24 19:53:58 1.5
+++ man/xemacs/keystrokes.texi 2007/11/14 18:03:37
@@ -444,18 +444,23 @@
buffers. @xref{Key Sequences}, for information on representing key
sequences to create key bindings.
- ASCII graphic characters in Emacs buffers are displayed with their
-graphics. @key{LFD} is the same as a newline character; it is displayed
-by starting a new line. @key{TAB} is displayed by moving to the next
-tab stop column (usually every 8 spaces). Other control characters are
-displayed as a caret (@samp{^}) followed by the non-control version of
-the character; thus, @kbd{C-a} is displayed as @samp{^A}. Non-ASCII
-characters 128 and up are displayed with octal escape sequences; thus,
-character code 243 (octal), also called @kbd{M-#} when used as an input
-character, is displayed as @samp{\243}.
+ Printable characters (letters, numbers, punctuation and so on) in
+XEmacs buffers are displayed as such. @key{LFD} (line feed, character
+code @samp{\012} (octal)) is the same as a newline character; it is
+displayed by starting a new line. @key{TAB} is displayed by moving to
+the next tab stop column (usually every 8 spaces). Other control
+characters below #x20 (hexadecimal) are displayed as a caret (@samp{^})
+followed by the non-control version of the character; thus, @kbd{C-a} is
+displayed as @samp{^A}. Characters between (hexadecimal) #x80 and #xA0
+are displayed with octal escape sequences; thus, character code 243
+(octal), also called @kbd{M-#} when used as an input character, is
+displayed as @samp{\243}.
The variable @code{ctl-arrow} may be used to alter this behavior.
-@xref{Display Vars}.
+@xref{Display Vars}. As a rule, its value limits octal display to those
+characters in the range just mentioned, and otherwise characters are
+treated as printable, and will be displayed as themselves when the
+relevant fonts are available.
@node Commands, Non-Latin keyboards, Character Representation, Keystrokes
@section Keys and Commands
--
On the quay of the little Black Sea port, where the rescued pair came once
more into contact with civilization, Dobrinton was bitten by a dog which was
assumed to be mad, though it may only have been indiscriminating. (Saki)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
Re: [PATCH] Possible bug with mouse buttons 8 and 9 (part2)
17 years, 1 month
Aidan Kehoe
Ar an t-aonú lá déag de mí na Samhain, scríobh Mats Lidell:
> >>>>> Aidan wrote:
>
> Aidan> SXEmacs, based on the XEmacs 21.4 code base, supports up to 26 mouse
> Aidan> buttons. Steve Youngs’ patches to implement this are here:
>
> Aidan> http://www.sxemacs.org/list-archives/html/sxemacs-patches/2005-08/msg0000...
> Aidan> http://www.sxemacs.org/list-archives/html/sxemacs-patches/2005-08/msg0000...
>
> Aidan> and should apply relatively easily to XEmacs trunk, once you’ve worked
> Aidan> around the change in C style.
>
> Seemed like a nice little hack so I tried it for 21.5. Patch follows.
Looks good. Are you planning on committing this?
> Index: src/ChangeLog
> ===================================================================
> RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
> retrieving revision 1.1104
> diff -u -r1.1104 ChangeLog
> --- src/ChangeLog 2007/11/05 14:59:20 1.1104
> +++ src/ChangeLog 2007/11/10 23:26:58
> @@ -1,3 +1,10 @@
> +2007-11-11 Mats Lidell <matsl(a)xemacs.org>
> +
> + * events.h: Based on SXEmacs patch. Support for mouse button 6 to
> + 26.
> + * keymap.h: Ditto.
> + * keymap.c: Ditto.
> +
> 2007-11-05 Didier Verna <didier(a)xemacs.org>
>
> * glyphs.c (potential_pixmap_file_instanciator): Fix comment
> Index: src/events.h
> ===================================================================
> RCS file: /pack/xemacscvs/XEmacs/xemacs/src/events.h,v
> retrieving revision 1.42
> diff -u -r1.42 events.h
> --- src/events.h 2005/10/24 10:07:36 1.42
> +++ src/events.h 2007/11/10 23:26:59
> @@ -921,7 +921,28 @@
> #define XEMACS_MOD_BUTTON3 (1<<8)
> #define XEMACS_MOD_BUTTON4 (1<<9)
> #define XEMACS_MOD_BUTTON5 (1<<10)
> -
> +#define XEMACS_MOD_BUTTON6 (1<<11)
> +#define XEMACS_MOD_BUTTON7 (1<<12)
> +#define XEMACS_MOD_BUTTON8 (1<<13)
> +#define XEMACS_MOD_BUTTON9 (1<<14)
> +#define XEMACS_MOD_BUTTON10 (1<<15)
> +#define XEMACS_MOD_BUTTON11 (1<<16)
> +#define XEMACS_MOD_BUTTON12 (1<<17)
> +#define XEMACS_MOD_BUTTON13 (1<<18)
> +#define XEMACS_MOD_BUTTON14 (1<<19)
> +#define XEMACS_MOD_BUTTON15 (1<<20)
> +#define XEMACS_MOD_BUTTON16 (1<<21)
> +#define XEMACS_MOD_BUTTON17 (1<<22)
> +#define XEMACS_MOD_BUTTON18 (1<<23)
> +#define XEMACS_MOD_BUTTON19 (1<<24)
> +#define XEMACS_MOD_BUTTON20 (1<<25)
> +#define XEMACS_MOD_BUTTON21 (1<<26)
> +#define XEMACS_MOD_BUTTON22 (1<<27)
> +#define XEMACS_MOD_BUTTON23 (1<<28)
> +#define XEMACS_MOD_BUTTON24 (1<<29)
> +#define XEMACS_MOD_BUTTON25 (1<<30)
> +#define XEMACS_MOD_BUTTON26 (1<<31)
> +
> /* Note: under X Windows, XEMACS_MOD_ALT is generated by the Alt key
> if there are both Alt and Meta keys. If there are no Meta keys,
> then Alt generates XEMACS_MOD_META instead.
> Index: src/keymap.c
> ===================================================================
> RCS file: /pack/xemacscvs/XEmacs/xemacs/src/keymap.c,v
> retrieving revision 1.62
> diff -u -r1.62 keymap.c
> --- src/keymap.c 2006/08/08 15:26:08 1.62
> +++ src/keymap.c 2007/11/10 23:27:01
> @@ -217,10 +217,20 @@
> static Lisp_Object keymap_submaps (Lisp_Object keymap);
>
> Lisp_Object Qcontrol, Qctrl, Qmeta, Qsuper, Qhyper, Qalt, Qshift;
> -Lisp_Object Qbutton0, Qbutton1, Qbutton2, Qbutton3;
> -Lisp_Object Qbutton4, Qbutton5, Qbutton6, Qbutton7;
> -Lisp_Object Qbutton0up, Qbutton1up, Qbutton2up, Qbutton3up;
> -Lisp_Object Qbutton4up, Qbutton5up, Qbutton6up, Qbutton7up;
> +Lisp_Object Qbutton0;
> +Lisp_Object Qbutton1, Qbutton2, Qbutton3, Qbutton4, Qbutton5;
> +Lisp_Object Qbutton6, Qbutton7, Qbutton8, Qbutton9, Qbutton10;
> +Lisp_Object Qbutton11, Qbutton12, Qbutton13, Qbutton14, Qbutton15;
> +Lisp_Object Qbutton16, Qbutton17, Qbutton18, Qbutton19, Qbutton20;
> +Lisp_Object Qbutton21, Qbutton22, Qbutton23, Qbutton24, Qbutton25;
> +Lisp_Object Qbutton26;
> +Lisp_Object Qbutton0up;
> +Lisp_Object Qbutton1up, Qbutton2up, Qbutton3up, Qbutton4up, Qbutton5up;
> +Lisp_Object Qbutton6up, Qbutton7up, Qbutton8up, Qbutton9up, Qbutton10up;
> +Lisp_Object Qbutton11up, Qbutton12up, Qbutton13up, Qbutton14up, Qbutton15up;
> +Lisp_Object Qbutton16up, Qbutton17up, Qbutton18up, Qbutton19up, Qbutton20up;
> +Lisp_Object Qbutton21up, Qbutton22up, Qbutton23up, Qbutton24up, Qbutton25up;
> +Lisp_Object Qbutton26up;
>
> Lisp_Object Qmenu_selection;
> /* Emacs compatibility */
> @@ -231,6 +241,25 @@
> Lisp_Object Qdown_mouse_5, Qmouse_5;
> Lisp_Object Qdown_mouse_6, Qmouse_6;
> Lisp_Object Qdown_mouse_7, Qmouse_7;
> +Lisp_Object Qdown_mouse_8, Qmouse_8;
> +Lisp_Object Qdown_mouse_9, Qmouse_9;
> +Lisp_Object Qdown_mouse_10, Qmouse_10;
> +Lisp_Object Qdown_mouse_11, Qmouse_11;
> +Lisp_Object Qdown_mouse_12, Qmouse_12;
> +Lisp_Object Qdown_mouse_13, Qmouse_13;
> +Lisp_Object Qdown_mouse_14, Qmouse_14;
> +Lisp_Object Qdown_mouse_15, Qmouse_15;
> +Lisp_Object Qdown_mouse_16, Qmouse_16;
> +Lisp_Object Qdown_mouse_17, Qmouse_17;
> +Lisp_Object Qdown_mouse_18, Qmouse_18;
> +Lisp_Object Qdown_mouse_19, Qmouse_19;
> +Lisp_Object Qdown_mouse_20, Qmouse_20;
> +Lisp_Object Qdown_mouse_21, Qmouse_21;
> +Lisp_Object Qdown_mouse_22, Qmouse_22;
> +Lisp_Object Qdown_mouse_23, Qmouse_23;
> +Lisp_Object Qdown_mouse_24, Qmouse_24;
> +Lisp_Object Qdown_mouse_25, Qmouse_25;
> +Lisp_Object Qdown_mouse_26, Qmouse_26;
>
> /* Kludge kludge kludge */
> Lisp_Object QLFD, QTAB, QRET, QESC, QDEL, QSPC, QBS;
> @@ -468,7 +497,14 @@
> Lisp_Keymap *k;
>
> modifiers &= ~(XEMACS_MOD_BUTTON1 | XEMACS_MOD_BUTTON2 | XEMACS_MOD_BUTTON3
> - | XEMACS_MOD_BUTTON4 | XEMACS_MOD_BUTTON5);
> + | XEMACS_MOD_BUTTON4 | XEMACS_MOD_BUTTON5 | XEMACS_MOD_BUTTON6
> + | XEMACS_MOD_BUTTON7 | XEMACS_MOD_BUTTON8 | XEMACS_MOD_BUTTON9
> + | XEMACS_MOD_BUTTON10 | XEMACS_MOD_BUTTON11 | XEMACS_MOD_BUTTON12
> + | XEMACS_MOD_BUTTON13 | XEMACS_MOD_BUTTON14 | XEMACS_MOD_BUTTON15
> + | XEMACS_MOD_BUTTON16 | XEMACS_MOD_BUTTON17 | XEMACS_MOD_BUTTON18
> + | XEMACS_MOD_BUTTON19 | XEMACS_MOD_BUTTON20 | XEMACS_MOD_BUTTON21
> + | XEMACS_MOD_BUTTON22 | XEMACS_MOD_BUTTON23 | XEMACS_MOD_BUTTON24
> + | XEMACS_MOD_BUTTON25 | XEMACS_MOD_BUTTON26);
> if ((modifiers & ~(XEMACS_MOD_CONTROL | XEMACS_MOD_META | XEMACS_MOD_SUPER
> | XEMACS_MOD_HYPER | XEMACS_MOD_ALT | XEMACS_MOD_SHIFT))
> != 0)
> @@ -649,7 +685,14 @@
> Lisp_Keymap *k = XKEYMAP (keymap);
>
> modifiers &= ~(XEMACS_MOD_BUTTON1 | XEMACS_MOD_BUTTON2 | XEMACS_MOD_BUTTON3
> - | XEMACS_MOD_BUTTON4 | XEMACS_MOD_BUTTON5);
> + | XEMACS_MOD_BUTTON4 | XEMACS_MOD_BUTTON5 | XEMACS_MOD_BUTTON6
> + | XEMACS_MOD_BUTTON7 | XEMACS_MOD_BUTTON8 | XEMACS_MOD_BUTTON9
> + | XEMACS_MOD_BUTTON10 | XEMACS_MOD_BUTTON11 | XEMACS_MOD_BUTTON12
> + | XEMACS_MOD_BUTTON13 | XEMACS_MOD_BUTTON14 | XEMACS_MOD_BUTTON15
> + | XEMACS_MOD_BUTTON16 | XEMACS_MOD_BUTTON17 | XEMACS_MOD_BUTTON18
> + | XEMACS_MOD_BUTTON19 | XEMACS_MOD_BUTTON20 | XEMACS_MOD_BUTTON21
> + | XEMACS_MOD_BUTTON22 | XEMACS_MOD_BUTTON23 | XEMACS_MOD_BUTTON24
> + | XEMACS_MOD_BUTTON25 | XEMACS_MOD_BUTTON26);
> assert ((modifiers & ~(XEMACS_MOD_CONTROL | XEMACS_MOD_META
> | XEMACS_MOD_SUPER | XEMACS_MOD_HYPER
> | XEMACS_MOD_ALT | XEMACS_MOD_SHIFT)) == 0);
> @@ -1363,7 +1406,7 @@
> *keysym = QKbackspace;
> /* Emacs compatibility */
> else if (EQ(*keysym, Qdown_mouse_1))
> - *keysym = Qbutton1;
> + *keysym = Qbutton1;
> else if (EQ(*keysym, Qdown_mouse_2))
> *keysym = Qbutton2;
> else if (EQ(*keysym, Qdown_mouse_3))
> @@ -1376,6 +1419,44 @@
> *keysym = Qbutton6;
> else if (EQ(*keysym, Qdown_mouse_7))
> *keysym = Qbutton7;
> + else if (EQ(*keysym, Qdown_mouse_8))
> + *keysym = Qbutton8;
> + else if (EQ(*keysym, Qdown_mouse_9))
> + *keysym = Qbutton9;
> + else if (EQ(*keysym, Qdown_mouse_10))
> + *keysym = Qbutton10;
> + else if (EQ(*keysym, Qdown_mouse_11))
> + *keysym = Qbutton11;
> + else if (EQ(*keysym, Qdown_mouse_12))
> + *keysym = Qbutton12;
> + else if (EQ(*keysym, Qdown_mouse_13))
> + *keysym = Qbutton13;
> + else if (EQ(*keysym, Qdown_mouse_14))
> + *keysym = Qbutton14;
> + else if (EQ(*keysym, Qdown_mouse_15))
> + *keysym = Qbutton15;
> + else if (EQ(*keysym, Qdown_mouse_16))
> + *keysym = Qbutton16;
> + else if (EQ(*keysym, Qdown_mouse_17))
> + *keysym = Qbutton17;
> + else if (EQ(*keysym, Qdown_mouse_18))
> + *keysym = Qbutton18;
> + else if (EQ(*keysym, Qdown_mouse_19))
> + *keysym = Qbutton19;
> + else if (EQ(*keysym, Qdown_mouse_20))
> + *keysym = Qbutton20;
> + else if (EQ(*keysym, Qdown_mouse_21))
> + *keysym = Qbutton21;
> + else if (EQ(*keysym, Qdown_mouse_22))
> + *keysym = Qbutton22;
> + else if (EQ(*keysym, Qdown_mouse_23))
> + *keysym = Qbutton23;
> + else if (EQ(*keysym, Qdown_mouse_24))
> + *keysym = Qbutton24;
> + else if (EQ(*keysym, Qdown_mouse_25))
> + *keysym = Qbutton25;
> + else if (EQ(*keysym, Qdown_mouse_26))
> + *keysym = Qbutton26;
> else if (EQ(*keysym, Qmouse_1))
> *keysym = Qbutton1up;
> else if (EQ(*keysym, Qmouse_2))
> @@ -1390,6 +1471,44 @@
> *keysym = Qbutton6up;
> else if (EQ(*keysym, Qmouse_7))
> *keysym = Qbutton7up;
> + else if (EQ(*keysym, Qmouse_8))
> + *keysym = Qbutton8up;
> + else if (EQ(*keysym, Qmouse_9))
> + *keysym = Qbutton9up;
> + else if (EQ(*keysym, Qmouse_10))
> + *keysym = Qbutton10up;
> + else if (EQ(*keysym, Qmouse_11))
> + *keysym = Qbutton11up;
> + else if (EQ(*keysym, Qmouse_12))
> + *keysym = Qbutton12up;
> + else if (EQ(*keysym, Qmouse_13))
> + *keysym = Qbutton13up;
> + else if (EQ(*keysym, Qmouse_14))
> + *keysym = Qbutton14up;
> + else if (EQ(*keysym, Qmouse_15))
> + *keysym = Qbutton15up;
> + else if (EQ(*keysym, Qmouse_16))
> + *keysym = Qbutton16up;
> + else if (EQ(*keysym, Qmouse_17))
> + *keysym = Qbutton17up;
> + else if (EQ(*keysym, Qmouse_18))
> + *keysym = Qbutton18up;
> + else if (EQ(*keysym, Qmouse_19))
> + *keysym = Qbutton19up;
> + else if (EQ(*keysym, Qmouse_20))
> + *keysym = Qbutton20up;
> + else if (EQ(*keysym, Qmouse_21))
> + *keysym = Qbutton21up;
> + else if (EQ(*keysym, Qmouse_22))
> + *keysym = Qbutton22up;
> + else if (EQ(*keysym, Qmouse_23))
> + *keysym = Qbutton23up;
> + else if (EQ(*keysym, Qmouse_24))
> + *keysym = Qbutton24up;
> + else if (EQ(*keysym, Qmouse_25))
> + *keysym = Qbutton25up;
> + else if (EQ(*keysym, Qmouse_26))
> + *keysym = Qbutton26up;
> }
> }
>
> @@ -1453,6 +1572,63 @@
> case 7:
> SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton7 : Qbutton7up));
> break;
> + case 8:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton8 : Qbutton8up));
> + break;
> + case 9:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton9 : Qbutton9up));
> + break;
> + case 10:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton10 : Qbutton10up));
> + break;
> + case 11:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton11 : Qbutton11up));
> + break;
> + case 12:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton12 : Qbutton12up));
> + break;
> + case 13:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton13 : Qbutton13up));
> + break;
> + case 14:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton14 : Qbutton14up));
> + break;
> + case 15:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton15 : Qbutton15up));
> + break;
> + case 16:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton16 : Qbutton16up));
> + break;
> + case 17:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton17 : Qbutton17up));
> + break;
> + case 18:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton18 : Qbutton18up));
> + break;
> + case 19:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton19 : Qbutton19up));
> + break;
> + case 20:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton20 : Qbutton20up));
> + break;
> + case 21:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton21 : Qbutton21up));
> + break;
> + case 22:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton22 : Qbutton22up));
> + break;
> + case 23:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton23 : Qbutton23up));
> + break;
> + case 24:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton24 : Qbutton24up));
> + break;
> + case 25:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton25 : Qbutton25up));
> + break;
> + case 26:
> + SET_KEY_DATA_KEYSYM(returned_value, (down ? Qbutton26 : Qbutton26up));
> + break;
> default:
> SET_KEY_DATA_KEYSYM (returned_value, (down ? Qbutton0 : Qbutton0up));
> break;
> @@ -1552,7 +1728,26 @@
> EQ (raw_key.keysym, Qbutton4) || EQ (raw_key.keysym, Qbutton4up) ||
> EQ (raw_key.keysym, Qbutton5) || EQ (raw_key.keysym, Qbutton5up) ||
> EQ (raw_key.keysym, Qbutton6) || EQ (raw_key.keysym, Qbutton6up) ||
> - EQ (raw_key.keysym, Qbutton7) || EQ (raw_key.keysym, Qbutton7up))
> + EQ (raw_key.keysym, Qbutton7) || EQ (raw_key.keysym, Qbutton7up) ||
> + EQ (raw_key.keysym, Qbutton8) || EQ (raw_key.keysym, Qbutton8up) ||
> + EQ (raw_key.keysym, Qbutton9) || EQ (raw_key.keysym, Qbutton9up) ||
> + EQ (raw_key.keysym, Qbutton10) || EQ (raw_key.keysym, Qbutton10up) ||
> + EQ (raw_key.keysym, Qbutton11) || EQ (raw_key.keysym, Qbutton11up) ||
> + EQ (raw_key.keysym, Qbutton12) || EQ (raw_key.keysym, Qbutton12up) ||
> + EQ (raw_key.keysym, Qbutton13) || EQ (raw_key.keysym, Qbutton13up) ||
> + EQ (raw_key.keysym, Qbutton14) || EQ (raw_key.keysym, Qbutton14up) ||
> + EQ (raw_key.keysym, Qbutton15) || EQ (raw_key.keysym, Qbutton15up) ||
> + EQ (raw_key.keysym, Qbutton16) || EQ (raw_key.keysym, Qbutton16up) ||
> + EQ (raw_key.keysym, Qbutton17) || EQ (raw_key.keysym, Qbutton17up) ||
> + EQ (raw_key.keysym, Qbutton18) || EQ (raw_key.keysym, Qbutton18up) ||
> + EQ (raw_key.keysym, Qbutton19) || EQ (raw_key.keysym, Qbutton19up) ||
> + EQ (raw_key.keysym, Qbutton20) || EQ (raw_key.keysym, Qbutton20up) ||
> + EQ (raw_key.keysym, Qbutton21) || EQ (raw_key.keysym, Qbutton21up) ||
> + EQ (raw_key.keysym, Qbutton22) || EQ (raw_key.keysym, Qbutton22up) ||
> + EQ (raw_key.keysym, Qbutton23) || EQ (raw_key.keysym, Qbutton23up) ||
> + EQ (raw_key.keysym, Qbutton24) || EQ (raw_key.keysym, Qbutton24up) ||
> + EQ (raw_key.keysym, Qbutton25) || EQ (raw_key.keysym, Qbutton25up) ||
> + EQ (raw_key.keysym, Qbutton26) || EQ (raw_key.keysym, Qbutton26up))
> invalid_operation ("Mouse-clicks can't appear in saved keyboard macros",
> Qunbound);
>
> @@ -4063,14 +4258,52 @@
> EQ (keysym, Qbutton5) ||
> EQ (keysym, Qbutton6) ||
> EQ (keysym, Qbutton7) ||
> + EQ (keysym, Qbutton8) ||
> + EQ (keysym, Qbutton9) ||
> + EQ (keysym, Qbutton10) ||
> + EQ (keysym, Qbutton11) ||
> + EQ (keysym, Qbutton12) ||
> + EQ (keysym, Qbutton13) ||
> + EQ (keysym, Qbutton14) ||
> + EQ (keysym, Qbutton15) ||
> + EQ (keysym, Qbutton16) ||
> + EQ (keysym, Qbutton17) ||
> + EQ (keysym, Qbutton18) ||
> + EQ (keysym, Qbutton19) ||
> + EQ (keysym, Qbutton20) ||
> + EQ (keysym, Qbutton21) ||
> + EQ (keysym, Qbutton22) ||
> + EQ (keysym, Qbutton23) ||
> + EQ (keysym, Qbutton24) ||
> + EQ (keysym, Qbutton25) ||
> + EQ (keysym, Qbutton26) ||
> EQ (keysym, Qbutton0up) ||
> EQ (keysym, Qbutton1up) ||
> EQ (keysym, Qbutton2up) ||
> EQ (keysym, Qbutton3up) ||
> EQ (keysym, Qbutton4up) ||
> EQ (keysym, Qbutton5up) ||
> - EQ (keysym, Qbutton6up) ||
> - EQ (keysym, Qbutton7up))))
> + EQ (keysym, Qbutton6up) ||
> + EQ (keysym, Qbutton7up) ||
> + EQ (keysym, Qbutton8up) ||
> + EQ (keysym, Qbutton9up) ||
> + EQ (keysym, Qbutton10up) ||
> + EQ (keysym, Qbutton11up) ||
> + EQ (keysym, Qbutton12up) ||
> + EQ (keysym, Qbutton13up) ||
> + EQ (keysym, Qbutton14up) ||
> + EQ (keysym, Qbutton15up) ||
> + EQ (keysym, Qbutton16up) ||
> + EQ (keysym, Qbutton17up) ||
> + EQ (keysym, Qbutton18up) ||
> + EQ (keysym, Qbutton19up) ||
> + EQ (keysym, Qbutton20up) ||
> + EQ (keysym, Qbutton21up) ||
> + EQ (keysym, Qbutton22up) ||
> + EQ (keysym, Qbutton23up) ||
> + EQ (keysym, Qbutton24up) ||
> + EQ (keysym, Qbutton25up) ||
> + EQ (keysym, Qbutton26up))))
> return;
>
> /* If this command in this map is shadowed by some other map, ignore it. */
> @@ -4382,6 +4615,25 @@
> DEFSYMBOL (Qbutton5);
> DEFSYMBOL (Qbutton6);
> DEFSYMBOL (Qbutton7);
> + DEFSYMBOL (Qbutton8);
> + DEFSYMBOL (Qbutton9);
> + DEFSYMBOL (Qbutton10);
> + DEFSYMBOL (Qbutton11);
> + DEFSYMBOL (Qbutton12);
> + DEFSYMBOL (Qbutton13);
> + DEFSYMBOL (Qbutton14);
> + DEFSYMBOL (Qbutton15);
> + DEFSYMBOL (Qbutton16);
> + DEFSYMBOL (Qbutton17);
> + DEFSYMBOL (Qbutton18);
> + DEFSYMBOL (Qbutton19);
> + DEFSYMBOL (Qbutton20);
> + DEFSYMBOL (Qbutton21);
> + DEFSYMBOL (Qbutton22);
> + DEFSYMBOL (Qbutton23);
> + DEFSYMBOL (Qbutton24);
> + DEFSYMBOL (Qbutton25);
> + DEFSYMBOL (Qbutton26);
> DEFSYMBOL (Qbutton0up);
> DEFSYMBOL (Qbutton1up);
> DEFSYMBOL (Qbutton2up);
> @@ -4390,6 +4642,25 @@
> DEFSYMBOL (Qbutton5up);
> DEFSYMBOL (Qbutton6up);
> DEFSYMBOL (Qbutton7up);
> + DEFSYMBOL (Qbutton8up);
> + DEFSYMBOL (Qbutton9up);
> + DEFSYMBOL (Qbutton10up);
> + DEFSYMBOL (Qbutton11up);
> + DEFSYMBOL (Qbutton12up);
> + DEFSYMBOL (Qbutton13up);
> + DEFSYMBOL (Qbutton14up);
> + DEFSYMBOL (Qbutton15up);
> + DEFSYMBOL (Qbutton16up);
> + DEFSYMBOL (Qbutton17up);
> + DEFSYMBOL (Qbutton18up);
> + DEFSYMBOL (Qbutton19up);
> + DEFSYMBOL (Qbutton20up);
> + DEFSYMBOL (Qbutton21up);
> + DEFSYMBOL (Qbutton22up);
> + DEFSYMBOL (Qbutton23up);
> + DEFSYMBOL (Qbutton24up);
> + DEFSYMBOL (Qbutton25up);
> + DEFSYMBOL (Qbutton26up);
> DEFSYMBOL (Qmouse_1);
> DEFSYMBOL (Qmouse_2);
> DEFSYMBOL (Qmouse_3);
> @@ -4397,6 +4668,25 @@
> DEFSYMBOL (Qmouse_5);
> DEFSYMBOL (Qmouse_6);
> DEFSYMBOL (Qmouse_7);
> + DEFSYMBOL (Qmouse_8);
> + DEFSYMBOL (Qmouse_9);
> + DEFSYMBOL (Qmouse_10);
> + DEFSYMBOL (Qmouse_11);
> + DEFSYMBOL (Qmouse_12);
> + DEFSYMBOL (Qmouse_13);
> + DEFSYMBOL (Qmouse_14);
> + DEFSYMBOL (Qmouse_15);
> + DEFSYMBOL (Qmouse_16);
> + DEFSYMBOL (Qmouse_17);
> + DEFSYMBOL (Qmouse_18);
> + DEFSYMBOL (Qmouse_19);
> + DEFSYMBOL (Qmouse_20);
> + DEFSYMBOL (Qmouse_21);
> + DEFSYMBOL (Qmouse_22);
> + DEFSYMBOL (Qmouse_23);
> + DEFSYMBOL (Qmouse_24);
> + DEFSYMBOL (Qmouse_25);
> + DEFSYMBOL (Qmouse_26);
> DEFSYMBOL (Qdown_mouse_1);
> DEFSYMBOL (Qdown_mouse_2);
> DEFSYMBOL (Qdown_mouse_3);
> @@ -4404,6 +4694,25 @@
> DEFSYMBOL (Qdown_mouse_5);
> DEFSYMBOL (Qdown_mouse_6);
> DEFSYMBOL (Qdown_mouse_7);
> + DEFSYMBOL (Qdown_mouse_8);
> + DEFSYMBOL (Qdown_mouse_9);
> + DEFSYMBOL (Qdown_mouse_10);
> + DEFSYMBOL (Qdown_mouse_11);
> + DEFSYMBOL (Qdown_mouse_12);
> + DEFSYMBOL (Qdown_mouse_13);
> + DEFSYMBOL (Qdown_mouse_14);
> + DEFSYMBOL (Qdown_mouse_15);
> + DEFSYMBOL (Qdown_mouse_16);
> + DEFSYMBOL (Qdown_mouse_17);
> + DEFSYMBOL (Qdown_mouse_18);
> + DEFSYMBOL (Qdown_mouse_19);
> + DEFSYMBOL (Qdown_mouse_20);
> + DEFSYMBOL (Qdown_mouse_21);
> + DEFSYMBOL (Qdown_mouse_22);
> + DEFSYMBOL (Qdown_mouse_23);
> + DEFSYMBOL (Qdown_mouse_24);
> + DEFSYMBOL (Qdown_mouse_25);
> + DEFSYMBOL (Qdown_mouse_26);
> DEFSYMBOL (Qmenu_selection);
> DEFSYMBOL (QLFD);
> DEFSYMBOL (QTAB);
> Index: src/keymap.h
> ===================================================================
> RCS file: /pack/xemacscvs/XEmacs/xemacs/src/keymap.h,v
> retrieving revision 1.9
> diff -u -r1.9 keymap.h
> --- src/keymap.h 2003/01/12 11:08:18 1.9
> +++ src/keymap.h 2007/11/10 23:27:01
> @@ -40,6 +40,11 @@
>
> extern Lisp_Object Qalt, Qcontrol, Qhyper, Qmeta, Qshift, Qsuper;
> extern Lisp_Object Qbutton1, Qbutton2, Qbutton3, Qbutton4, Qbutton5;
> +extern Lisp_Object Qbutton6, Qbutton7, Qbutton8, Qbutton9, Qbutton10;
> +extern Lisp_Object Qbutton11, Qbutton12, Qbutton13, Qbutton14, Qbutton15;
> +extern Lisp_Object Qbutton16, Qbutton17, Qbutton18, Qbutton19, Qbutton20;
> +extern Lisp_Object Qbutton21, Qbutton22, Qbutton23, Qbutton24, Qbutton25;
> +extern Lisp_Object Qbutton26;
> extern Lisp_Object Vmeta_prefix_char;
>
> Lisp_Object get_keymap (Lisp_Object object, int errorp, int autoload);
>
> Yours
> --
> %% Mats
--
¿Dónde estará ahora mi sobrino Yoghurtu Nghé, que tuvo que huir
precipitadamente de la aldea por culpo de la escasez de rinocerontes?
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[C] Dired 7.14
17 years, 1 month
Michael Sperber
I've just committed Dired 7.14 to the packages repo. It doesn't have
everything still in the queue, but hopefully it's at least progress.
--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[PATCH] Update main page with 21.4.21 release
17 years, 1 month
Vin Shelton
ChangeLog addition:
2007-11-10 Vin Shelton <acs(a)xemacs.org>
* index.content: Latest stable release is 21.4.21.
web source patch:
Diff command: cvs -q diff -u
Files affected: index.content
Index: index.content
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacsweb/index.content,v
retrieving revision 1.183
diff -a -u -u -r1.183 index.content
--- index.content 2007/10/22 23:05:20 1.183
+++ index.content 2007/11/10 20:17:15
@@ -80,7 +80,7 @@
<dl>
<!-- one of (dd dt) -->
<dt><strong><a href="<!-- _GP_ relPath(qq{Releases/index.html#Stable}) -->">Stable</a> branch:</strong></dt>
- <dd><a href="Releases/21.4.20.html">21.4.20</a></dd>
+ <dd><a href="Releases/21.4.21.html">21.4.21</a></dd>
<dt><strong><a href="<!-- _GP_ relPath(qq{Releases/index.html#Beta}) -->">Beta</a> branch:</strong></dt>
<dd><a href="Releases/21.5.28.html">21.5.28</a></dd>
</dl>
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches