APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1301416114 -3600
# Node ID 436e67ca8c790dd9214e1a5eb72d4ab9a050df4b
# Parent 3889ef1284884c2ddf74627d4bad2764dc18529e
Give docstrings to least-{positive,negative}-normalized-float, float-*epsilon
2011-03-29 Aidan Kehoe <kehoea(a)parhasard.net>
* cl.el:
* cl.el (least-positive-float):
* cl.el (least-positive-normalized-float):
* cl.el (least-negative-normalized-float):
* cl.el (float-epsilon):
* cl.el (float-negative-epsilon):
Document some previously-undocumented float constants here.
* cl.el (oddp):
* cl.el (evenp):
Change numeric comparison to use #'eql instead of #'eq in
passing.
diff -r 3889ef128488 -r 436e67ca8c79 lisp/ChangeLog
--- a/lisp/ChangeLog Thu Mar 24 11:00:11 2011 -0600
+++ b/lisp/ChangeLog Tue Mar 29 17:28:34 2011 +0100
@@ -1,3 +1,17 @@
+2011-03-29 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cl.el:
+ * cl.el (least-positive-float):
+ * cl.el (least-positive-normalized-float):
+ * cl.el (least-negative-normalized-float):
+ * cl.el (float-epsilon):
+ * cl.el (float-negative-epsilon):
+ Document some previously-undocumented float constants here.
+ * cl.el (oddp):
+ * cl.el (evenp):
+ Change numeric comparison to use #'eql instead of #'eq in
+ passing.
+
2011-03-24 Jerry James <james(a)xemacs.org>
* cl-macs.el (loop): "arbitary" -> "arbitrary".
diff -r 3889ef128488 -r 436e67ca8c79 lisp/cl.el
--- a/lisp/cl.el Thu Mar 24 11:00:11 2011 -0600
+++ b/lisp/cl.el Tue Mar 29 17:28:34 2011 +0100
@@ -312,11 +312,11 @@
(defun oddp (integer)
"Return t if INTEGER is odd."
- (eq (logand integer 1) 1))
+ (eql (logand integer 1) 1))
(defun evenp (integer)
"Return t if INTEGER is even."
- (eq (logand integer 1) 0))
+ (eql (logand integer 1) 0))
;; XEmacs addition
(defalias 'cl-abs 'abs)
@@ -329,13 +329,35 @@
(defconst most-negative-float nil
"The float closest in value to negative infinity.")
(defconst least-positive-float nil
- "The positive float closest in value to 0.")
+ "The positive float closest in value to zero.")
(defconst least-negative-float nil
- "The negative float closest in value to 0.")
-(defconst least-positive-normalized-float nil)
-(defconst least-negative-normalized-float nil)
-(defconst float-epsilon nil)
-(defconst float-negative-epsilon nil)
+ "The negative float closest in value to zero.")
+(defconst least-positive-normalized-float nil
+ "The normalized positive float closest in value to zero.
+
+A float is normalized if the most significant bit of its mantissa is 1.
+Use of denormalized (equivalently, subnormal) floats in calculations will
+lead to gradual underflow, though they can be more accurate in representing
+individual small values. Normal and subnormal floats are as described in
+IEEE 754.")
+
+(defconst least-negative-normalized-float nil
+ "The normalized negative float closest in value to zero.
+
+See `least-positive-normalized-float' for details of normal and denormalized
+numbers.")
+
+(defconst float-epsilon nil
+ "The smallest float guaranteed not `eql' to 1.0 when added to 1.0.
+
+That is, (eql 1.0 (+ 1.0 X)) will always give nil if (<= float-epsilon X) ,
+but it may give t for smaller values.")
+
+(defconst float-negative-epsilon nil
+ "The smallest float guaranteed not `eql' to 1.0 when subtracted from 1.0.
+
+That is, (eql 1.0 (- 1.0 X)) will always give nil if (<=
+float-negative-epsilon X) , but it may give t for smaller values.")
;;; Sequence functions.
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
changeset: 5385:436e67ca8c79
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Tue Mar 29 17:28:34 2011 +0100
files: lisp/ChangeLog lisp/cl.el
description:
Give docstrings to least-{positive,negative}-normalized-float, float-*epsilon
2011-03-29 Aidan Kehoe <kehoea(a)parhasard.net>
* cl.el:
* cl.el (least-positive-float):
* cl.el (least-positive-normalized-float):
* cl.el (least-negative-normalized-float):
* cl.el (float-epsilon):
* cl.el (float-negative-epsilon):
Document some previously-undocumented float constants here.
* cl.el (oddp):
* cl.el (evenp):
Change numeric comparison to use #'eql instead of #'eq in
passing.
diff -r 3889ef128488 -r 436e67ca8c79 lisp/ChangeLog
--- a/lisp/ChangeLog Thu Mar 24 11:00:11 2011 -0600
+++ b/lisp/ChangeLog Tue Mar 29 17:28:34 2011 +0100
@@ -1,3 +1,17 @@
+2011-03-29 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cl.el:
+ * cl.el (least-positive-float):
+ * cl.el (least-positive-normalized-float):
+ * cl.el (least-negative-normalized-float):
+ * cl.el (float-epsilon):
+ * cl.el (float-negative-epsilon):
+ Document some previously-undocumented float constants here.
+ * cl.el (oddp):
+ * cl.el (evenp):
+ Change numeric comparison to use #'eql instead of #'eq in
+ passing.
+
2011-03-24 Jerry James <james(a)xemacs.org>
* cl-macs.el (loop): "arbitary" -> "arbitrary".
diff -r 3889ef128488 -r 436e67ca8c79 lisp/cl.el
--- a/lisp/cl.el Thu Mar 24 11:00:11 2011 -0600
+++ b/lisp/cl.el Tue Mar 29 17:28:34 2011 +0100
@@ -312,11 +312,11 @@
(defun oddp (integer)
"Return t if INTEGER is odd."
- (eq (logand integer 1) 1))
+ (eql (logand integer 1) 1))
(defun evenp (integer)
"Return t if INTEGER is even."
- (eq (logand integer 1) 0))
+ (eql (logand integer 1) 0))
;; XEmacs addition
(defalias 'cl-abs 'abs)
@@ -329,13 +329,35 @@
(defconst most-negative-float nil
"The float closest in value to negative infinity.")
(defconst least-positive-float nil
- "The positive float closest in value to 0.")
+ "The positive float closest in value to zero.")
(defconst least-negative-float nil
- "The negative float closest in value to 0.")
-(defconst least-positive-normalized-float nil)
-(defconst least-negative-normalized-float nil)
-(defconst float-epsilon nil)
-(defconst float-negative-epsilon nil)
+ "The negative float closest in value to zero.")
+(defconst least-positive-normalized-float nil
+ "The normalized positive float closest in value to zero.
+
+A float is normalized if the most significant bit of its mantissa is 1.
+Use of denormalized (equivalently, subnormal) floats in calculations will
+lead to gradual underflow, though they can be more accurate in representing
+individual small values. Normal and subnormal floats are as described in
+IEEE 754.")
+
+(defconst least-negative-normalized-float nil
+ "The normalized negative float closest in value to zero.
+
+See `least-positive-normalized-float' for details of normal and denormalized
+numbers.")
+
+(defconst float-epsilon nil
+ "The smallest float guaranteed not `eql' to 1.0 when added to 1.0.
+
+That is, (eql 1.0 (+ 1.0 X)) will always give nil if (<= float-epsilon X) ,
+but it may give t for smaller values.")
+
+(defconst float-negative-epsilon nil
+ "The smallest float guaranteed not `eql' to 1.0 when subtracted from 1.0.
+
+That is, (eql 1.0 (- 1.0 X)) will always give nil if (<=
+float-negative-epsilon X) , but it may give t for smaller values.")
;;; Sequence functions.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
PATCH 21.5
Recently, a number of patches have been sent to the Linux Kernel
Mailing List that korrect mispelt wurds. The patches were created by
the author of codespell:
http://git.profusion.mobi/cgit.cgi/lucas/codespell/
I tried running codespell over the XEmacs repository to see what it
turned up. Here is the result. I corrected some grammar while I was
at it. Some of these "corrections" may be due to me having an
American English dictionary, instead of a British English dictionary.
Feel free to point out corrections that shouldn't be made.
(This doesn't mean that no misspellings remain, just that we fixed
some common ones.)
I'm attaching the patch, because I don't trust gmail to not mangle the
whitespace if I copy and paste it.
--
Jerry James
http://www.jamezone.org/
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
NOTE: This patch has been committed.
I added the min-colors specifier to defface, and it highlighted the
fact that the tty device hadn't implemented the num-color-cells
metric. I also added num-bit-planes since it was easy to derive.
* console-tty-impl.h (struct tty_console): Add field for number of
displayable colors.
* device-tty.c (tty_device_system_metrics): Return metrics for
num-color-cells and num-bit-planes.
* device.c: There are two required args for device-system-metric.
* redisplay-tty.c (init_tty_for_redisplay): Retrieve number of
colors from terminal description. Default to 2 if none found.
xemacs-local source patch:
Diff command: hg diff --git
Files affected: src/redisplay-tty.c src/device.c src/device-tty.c
src/console-tty-impl.h
diff --git a/src/console-tty-impl.h b/src/console-tty-impl.h
--- a/src/console-tty-impl.h
+++ b/src/console-tty-impl.h
@@ -63,6 +63,8 @@
int height;
int width;
+ int colors;
+
/* The count of frame number. */
int frame_count;
diff --git a/src/device-tty.c b/src/device-tty.c
--- a/src/device-tty.c
+++ b/src/device-tty.c
@@ -196,6 +196,10 @@
case DM_size_device:
return Fcons (make_int (CONSOLE_TTY_DATA (con)->width),
make_int (CONSOLE_TTY_DATA (con)->height));
+ case DM_num_bit_planes:
+ return make_int (log2 (CONSOLE_TTY_DATA (con)->colors));
+ case DM_num_color_cells:
+ return make_int (CONSOLE_TTY_DATA (con)->colors);
default: /* No such device metric property for TTY devices */
return Qunbound;
}
diff --git a/src/device.c b/src/device.c
--- a/src/device.c
+++ b/src/device.c
@@ -1057,8 +1057,8 @@
return DEVICE_PRINTER_P (decode_device (device)) ? Qt : Qnil;
}
-DEFUN ("device-system-metric", Fdevice_system_metric, 1, 3, 0, /*
-Get a metric for DEVICE as provided by the system.
+DEFUN ("device-system-metric", Fdevice_system_metric, 2, 3, 0, /*
+Get DEVICE METRIC as provided by the system.
METRIC must be a symbol specifying requested metric. Note that the metrics
returned are these provided by the system internally, not read from
resources,
diff --git a/src/redisplay-tty.c b/src/redisplay-tty.c
--- a/src/redisplay-tty.c
+++ b/src/redisplay-tty.c
@@ -1116,6 +1116,13 @@
if (CONSOLE_TTY_DATA (c)->width <= 0 || CONSOLE_TTY_DATA (c)->height <=
0)
return TTY_SIZE_UNSPECIFIED;
+ CONSOLE_TTY_DATA (c)->colors = tgetnum("Co");
+ if (CONSOLE_TTY_DATA (c)->colors == 0)
+ CONSOLE_TTY_DATA (c)->colors = tgetnum("colors");
+ if (CONSOLE_TTY_DATA (c)->colors == 0)
+ /* There is always foreground and background. */
+ CONSOLE_TTY_DATA (c)->colors = 2;
+
/*
* Initialize cursor motion information.
*/
--
Jeff Sparkes
jsparkes(a)gmail.com
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
Hi,
(Trying patcher for the first time ... ;-)
This patch hasn't been commited. It is about the use of the auto
keyword. It is, from what I know, not needed since auto is the
default. In C++0x auto will get a new meaning and the current usage
will be illegal.
(Could it be so evil that there are compilers out there that would not
place an automatic variable in a register if the auto keyword is
used?)
2011-03-20 Mats Lidell <matsl(a)xemacs.org>
* alloca.c (find_stack_direction):
* alloca.c (xemacs_c_alloca):
Remove use of auto keyword. It is default and will be illegal in
C++0X.
ChangeLog patch:
Diff command: hg extdiff -o -U0
Files affected: src/ChangeLog
--- patched-auto-c++.6c3a695f54f5/src/ChangeLog 2011-03-20 23:46:29.079105581 +0100
+++ /src/xemacs/work/patched-auto-c++/src/ChangeLog 2011-03-20 23:46:22.514215501 +0100
@@ -0,0 +1,7 @@
+2011-03-20 Mats Lidell <matsl(a)xemacs.org>
+
+ * alloca.c (find_stack_direction):
+ * alloca.c (xemacs_c_alloca):
+ Remove use of auto keyword. It is default and will be illegal in
+ C++0X.
+
Source patch:
Diff command: hg diff --git
Files affected: src/alloca.c
diff --git a/src/alloca.c b/src/alloca.c
--- a/src/alloca.c
+++ b/src/alloca.c
@@ -78,7 +78,7 @@
find_stack_direction (void)
{
static char *addr = NULL; /* Address of first `dummy', once known. */
- auto char dummy; /* To get stack address. */
+ char dummy; /* To get stack address. */
if (addr == NULL)
{ /* Initial entry. */
@@ -131,7 +131,7 @@
pointer
xemacs_c_alloca (unsigned int size)
{
- auto char probe; /* Probes stack depth: */
+ char probe; /* Probes stack depth: */
register char *depth = ADDRESS_FUNCTION (probe);
#if STACK_DIRECTION == 0
Yours
--
%% Mats
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
I'm wondering about the use of log2 in the patch.
1. Is it always available? Configure doesn't check for it.
2. I don't do any casting to int. This works for gcc; is it okay for other
compilers?
--
Jeff Sparkes
jsparkes(a)gmail.com
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1300947745 0
# Node ID 294ab9180fad2da8aef81412c91f1a81517d64db
# Parent d363790fd936879ef0414abd81afd7ea7f25f3ee
#'custom-add-to-group: warn if GROUP is nil.
2011-03-24 Aidan Kehoe <kehoea(a)parhasard.net>
* custom.el (custom-add-to-group):
Warn if adding an option to the nil group; this is usually an
error on the part of the programmer.
* cmdloop.el (suggest-key-bindings):
Specify a group for this variable, it didn't previously have one.
diff -r d363790fd936 -r 294ab9180fad lisp/ChangeLog
--- a/lisp/ChangeLog Wed Mar 23 00:08:35 2011 +0100
+++ b/lisp/ChangeLog Thu Mar 24 06:22:25 2011 +0000
@@ -1,3 +1,11 @@
+2011-03-24 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * custom.el (custom-add-to-group):
+ Warn if adding an option to the nil group; this is usually an
+ error on the part of the programmer.
+ * cmdloop.el (suggest-key-bindings):
+ Specify a group for this variable, it didn't previously have one.
+
2011-03-21 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (revappend, nreconc):
diff -r d363790fd936 -r 294ab9180fad lisp/cmdloop.el
--- a/lisp/cmdloop.el Wed Mar 23 00:08:35 2011 +0100
+++ b/lisp/cmdloop.el Thu Mar 24 06:22:25 2011 +0000
@@ -313,7 +313,8 @@
:type '(choice
(const :tag "off" nil)
(integer :tag "time" 2)
- (other :tag "on")))
+ (other :tag "on"))
+:group 'keyboard)
(dontusethis-set-symbol-value-handler
'suggest-key-bindings
diff -r d363790fd936 -r 294ab9180fad lisp/custom.el
--- a/lisp/custom.el Wed Mar 23 00:08:35 2011 +0100
+++ b/lisp/custom.el Thu Mar 24 06:22:25 2011 +0000
@@ -409,6 +409,9 @@
(defun custom-add-to-group (group option widget)
"To existing GROUP add a new OPTION of type WIDGET.
If there already is an entry for OPTION and WIDGET, nothing is done."
+ (or group (display-warning 'custom
+ (format "custom: widget %s, option %s has no associated group"
+ widget option)))
(let ((members (get group 'custom-group))
(entry (list option widget)))
(unless (member entry members)
--
“Apart from the nine-banded armadillo, man is the only natural host of
Mycobacterium leprae, although it can be grown in the footpads of mice.”
-- Kumar & Clark, Clinical Medicine, summarising improbable leprosy research
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
changeset: 5383:294ab9180fad
tag: tip
user: Aidan Kehoe <kehoea(a)parhasard.net>
date: Thu Mar 24 06:22:25 2011 +0000
files: lisp/ChangeLog lisp/cmdloop.el lisp/custom.el
description:
#'custom-add-to-group: warn if GROUP is nil.
2011-03-24 Aidan Kehoe <kehoea(a)parhasard.net>
* custom.el (custom-add-to-group):
Warn if adding an option to the nil group; this is usually an
error on the part of the programmer.
* cmdloop.el (suggest-key-bindings):
Specify a group for this variable, it didn't previously have one.
diff -r d363790fd936 -r 294ab9180fad lisp/ChangeLog
--- a/lisp/ChangeLog Wed Mar 23 00:08:35 2011 +0100
+++ b/lisp/ChangeLog Thu Mar 24 06:22:25 2011 +0000
@@ -1,3 +1,11 @@
+2011-03-24 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * custom.el (custom-add-to-group):
+ Warn if adding an option to the nil group; this is usually an
+ error on the part of the programmer.
+ * cmdloop.el (suggest-key-bindings):
+ Specify a group for this variable, it didn't previously have one.
+
2011-03-21 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (revappend, nreconc):
diff -r d363790fd936 -r 294ab9180fad lisp/cmdloop.el
--- a/lisp/cmdloop.el Wed Mar 23 00:08:35 2011 +0100
+++ b/lisp/cmdloop.el Thu Mar 24 06:22:25 2011 +0000
@@ -313,7 +313,8 @@
:type '(choice
(const :tag "off" nil)
(integer :tag "time" 2)
- (other :tag "on")))
+ (other :tag "on"))
+:group 'keyboard)
(dontusethis-set-symbol-value-handler
'suggest-key-bindings
diff -r d363790fd936 -r 294ab9180fad lisp/custom.el
--- a/lisp/custom.el Wed Mar 23 00:08:35 2011 +0100
+++ b/lisp/custom.el Thu Mar 24 06:22:25 2011 +0000
@@ -409,6 +409,9 @@
(defun custom-add-to-group (group option widget)
"To existing GROUP add a new OPTION of type WIDGET.
If there already is an entry for OPTION and WIDGET, nothing is done."
+ (or group (display-warning 'custom
+ (format "custom: widget %s, option %s has no associated group"
+ widget option)))
(let ((members (get group 'custom-group))
(entry (list option widget)))
(unless (member entry members)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches