[xemacs-base] Fix infloop in comint-quote-filename
17 years, 7 months
Stephen J. Turnbull
xemacs-base
"Some people, when confronted with a problem, think 'I know, I'll use
regular expressions.' Now they have two problems."
This patch eliminates one of the problems, and I hope it addresses the
second as well. It seems to work in light standalone testing, but I
haven't used it in place much yet.
The original code often infloops if the original string contains a
backslash on Unix (since many modes bind comint-file-name-quote-list
to a list containing backslash).
The code I propose assumes that what is passed to it is a raw string,
in the sense that any backslashes are intended to be part of the name.
I think that's what is intended. It's one-pass by definition, so
can't infloop.
ChangeLog addition:
2007-02-28 Stephen J. Turnbull <stephen(a)xemacs.org>
* comint.el (comint-quote-filename): Fix infloop.
xemacs-base source patch:
Diff command: cvs -q diff -u
Files affected: comint.el
Index: comint.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/xemacs-base/comint.el,v
retrieving revision 1.19
diff -u -u -r1.19 comint.el
--- comint.el 31 Jul 2006 17:08:44 -0000 1.19
+++ comint.el 28 Feb 2007 04:13:44 -0000
@@ -2811,13 +2811,10 @@
Magic characters are those in `comint-file-name-quote-list'."
(if (null comint-file-name-quote-list)
filename
- (let ((regexp
- (format "\\(^\\|[^\\]\\)\\([%s]\\)"
- (mapconcat 'char-to-string comint-file-name-quote-list ""))))
- (save-match-data
- (while (string-match regexp filename)
- (setq filename (replace-match "\\1\\\\\\2" nil nil filename)))
- filename))))
+ (mapconcat (lambda (x)
+ (concat (if (memq x comint-file-name-quote-list) "\\" "")
+ (char-to-string x)))
+ filename)))
(defun comint-unquote-filename (filename)
"Return FILENAME with quoted characters unquoted."
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[xemacs-base] Fix infloop in comint-quote-filename
17 years, 7 months
Stephen J. Turnbull
xemacs-base
"Some people, when confronted with a problem, think 'I know, I'll use
regular expressions.' Now they have two problems."
This patch eliminates one of the problems, and I hope it addresses the
second as well. It seems to work in light standalone testing, but I
haven't used it in place much yet.
The original code often infloops if the original string contains a
backslash on Unix (since many modes bind comint-file-name-quote-list
to a list containing backslash).
The code I propose assumes that what is passed to it is a raw string,
in the sense that any backslashes are intended to be part of the name.
I think that's what is intended. It's one-pass by definition, so
can't infloop.
ChangeLog addition:
2007-02-28 Stephen J. Turnbull <stephen(a)xemacs.org>
* comint.el (comint-quote-filename): Fix infloop.
xemacs-base source patch:
Diff command: cvs -q diff -u
Files affected: comint.el
Index: comint.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/xemacs-base/comint.el,v
retrieving revision 1.19
diff -u -u -r1.19 comint.el
--- comint.el 31 Jul 2006 17:08:44 -0000 1.19
+++ comint.el 28 Feb 2007 04:13:44 -0000
@@ -2811,13 +2811,10 @@
Magic characters are those in `comint-file-name-quote-list'."
(if (null comint-file-name-quote-list)
filename
- (let ((regexp
- (format "\\(^\\|[^\\]\\)\\([%s]\\)"
- (mapconcat 'char-to-string comint-file-name-quote-list ""))))
- (save-match-data
- (while (string-match regexp filename)
- (setq filename (replace-match "\\1\\\\\\2" nil nil filename)))
- filename))))
+ (mapconcat (lambda (x)
+ (concat (if (memq x comint-file-name-quote-list) "\\" "")
+ (char-to-string x)))
+ filename)))
(defun comint-unquote-filename (filename)
"Return FILENAME with quoted characters unquoted."
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[AC21.5 21.4?] Minor documentation fixes
17 years, 7 months
Stephen J. Turnbull
APPROVE COMMIT 21.5
Maybe relevant to 21.4? What do you think, Vin?
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d103655..da18c7a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -0,0 +1,8 @@
+2007-01-23 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * cus-face.el (custom-theme-reset-faces): Move code after docstring.
+
+2007-01-22 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * subr.el (lambda): Improve docstring.
+
diff --git a/src/ChangeLog b/src/ChangeLog
index 5a333f7..88522c9 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -0,0 +1,7 @@
+2007-01-22 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * eval.c (quote):
+ (function):
+ * fns.c (Frequire):
+ Improve docstrings.
+
diff --git a/lisp/cus-face.el b/lisp/cus-face.el
index b4a0ecc..a2a9a9c 100644
--- a/lisp/cus-face.el
+++ b/lisp/cus-face.el
@@ -359,7 +359,6 @@ FACE. Nil otherwise."
;;;###autoload
(defun custom-theme-reset-faces (theme &rest args)
- (custom-check-theme theme)
"Reset the value of the face to values previously defined.
Associate this setting with THEME.
@@ -368,6 +367,7 @@ ARGS is a list of lists of the form
(face to-theme)
This means reset face to its value in to-theme."
+ (custom-check-theme theme)
(mapc #'(lambda (arg)
(apply #'custom-theme-reset-internal-face arg)
(custom-push-theme (car arg) 'theme-face theme 'reset (cadr arg)))
diff --git a/lisp/subr.el b/lisp/subr.el
index 89061ed..8e00fba 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -79,12 +79,24 @@ function, i.e., stored as the function value of a symbol, passed to
funcall or mapcar, etc.
ARGS should take the same form as an argument list for a `defun'.
-DOCSTRING is an optional documentation string.
- If present, it should describe how to call the function.
- But documentation strings are usually not useful in nameless functions.
-INTERACTIVE should be a call to the function `interactive', which see.
-It may also be omitted.
-BODY should be a list of lisp expressions."
+Optional DOCSTRING is a documentation string.
+If present, it should describe how to call the function. Docstrings are
+rarely useful unless the lambda will be named, eg, using `fset'.
+Optional INTERACTIVE should be a call to the function `interactive'.
+BODY should be a list of lisp expressions.
+
+The byte-compiler treats lambda expressions specially. If the lambda
+expression is syntactically a function to be called, it will be compiled
+unless protected by `quote'. Conversely, quoting a lambda expression with
+`function' hints to the byte-compiler that it should compile the expression.
+\(The byte-compiler may or may not actually compile it; for example it will
+never compile lambdas nested in a data structure: `'(#'(lambda (x) x))').
+
+The byte-compiler will warn about common problems such as the form
+`(fset 'f '(lambda (x) x))' (the lambda cannot be byte-compiled; probably
+the programmer intended `#'', although leaving the lambda unquoted will
+normally suffice), but in general is it the programmer's responsibility to
+quote lambda expressions appropriately."
`(function (lambda ,@cdr)))
;; FSF 21.2 has various basic macros here. We don't because they're either
diff --git a/src/eval.c b/src/eval.c
index fa182c1..500c771 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1178,14 +1178,16 @@ The return value of the `setq' form is the value of the last VAL.
DEFUN ("quote", Fquote, 1, UNEVALLED, 0, /*
Return the argument, without evaluating it. `(quote x)' yields `x'.
-There is an alternative and more used reader syntax for `quote'. Precede
-any Lisp object with a single apostrophe, and that Lisp object will be
-returned unevaluated. 'x is thus equivalent to (quote x).
-
-Do not use `quote' or the single apostrophe for lambda expressions that you
-would prefer to be byte-compiled. Use `function', which see, or take
-advantage of the fact that lambda expressions are self-quoting and such
-lambda expressions will be automatically byte-compiled.
+`quote' differs from `function' in that it is a hint that an expression is
+data, not a function. In particular, under some circumstances the byte
+compiler will compile an expression quoted with `function', but it will
+never do so for an expression quoted with `quote'. These issues are most
+important for lambda expressions (see `lambda').
+
+There is an alternative, more readable, reader syntax for `quote': a Lisp
+object preceded by `''. Thus, `'x' is equivalent to `(quote x)', in all
+contexts. A print function may use either. Internally the expression is
+represented as `(quote x)').
*/
(args))
{
@@ -1193,17 +1195,20 @@ lambda expressions will be automatically byte-compiled.
}
DEFUN ("function", Ffunction, 1, UNEVALLED, 0, /*
-Like `quote', but preferred for objects which are functions.
-
-As with `quote' there is an alternative reader syntax for `function' which
-in practice is used more often. Writing #'OBJECT is equivalent to writing
-\(function OBJECT), where OBJECT is some Lisp object.
-
-In byte compilation, `function' causes a lambda expression argument to be
-compiled. `quote' cannot do that. lambda expressions are, however,
-self-quoting, and self-quoted lambda expressions will be byte-compiled.
-Only lambda expressions explicitly quoted with `quote' or that occur in
-nested data lists will not be byte-compiled.
+Return the argument, without evaluating it. `(function x)' yields `x'.
+
+`function' differs from `quote' in that it is a hint that an expression is
+a function, not data. In particular, under some circumstances the byte
+compiler will compile an expression quoted with `function', but it will
+never do so for an expression quoted with `quote'. However, the byte
+compiler will not compile an expression buried in a data structure such as
+a vector or a list which is not syntactically a function. These issues are
+most important for lambda expressions (see `lambda').
+
+There is an alternative, more readable, reader syntax for `function': a Lisp
+object preceded by `#''. Thus, #'x is equivalent to (function x), in all
+contexts. A print function may use either. Internally the expression is
+represented as `(function x)').
*/
(args))
{
diff --git a/src/fns.c b/src/fns.c
index 16852e3..bf85bbd 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -3576,19 +3576,26 @@ This function updates the value of the variable `features'.
}
DEFUN ("require", Frequire, 1, 3, 0, /*
-If feature FEATURE is not loaded, load it from FILENAME.
-If FEATURE is not a member of the list `features', then the feature
-is not loaded; so load the file FILENAME.
-If FILENAME is omitted, the printname of FEATURE is used as the file name.
-If optional third argument NOERROR is non-nil, then return nil if the file
-is not found instead of signaling an error.
-Normally the return value is FEATURE.
-The normal messages at start and end of loading FILENAME are suppressed.
-
-In order to make it possible for a required package to provide macros to be
-expanded at byte-compilation time, top level calls of `require' are
-evaluated both at byte-compile time and at run time. That is, any top-level
-call to `require' is wrapped in an implicit \(eval-and-compile ...\) block.
+Ensure that FEATURE is present in the Lisp environment.
+FEATURE is a symbol naming a collection of resources (functions, etc).
+Optional FILENAME is a library from which to load resources; it defaults to
+the print name of FEATURE.
+Optional NOERROR, if non-nil, causes require to return nil rather than signal
+`file-error' if loading the library fails.
+
+If feature FEATURE is present in `features', update `load-history' to reflect
+the require and return FEATURE. Otherwise, try to load it from a library.
+The normal messages at start and end of loading are suppressed.
+If the library is successfully loaded and it calls `(provide FEATURE)', add
+FEATURE to `features', update `load-history' and return FEATURE.
+If the load succeeds but FEATURE is not provided by the library, signal
+`invalid-state'.
+
+The byte-compiler treats top-level calls to `require' specially, by evaluating
+them at compile time (and then compiling them normally). Thus a library may
+request that definitions that should be inlined such as macros and defsubsts
+be loaded into its compilation environment. Achieving this in other contexts
+requires an explicit \(eval-and-compile ...\) block.
*/
(feature, filename, noerror))
{
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[AC21.5] Warning fixes
17 years, 7 months
Stephen J. Turnbull
APPROVE COMMIT 21.5
The FC_WIDTH patch actually prevents an error if you're not using the
compatibility option for fontconfig/Xft. I think the default changed
fairly recently.
The others are minor warning things.
diff --git a/src/ChangeLog b/src/ChangeLog
index 6900d60..5a333f7 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -0,0 +1,11 @@
+2007-02-21 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * objects-tty.c (tty_font_spec_matches_charset): Use Aidan's enum.
+
+ * objects-xlike-inc.c (xft_find_charset_font): FC_WIDTH is obsolete
+ and may be undefined.
+
+ * sysdll.c (image_for_address): const cleanliness for Darwin.
+
+ * fileio.c (Finsert_file_contents_internal): Remove unused gcpro5.
+
diff --git a/src/fileio.c b/src/fileio.c
index 1732604..b9dd6e2 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2885,7 +2885,7 @@ under Mule, is very difficult.)
int saverrno = 0;
Charcount inserted = 0;
int speccount;
- struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
+ struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
Lisp_Object val;
int total;
Ibyte read_buf[READ_BUF_SIZE];
diff --git a/src/objects-tty.c b/src/objects-tty.c
index bdadfde..caed6f6 100644
--- a/src/objects-tty.c
+++ b/src/objects-tty.c
@@ -339,7 +339,7 @@ static int
tty_font_spec_matches_charset (struct device *UNUSED (d), Lisp_Object charset,
const Ibyte *nonreloc, Lisp_Object reloc,
Bytecount offset, Bytecount length,
- int stage)
+ enum font_specifier_matchspec_stages stage)
{
const Ibyte *the_nonreloc = nonreloc;
diff --git a/src/objects-xlike-inc.c b/src/objects-xlike-inc.c
index a162579..68c4d0c 100644
--- a/src/objects-xlike-inc.c
+++ b/src/objects-xlike-inc.c
@@ -465,7 +465,9 @@ xft_find_charset_font (Lisp_Object font, Lisp_Object charset,
of rarely useful properties */
FcPatternDel (p, FC_CHARSET);
FcPatternDel (p, FC_LANG);
+#ifdef FC_WIDTH
FcPatternDel (p, FC_WIDTH);
+#endif
FcPatternDel (p, FC_SPACING);
FcPatternDel (p, FC_HINTING);
FcPatternDel (p, FC_VERTICAL_LAYOUT);
diff --git a/src/sysdll.c b/src/sysdll.c
index 5b0d566..1ee987c 100644
--- a/src/sysdll.c
+++ b/src/sysdll.c
@@ -267,12 +267,12 @@ dll_close (dll_handle h)
* (http://www.opendarwin.org/projects/dlcompat).
*/
-static struct mach_header*
+static const struct mach_header*
image_for_address(void *address)
{
unsigned long i;
unsigned long count = _dyld_image_count();
- struct mach_header *mh = 0;
+ const struct mach_header *mh = 0;
for (i = 0; i < count; i++)
{
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[haskell-mode] Work around coding cookie breakage
17 years, 7 months
Stephen J. Turnbull
haskell-mode
haskell-mode.el contains a Mule-only feature (a coding cookie as a
file-local variable). This patch removes that coding cookie, making
it possible to build haskell-mode under no-Mule XEmacs 21.5. The
alternative is to move haskell-mode to mule-packages, which is stupid.
(True, no-Mule 21.5 should not crash here, but that's not the point;
even if it didn't, it still couldn't do anything sensible with a
coding cookie, so having a cookie is a bug outside of mule-packages.
<RANT>Actually, IMHO, having a cookie is a bug, period....</RANT>)
>From the point of view of many users of non-Western-European 8-bit
coding-systems under Mule, the package will actually work better this
way, as their favorite coding system suddenly will acquire a
more-or-less sane syntax table. Another way to put this is that
haskell-mode is currently broken under all non-ISO-8859-1 locales, and
this makes it a little better. :-)
My apologies to Mats for taking so long to diagnose this. With this
change, we should be able to reenable the 21.5-nomule smoke test.
Jerry, do you have any objections?
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/haskell-mode/ChangeLog,v
retrieving revision 1.27
diff -u -r1.27 ChangeLog
--- ChangeLog 25 May 2006 08:41:46 -0000 1.27
+++ ChangeLog 20 Feb 2007 15:44:48 -0000
@@ -0,0 +1,4 @@
+2007-02-21 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * haskell-mode.el: Non-MULE doesn't support iso-8859-1 cookie.
+
Index: haskell-mode.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/haskell-mode/haskell-mode.el,v
retrieving revision 1.7
diff -u -r1.7 haskell-mode.el
--- haskell-mode.el 15 Mar 2006 05:18:23 -0000 1.7
+++ haskell-mode.el 20 Feb 2007 15:44:48 -0000
@@ -1,4 +1,4 @@
-;;; haskell-mode.el --- A Haskell editing mode -*-coding: iso-8859-1;-*-
+;;; haskell-mode.el --- A Haskell editing mode
;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc
;; Copyright (C) 1992, 1997-1998 Simon Marlow, Graeme E Moss, and Tommy Thorn
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[AC21.5] Fix crash in device-matching-specifier-tag-list
17 years, 7 months
Stephen J. Turnbull
APPROVE COMMIT 21.5
Not relevant to 21.4.
This was either introduced or unmasked by Aidan's 2007-02-06 patch to
specifier.c. The crash is reproducible and occurs as soon as VM tries
to create a new frame after M-x vm.
I don't know if these are exactly the desired semantics, but it's
pretty close. Since the function is only called by VM, it's hard to
test in context, but it works for me in VM and when called in an X11
frame or a TTY frame.
Index: src/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.1045
diff -u -r1.1045 ChangeLog
--- src/ChangeLog 17 Feb 2007 15:55:21 -0000 1.1045
+++ src/ChangeLog 19 Feb 2007 13:50:33 -0000
@@ -0,0 +1,8 @@
+2007-02-19 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * specifier.c (Fdevice_matching_specifier_tag_list):
+ Don't take XCDR of possible non-cons. Avoids crash in VM introduced
+ or unmasked by Aidan's 2007-02-06 patch.
+
+ (setup_device_initial_specifier_tags): Nuke unused variable.
+
Index: src/specifier.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/specifier.c,v
retrieving revision 1.52
diff -u -r1.52 specifier.c
--- src/specifier.c 6 Feb 2007 20:01:42 -0000 1.52
+++ src/specifier.c 19 Feb 2007 13:50:35 -0000
@@ -1293,7 +1293,7 @@
{
Lisp_Object rest, rest2;
Lisp_Object device = wrap_device (d);
- Lisp_Object device_predicate, charset_predicate;
+ Lisp_Object device_predicate;
int list_len;
DEVICE_USER_DEFINED_TAGS (d) = Fcopy_alist (Vuser_defined_tags);
@@ -1395,7 +1395,7 @@
LIST_LOOP (rest, DEVICE_USER_DEFINED_TAGS (d))
{
- if (!NILP (XCADR (XCAR (rest))))
+ if (!NILP (XCDR (XCAR (rest))))
list = Fcons (XCAR (XCAR (rest)), list);
}
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[AC21.5R21.4] Patch: fix cut & past problem on 64 bit platforms
17 years, 7 months
Stephen J. Turnbull
APPROVE COMMIT 21.5 RECOMMEND 21.4
Vin, I haven't actually checked, but the comments in these files smell
like they go back to maybe Jamie. ;-) 21.4 probably should get this
patch, too. It may not apply as is because it's got some of Ben's
newfangled naming in it.
Takashi Iwai writes:
> The last patch in the above is correct and doesn't lead to crashes.
OK.
> > (2) Now, this looks like a bug in the 64-bit X libraries to me. What
> > happens if it gets fixed?
>
> It's no implementation bug but a brain-dead API definition.
Oh, I think I can see why they did it. With any luck, your code will
work on 64-bit platforms running X11R4. (^^;
Here's the patch I'm putting into XEmacs. The bug report shows SuSE
has done extensive testing, and it clearly conforms to documentation.
I've verified that callers in XEmacs do indeed expect to receive
arrays of longs. The remaining question in my mind is whether this is
going to be right for older Xlibs on 64-bit platforms, but that's not
something that can be tested without access to implementations.
Mike & Takashi, I've taken the liberty of doing extensive revision to
the commentary, but the code is yours. I thought about fiddling with
some of the hard-coded assumptions, but really, we don't support
128-bit processors yet anyway, and it seems *really* unlikely that
there will ever again be a platform with anything but 8-bit chars and
16-bit shorts.
If you want any changes to the credits, let me know.
Index: src/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.1044
diff -u -U0 -r1.1044 ChangeLog
--- src/ChangeLog 15 Feb 2007 16:12:13 -0000 1.1044
+++ src/ChangeLog 17 Feb 2007 15:45:05 -0000
@@ -0,0 +1,13 @@
+2007-02-18 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ Code by Mike FABIAN <mfabian(a)suse.de>, Takashi Iwai <tiwai(a)suse.de>.
+ See xemacs-beta <s3thctmf46c.fsf(a)magellan.suse.de>. Thanks!
+ Documentation marshalled by me.
+
+ * select-x.c (x_get_window_property):
+ The buffer for property data in 32-bit format is an array of longs,
+ which need not be 32-bit. Compute residual from partial reads and
+ buffer sizes correctly for sizeof(long) == 8.
+
+ * select-common.h: Refer to documentation in select-x.c.
+
Index: src/select-common.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/select-common.h,v
retrieving revision 1.6
diff -u -r1.6 select-common.h
--- src/select-common.h 25 Oct 2005 11:16:27 -0000 1.6
+++ src/select-common.h 17 Feb 2007 15:45:11 -0000
@@ -47,6 +47,10 @@
if > 16 bits: Cons of top16, bot16
* 32 > 1 Vector of the above
+ NOTE NOTE NOTE:
+ Format == 32 means that the buffer will be C longs, which need not be
+ 32-bit quantities. See the note in select-x.c (x_get_window_property).
+
When converting a Lisp number to C, it is assumed to be of format 16 if
it is an integer, and of format 32 if it is a cons of two integers.
Index: src/select-x.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/select-x.c,v
retrieving revision 1.23
diff -u -r1.23 select-x.c
--- src/select-x.c 2 Mar 2005 18:31:57 -0000 1.23
+++ src/select-x.c 17 Feb 2007 15:45:12 -0000
@@ -1048,7 +1048,42 @@
return;
}
- total_size = bytes_remaining + 1;
+ /* The manpage for XGetWindowProperty from X.org X11.7.2 sez:
+ nitems_return [[ our actual_size_ret ]]
+ Returns the actual number of 8-bit, 16-bit, or 32-bit items
+ stored in the prop_return data.
+ prop_return [[ our tmp_data ]]
+ Returns the data in the specified format. If the returned
+ format is 8, the returned data is represented as a char
+ array. If the returned format is 16, the returned data is
+ represented as a array of short int type and should be cast
+ to that type to obtain the elements. If the returned format
+ is 32, the property data will be stored as an array of longs
+ (which in a 64-bit application will be 64-bit values that are
+ padded in the upper 4 bytes).
+ bytes_after_return [[ our bytes_remaining ]]
+ Returns the number of bytes remaining to be read in the prop-
+ erty if a partial read was performed.
+
+ AFAIK XEmacs does not support any platforms where the char type is other
+ than 8 bits (Cray?), or where the short type is other than 16 bits.
+ There is no such agreement on the size of long, and 64-bit platforms
+ generally make long be a 64-bit quantity while while it's 32 bits on
+ 32-bit platforms.
+
+ This means that on all platforms the wire item is the same size as our
+ buffer unit when format == 8 or format == 16 or format == wordsize == 32,
+ and the buffer size can be taken as bytes_remaining plus padding.
+ However, when format == 32 and wordsize == 64, the buffer unit is twice
+ the size of the wire item. Obviously this code below is not 128-bit
+ safe. (We could replace the factor 2 with (sizeof(long)*8/32.)
+
+ We can hope it doesn't much matter on versions of X11 earlier than R7.
+ */
+ if (sizeof(long) == 8 && *actual_format_ret == 32)
+ total_size = 2 * bytes_remaining + 1;
+ else
+ total_size = bytes_remaining + 1;
*data_ret = xnew_rawbytes (total_size);
/* Now read, until we've gotten it all. */
@@ -1072,7 +1107,12 @@
reading it. Deal with that, I guess....
*/
if (result != Success) break;
- *actual_size_ret *= *actual_format_ret / 8;
+ /* Again we need to compute the number of bytes in our buffer, not
+ the number of bytes transferred for the property. */
+ if (sizeof(long) == 8 && *actual_format_ret == 32)
+ *actual_size_ret *= 8;
+ else
+ *actual_size_ret *= *actual_format_ret / 8;
memcpy ((*data_ret) + offset, tmp_data, *actual_size_ret);
offset += *actual_size_ret;
XFree ((char *) tmp_data);
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[AC general-docs] Fix typos.
17 years, 7 months
Stephen J. Turnbull
APPROVE COMMIT general-docs
Sorry, didn't catch this with a build in a clean update because I
haven't committed the patch that includes xemacs-devguide in the build
yet!
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/general-docs/ChangeLog,v
retrieving revision 1.19
diff -u -r1.19 ChangeLog
--- ChangeLog 17 Feb 2007 12:19:09 -0000 1.19
+++ ChangeLog 18 Feb 2007 15:38:15 -0000
@@ -0,0 +1,6 @@
+2007-02-19 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * texi/xemacs/xemacs-devguide.texi (The Package Maintainer Role):
+ Fix missing link.
+ (Getting Started as a Package Maintainer): Restore missing @.
+
Index: texi/xemacs/xemacs-devguide.texi
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/general-docs/texi/xemacs/xemacs-devguide.texi,v
retrieving revision 1.4
diff -u -r1.4 xemacs-devguide.texi
--- texi/xemacs/xemacs-devguide.texi 17 Feb 2007 12:19:13 -0000 1.4
+++ texi/xemacs/xemacs-devguide.texi 18 Feb 2007 15:38:17 -0000
@@ -905,7 +905,7 @@
-@node The Package Maintainer Role, Advice to Package Maintainers, , XEmacs Package Maintainer
+@node The Package Maintainer Role, Getting Started as a Package Maintainer, , XEmacs Package Maintainer
@subsection The Package Maintainer Role
The @dfn{package maintainer} is basically a liaison between two
@@ -947,7 +947,7 @@
read-write mode. This is done as follows:
@example
-export CVSROOT=:ext:xemacs@cvs.xemacs.org:/pack/xemacscvs
+export CVSROOT=:ext:xemacs@@cvs.xemacs.org:/pack/xemacscvs
export CVS_RSH=/usr/bin/ssh
cvs checkout packages
@end example
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[AC general-docs] Have makeinfo build where XEmacs.rules does
17 years, 7 months
Stephen J. Turnbull
APPROVE COMMIT general-docs
Without this patch running makeinfo on these .texi files will by
default try to build them in the non-existent general-docs/info
directory. We may as well build them where XEmacs.rules does, in
general-docs/texi/xemacs.
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/general-docs/ChangeLog,v
retrieving revision 1.17
diff -u -r1.17 ChangeLog
--- ChangeLog 17 Feb 2007 11:43:56 -0000 1.17
+++ ChangeLog 17 Feb 2007 11:51:13 -0000
@@ -0 +1,6 @@
+2007-02-17 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * texi/xemacs/fontconfig.texi (@setfilename):
+ * texi/xemacs/xemacs-devguide.texi (@setfilename):
+ Have makeinfo build in this directory, since XEmacs.rules does.
+
Index: texi/xemacs/fontconfig.texi
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/general-docs/texi/xemacs/fontconfig.texi,v
retrieving revision 1.3
diff -u -r1.3 fontconfig.texi
--- texi/xemacs/fontconfig.texi 5 May 2005 18:06:43 -0000 1.3
+++ texi/xemacs/fontconfig.texi 17 Feb 2007 11:51:14 -0000
@@ -1,6 +1,6 @@
\input texinfo.tex
@c %**start of header
-@setfilename ../../info/fontconfig.info
+@setfilename fontconfig.info
@settitle Fontconfig: Font configuration and customization library
@set synched-to-pkg-version 1.0
Index: texi/xemacs/xemacs-devguide.texi
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/general-docs/texi/xemacs/xemacs-devguide.texi,v
retrieving revision 1.2
diff -u -r1.2 xemacs-devguide.texi
--- texi/xemacs/xemacs-devguide.texi 17 Feb 2007 11:43:59 -0000 1.2
+++ texi/xemacs/xemacs-devguide.texi 17 Feb 2007 11:51:14 -0000
@@ -4,7 +4,7 @@
@c (shell-command "texi2html -number -monolithic xemacs-devguide.texi" nil)
@c
@c %**start of header
-@setfilename ../../info/xemacs-devguide.info
+@setfilename xemacs-devguide.info
@settitle xemacs-devguide
@c %**end of header
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches
[general-docs] Publish XEmacs Developer's Guide
17 years, 7 months
Stephen J. Turnbull
general-docs
I think it's time we had this, at least as an introduction/guide for
package maintainers and others who aren't primarily XEmacs developers
but do have responsibility for XEmacs code.
Will wait for discussion. Note that although this document represents
my thinking pretty well, I don't expect it to be a consensus. I do
think the howto and process parts are useful, and would like to get
thme published along with the policy stuff as a proposal.
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/general-docs/ChangeLog,v
retrieving revision 1.18
diff -u -r1.18 ChangeLog
--- ChangeLog 17 Feb 2007 11:54:12 -0000 1.18
+++ ChangeLog 17 Feb 2007 11:57:37 -0000
@@ -0,0 +1,6 @@
+2007-02-17 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ Publish XEmacs Developer's Guide.
+
+ * Makefile (EXPLICIT_DOCS): Add xemacs-devguide.texi.
+
Index: Makefile
===================================================================
RCS file: /pack/xemacscvs/XEmacs/packages/xemacs-packages/general-docs/Makefile,v
retrieving revision 1.13
diff -u -r1.13 Makefile
--- Makefile 7 May 2005 12:23:54 -0000 1.13
+++ Makefile 17 Feb 2007 11:57:37 -0000
@@ -27,6 +27,7 @@
# We'll need something like this.
#EXPLICIT_DOCS = texi/*.texi texi/xemacs/*.texi texi/packages/*.texi
-EXPLICIT_DOCS = texi/xemacs/fontconfig.texi
+EXPLICIT_DOCS = texi/xemacs/fontconfig.texi \
+ texi/xemacs/xemacs-devguide.texi
include ../../XEmacs.rules
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches