Re: edit-utils change breaks 21.4
12 years, 1 month
Vin Shelton
On Mon, Nov 19, 2012 at 11:53 PM, Vin Shelton <acs(a)alumni.princeton.edu> wrote:
> Unfortunately, I rebuilt all my packages and now I'm getting the
> following error message printed on stdout when starting 21.4:
>
> Symbol's value as variable is void: bc-buffer-colors-enabled-p
>
> XEmacs then terminates. Starting XEmacs with -debug-init yields no
> insight and starting with -vanilla similarly yields no joy. XEmacs
> -no-autoloads does allow XEmacs to start up, but, as you'd expect,
> it's severely crippled.
>
> If anyone wants to fix this before I can track it down, please have at it.
I think the attached patch fixes this problem. I will apply this
tonight unless someone beats me to it.
- Vin
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/xemacs-packages: 3 new changesets
12 years, 1 month
Bitbucket
3 new commits in xemacs-packages:
https://bitbucket.org/xemacs/xemacs-packages/changeset/613c3cde9003/
changeset: 613c3cde9003
user: Norbert Koch
date: 2012-11-19 09:05:42
summary: Update edit-utils
affected #: 1 file
diff -r 3d6f3ce1bd1b1464ca0bf6413ecbbef7676f057f -r 613c3cde9003b2897d5cee3059d2e5d82b8b95a8 .hgsubstate
--- a/.hgsubstate
+++ b/.hgsubstate
@@ -33,7 +33,7 @@
5200706cfcb56eeefed3d21d8f63f32dd491ca85 xemacs-packages/ede
7f290f0c522c3031e9101047df3949d87789de35 xemacs-packages/edebug
e574c28af4793c5c3d4c3c3e8fa9a13d3f250f74 xemacs-packages/ediff
-ca2abadaf7dba3d3a5c7849fe85b5cc041bccfb1 xemacs-packages/edit-utils
+b1f2bf6133c5f2607058e88d1f9e385ce87e8415 xemacs-packages/edit-utils
94f1da97c08e96f1bf1fd5a255934956e6a37a05 xemacs-packages/edt
73360c2969ec1e3ae896760611d0a4d4be823cf0 xemacs-packages/efs
2f441d6442dac751f54b36f78fbfdab0848f6bbc xemacs-packages/eicq
https://bitbucket.org/xemacs/xemacs-packages/changeset/c4eb335218e6/
changeset: c4eb335218e6
user: Norbert Koch
date: 2012-11-19 09:06:35
summary: XEmacs Package Release
affected #: 1 file
diff -r 613c3cde9003b2897d5cee3059d2e5d82b8b95a8 -r c4eb335218e6097d8da7583026a078db0a5bfbb8 ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-11-19 Norbert Koch <viteno(a)xemacs.org>
+
+ * Packages released: edit-utils.
+
2012-09-11 Norbert Koch <viteno(a)xemacs.org>
* Packages released: cc-mode.
https://bitbucket.org/xemacs/xemacs-packages/changeset/e80bead2eebe/
changeset: e80bead2eebe
user: Norbert Koch
date: 2012-11-19 09:18:21
summary: pre-release edit-utils
affected #: 1 file
diff -r c4eb335218e6097d8da7583026a078db0a5bfbb8 -r e80bead2eebe9cb100aea6863b6c2e9bd101b70e .hgsubstate
--- a/.hgsubstate
+++ b/.hgsubstate
@@ -33,7 +33,7 @@
5200706cfcb56eeefed3d21d8f63f32dd491ca85 xemacs-packages/ede
7f290f0c522c3031e9101047df3949d87789de35 xemacs-packages/edebug
e574c28af4793c5c3d4c3c3e8fa9a13d3f250f74 xemacs-packages/ediff
-b1f2bf6133c5f2607058e88d1f9e385ce87e8415 xemacs-packages/edit-utils
+bcdfda6bbda176489dc14048d25946a843ba79f7 xemacs-packages/edit-utils
94f1da97c08e96f1bf1fd5a255934956e6a37a05 xemacs-packages/edt
73360c2969ec1e3ae896760611d0a4d4be823cf0 xemacs-packages/efs
2f441d6442dac751f54b36f78fbfdab0848f6bbc xemacs-packages/eicq
Repository URL: https://bitbucket.org/xemacs/xemacs-packages/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/edit-utils: 2 new changesets
12 years, 1 month
Bitbucket
2 new commits in edit-utils:
https://bitbucket.org/xemacs/edit-utils/changeset/c57bca7c5387/
changeset: c57bca7c5387
user: Norbert Koch
date: 2012-11-19 09:06:35
summary: XEmacs Package Release 2.47
affected #: 2 files
diff -r b1f2bf6133c5f2607058e88d1f9e385ce87e8415 -r c57bca7c5387d261088d902c695c52413f15d154 ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2012-11-19 Norbert Koch <viteno(a)xemacs.org>
+
+ * Makefile (VERSION): XEmacs package 2.47 released.
+
2012-11-19 Steve Mitchell <smitchel(a)bnin.net>
Byrel Mitchell <byrel.mitchell(a)gmail.com>
diff -r b1f2bf6133c5f2607058e88d1f9e385ce87e8415 -r c57bca7c5387d261088d902c695c52413f15d154 Makefile
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,7 @@
# This XEmacs package contains independent single file lisp packages
-VERSION = 2.46
+VERSION = 2.47
AUTHOR_VERSION =
MAINTAINER = XEmacs Development Team <xemacs-beta(a)xemacs.org>
PACKAGE = edit-utils
https://bitbucket.org/xemacs/edit-utils/changeset/bcdfda6bbda1/
changeset: bcdfda6bbda1
user: Norbert Koch
date: 2012-11-19 09:06:35
summary: Added tag edit-utils-2_47 for changeset c57bca7c5387
affected #: 1 file
diff -r c57bca7c5387d261088d902c695c52413f15d154 -r bcdfda6bbda176489dc14048d25946a843ba79f7 .hgtags
--- a/.hgtags
+++ b/.hgtags
@@ -152,3 +152,4 @@
129ef811720b9bdf33934e421726b0c991363018 edit-utils-2_42
a62ad4a49792d000ec06ca150d4d039e00909d0e edit-utils-2_45
d41bc16b290302ff4f3e666be1443c5749c6c04a edit-utils-2_46
+c57bca7c5387d261088d902c695c52413f15d154 edit-utils-2_47
Repository URL: https://bitbucket.org/xemacs/edit-utils/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/edit-utils: skm: fixed autoloads in buffer-colors.el
12 years, 1 month
Bitbucket
1 new commit in edit-utils:
https://bitbucket.org/xemacs/edit-utils/changeset/b1f2bf6133c5/
changeset: b1f2bf6133c5
user: skm
date: 2012-11-19 06:51:50
summary: fixed autoloads in buffer-colors.el
affected #: 2 files
diff -r ca2abadaf7dba3d3a5c7849fe85b5cc041bccfb1 -r b1f2bf6133c5f2607058e88d1f9e385ce87e8415 ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-11-19 Steve Mitchell <smitchel(a)bnin.net>
+ Byrel Mitchell <byrel.mitchell(a)gmail.com>
+
+ * buffer-colors.el : re-added autoloads with
+ checks for behavior support.
+ uses variables if behavior
+ support not available.
+
2012-01-13 Norbert Koch <viteno(a)xemacs.org>
* Makefile (VERSION): XEmacs package 2.46 released.
diff -r ca2abadaf7dba3d3a5c7849fe85b5cc041bccfb1 -r b1f2bf6133c5f2607058e88d1f9e385ce87e8415 buffer-colors.el
--- a/buffer-colors.el
+++ b/buffer-colors.el
@@ -81,18 +81,21 @@
(define-specifier-tag 'bc-read-only)
(defvar bc-fgbg-menu nil "Menu for Buffer Colors")
-
+(defvar bc-buffer-colors-enabled-p nil
+ "Is buffer-colors currently loaded.
+This variable is used on systems without behavior functionality to keep track of whether buffer-colors is currently loaded.")
;; the behaviour lets us
;; disable Buffer Colors,
;; remove the Buffer Colors menu item,
;; and delete all previously set buffer colors,
;; restoring them to the colors in the default face.
-(define-behavior 'buffer-colors
- "A system for quickly changing the fg and bg colors of buffers.
+(when (functionp 'define-behavior)
+ (define-behavior 'buffer-colors
+ "A system for quickly changing the fg and bg colors of buffers.
It includes a rule-based system for coloring new buffers."
-:enable 'bc-enable-behavior
-:disable 'bc-disable-behavior)
+:enable 'bc-enable-behavior
+:disable 'bc-disable-behavior))
;;---- functions for rules ----------------------------------------
(defun bc-read-only-p ()
@@ -236,6 +239,15 @@
(disable-behavior 'buffer-colors)
(enable-behavior 'buffer-colors)))
+;;;###autoload
+(defun bc-toggle-no-behavior ()
+ (interactive)
+ (if bc-buffer-colors-enabled-p
+ (bc-disable-behavior)
+ (bc-enable-behavior))
+ (setq bc-buffer-colors-enabled-p (not bc-buffer-colors-enabled-p)))
+
+
(defun bc-write-current-fgbg ()
"Writes buffer colors menu to file"
(custom-save-all))
@@ -406,15 +418,24 @@
:value bc-read-only))))))
;;;;--- start up code ----------------------------------------------
+;;;###autoload
+(unless (featurep 'buffer-colors)
+ (when (boundp 'current-menubar)
+ (add-menu-button '("Options" "Display")
+ "---"))) ;add a separator only first time loaded
-(unless (featurep 'buffer-colors)
- (add-menu-button '("Options" "Display")
- "---")) ;add a separator only first time loaded
+;;;###autoload
+(when (boundp 'current-menubar)
+ (if (functionp 'define-behavior)
+ (add-menu-button '("Options" "Display")
+ [ "Buffer Colors" bc-toggle-behavior
+ :style toggle
+ :selected (behavior-enabled-p 'buffer-colors)])
+ (add-menu-button '("Options" "Display")
+ [ "Buffer Colors" bc-toggle-no-behavior
+ :style toggle
+ :selected bc-buffer-colors-enabled-p])))
-(add-menu-button '("Options" "Display")
- [ "Buffer Colors" bc-toggle-behavior
- :style toggle
- :selected (behavior-enabled-p 'buffer-colors)])
(provide 'buffer-colors)
Repository URL: https://bitbucket.org/xemacs/edit-utils/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Back out 7371081ce8f7, I have a better approach.
12 years, 1 month
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1352237655 0
# Node ID b490ddbd42aab637aa8332b0fc3dbb722f60dc44
# Parent 7b5f88e5b456b61e5108c84079389b2235ee5c77
Back out 7371081ce8f7, I have a better approach.
diff -r 7b5f88e5b456 -r b490ddbd42aa lisp/ChangeLog
--- a/lisp/ChangeLog Mon Oct 15 20:47:00 2012 +0200
+++ b/lisp/ChangeLog Tue Nov 06 21:34:15 2012 +0000
@@ -1,10 +1,3 @@
-2012-10-14 Aidan Kehoe <kehoea(a)parhasard.net>
-
- * help.el:
- * help.el (describe-function-1):
- Add some newlines here when dealing with remapped commands, thank
- you Robert Pluim.
-
2012-10-13 Mats Lidell <matsl(a)xemacs.org>
* process.el (call-process-shell-command): New function from GNU.
diff -r 7b5f88e5b456 -r b490ddbd42aa lisp/help.el
--- a/lisp/help.el Mon Oct 15 20:47:00 2012 +0200
+++ b/lisp/help.el Tue Nov 06 21:34:15 2012 +0000
@@ -1544,10 +1544,10 @@
(format "\n\\[%s]" function))))
(when commands-remapped-to
(if (cdr commands-remapped-to)
- (princ (format "\n\nThe following functions are \
+ (princ (format "The following functions are \
remapped to it:\n`%s'" (mapconcat #'prin1-to-string commands-remapped-to
"', `")))
- (princ (format "\n\n`%s' is remapped to it.\n"
+ (princ (format "`%s' is remapped to it.\n"
(car
commands-remapped-to))))))))))))))
diff -r 7b5f88e5b456 -r b490ddbd42aa src/ChangeLog
--- a/src/ChangeLog Mon Oct 15 20:47:00 2012 +0200
+++ b/src/ChangeLog Tue Nov 06 21:34:15 2012 +0000
@@ -1,14 +1,3 @@
-2012-10-14 Aidan Kehoe <kehoea(a)parhasard.net>
-
- Have command remapping work interactively too, thank you Robert
- Pluim.
- * event-stream.c (Fdispatch_event):
- Obey command remapping here, it wasn't done for us.
- * keymap.c:
- * keymap.c (command_remapping_for_event): New, needed to observe
- command remapping interactively.
- * lisp.h: Make it available.
-
2012-10-14 Aidan Kehoe <kehoea(a)parhasard.net>
Respect face and display table information in the minibuffer
diff -r 7b5f88e5b456 -r b490ddbd42aa src/event-stream.c
--- a/src/event-stream.c Mon Oct 15 20:47:00 2012 +0200
+++ b/src/event-stream.c Tue Nov 06 21:34:15 2012 +0000
@@ -4550,6 +4550,8 @@
int magic_undo = 0;
Elemcount magic_undo_count = 20;
+ Vthis_command = leaf;
+
/* Don't push an undo boundary if the command set the prefix arg,
or if we are executing a keyboard macro, or if in the
minibuffer. If the command we are about to execute is
@@ -4565,8 +4567,6 @@
if (SYMBOLP (leaf))
{
Lisp_Object prop = Fget (leaf, Qself_insert_defer_undo, Qnil);
- Lisp_Object remap = Qnil;
-
if (NATNUMP (prop))
{
magic_undo = 1;
@@ -4587,16 +4587,8 @@
magic_undo = 1;
else if (EQ (leaf, Qself_insert_command))
magic_undo = 1;
-
- remap = command_remapping_for_event (leaf, event);
- if (!NILP (remap))
- {
- leaf = remap;
- }
}
- Vthis_command = leaf;
-
if (!magic_undo)
command_builder->self_insert_countdown = 0;
if (NILP (XCONSOLE (console)->prefix_arg)
diff -r 7b5f88e5b456 -r b490ddbd42aa src/keymap.c
--- a/src/keymap.c Mon Oct 15 20:47:00 2012 +0200
+++ b/src/keymap.c Tue Nov 06 21:34:15 2012 +0000
@@ -2127,20 +2127,6 @@
return Qnil;
}
-Lisp_Object
-command_remapping_for_event (Lisp_Object command, Lisp_Object event0)
-{
- /* This function can GC */
- Lisp_Object maps[100];
- int nmaps;
-
- nmaps = get_relevant_keymaps (event0, Qnil, countof (maps), maps);
- if (nmaps > countof (maps))
- nmaps = countof (maps);
-
- return command_remapping (command, nmaps, maps);
-}
-
DEFUN ("command-remapping", Fcommand_remapping, 1, 3, 0, /*
Return the remapping for command COMMAND.
diff -r 7b5f88e5b456 -r b490ddbd42aa src/lisp.h
--- a/src/lisp.h Mon Oct 15 20:47:00 2012 +0200
+++ b/src/lisp.h Tue Nov 06 21:34:15 2012 +0000
@@ -5473,9 +5473,6 @@
EXFUN (Fmake_sparse_keymap, 1);
EXFUN (Fset_keymap_parents, 2);
-Lisp_Object command_remapping_for_event (Lisp_Object command,
- Lisp_Object event0);
-
void where_is_to_char (Lisp_Object, Eistring *);
/* Defined in lread.c */
--
‘Liston operated so fast that he once accidentally amputated an assistant’s
fingers along with a patient’s leg, […] The patient and the assistant both
died of sepsis, and a spectator reportedly died of shock, resulting in the
only known procedure with a 300% mortality.’ (Atul Gawande, NEJM, 2012)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Handle interactive command remapping a little better than 7371081ce8f7, keymap.c
12 years, 1 month
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1352240835 0
# Node ID be87f507f5100953f14b0405f0ccbd825e941fe7
# Parent b490ddbd42aab637aa8332b0fc3dbb722f60dc44
Handle interactive command remapping a little better than 7371081ce8f7, keymap.c
src/ChangeLog addition:
2012-11-06 Aidan Kehoe <kehoea(a)parhasard.net>
* keymap.c (event_binding):
Do command remapping here for interactive lookups; avoids a
relatively expensive repeated call to get_relevant_keymaps(), as
was necessary in 7371081ce8f7 (which changeset has been backed
out).
lisp/ChangeLog addition:
2012-10-14 Aidan Kehoe <kehoea(a)parhasard.net>
* help.el:
* help.el (describe-function-1):
Add some newlines here when dealing with remapped commands, thank
you Robert Pluim.
diff -r b490ddbd42aa -r be87f507f510 lisp/ChangeLog
--- a/lisp/ChangeLog Tue Nov 06 21:34:15 2012 +0000
+++ b/lisp/ChangeLog Tue Nov 06 22:27:15 2012 +0000
@@ -1,3 +1,10 @@
+2012-10-14 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * help.el:
+ * help.el (describe-function-1):
+ Add some newlines here when dealing with remapped commands, thank
+ you Robert Pluim.
+
2012-10-13 Mats Lidell <matsl(a)xemacs.org>
* process.el (call-process-shell-command): New function from GNU.
diff -r b490ddbd42aa -r be87f507f510 lisp/help.el
--- a/lisp/help.el Tue Nov 06 21:34:15 2012 +0000
+++ b/lisp/help.el Tue Nov 06 22:27:15 2012 +0000
@@ -1544,10 +1544,10 @@
(format "\n\\[%s]" function))))
(when commands-remapped-to
(if (cdr commands-remapped-to)
- (princ (format "The following functions are \
+ (princ (format "\n\nThe following functions are \
remapped to it:\n`%s'" (mapconcat #'prin1-to-string commands-remapped-to
"', `")))
- (princ (format "`%s' is remapped to it.\n"
+ (princ (format "\n\n`%s' is remapped to it.\n"
(car
commands-remapped-to))))))))))))))
diff -r b490ddbd42aa -r be87f507f510 src/ChangeLog
--- a/src/ChangeLog Tue Nov 06 21:34:15 2012 +0000
+++ b/src/ChangeLog Tue Nov 06 22:27:15 2012 +0000
@@ -1,3 +1,11 @@
+2012-11-06 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * keymap.c (event_binding):
+ Do command remapping here for interactive lookups; avoids a
+ relatively expensive repeated call to get_relevant_keymaps(), as
+ was necessary in 7371081ce8f7 (which changeset has been backed
+ out).
+
2012-10-14 Aidan Kehoe <kehoea(a)parhasard.net>
Respect face and display table information in the minibuffer
diff -r b490ddbd42aa -r be87f507f510 src/keymap.c
--- a/src/keymap.c Tue Nov 06 21:34:15 2012 +0000
+++ b/src/keymap.c Tue Nov 06 22:27:15 2012 +0000
@@ -2996,7 +2996,7 @@
event_binding (Lisp_Object event0, int accept_default)
{
/* This function can GC */
- Lisp_Object maps[100];
+ Lisp_Object maps[100], result;
int nmaps;
assert (EVENTP (event0));
@@ -3004,8 +3004,20 @@
nmaps = get_relevant_keymaps (event0, Qnil, countof (maps), maps);
if (nmaps > countof (maps))
nmaps = countof (maps);
- return process_event_binding_result (lookup_events (event0, nmaps, maps,
- accept_default));
+
+ result = process_event_binding_result (lookup_events (event0, nmaps, maps,
+ accept_default));
+
+ if (!NILP (result) && SYMBOLP (result))
+ {
+ Lisp_Object remap = command_remapping (result, nmaps, maps);
+ if (!NILP (remap))
+ {
+ result = remap;
+ }
+ }
+
+ return result;
}
/* like event_binding, but specify a keymap to search */
--
‘Liston operated so fast that he once accidentally amputated an assistant’s
fingers along with a patient’s leg, […] The patient and the assistant both
died of sepsis, and a spectator reportedly died of shock, resulting in the
only known procedure with a 300% mortality.’ (Atul Gawande, NEJM, 2012)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] Be more careful about erroring with probable GNU-syntax keysyms, keymap.c
12 years, 1 month
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1352241238 0
# Node ID 4d15e903800b152c8f2710467d8e0693dd054570
# Parent be87f507f5100953f14b0405f0ccbd825e941fe7
Be more careful about erroring with probable GNU-syntax keysyms, keymap.c
src/ChangeLog addition:
2012-11-06 Aidan Kehoe <kehoea(a)parhasard.net>
* keymap.c (define_key_check_and_coerce_keysym):
When worrying about GNU Emacs-like keysym syntax, if the symbol
name starts with c-whatever (or s-whatever, or m-whatever), check
for a function binding for that before erroring. Otherwise command
remapping and C mode interact badly, since most of the C mode
commands are regarded as GNU Emacs-style keysyms.
diff -r be87f507f510 -r 4d15e903800b src/ChangeLog
--- a/src/ChangeLog Tue Nov 06 22:27:15 2012 +0000
+++ b/src/ChangeLog Tue Nov 06 22:33:58 2012 +0000
@@ -1,3 +1,12 @@
+2012-11-06 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * keymap.c (define_key_check_and_coerce_keysym):
+ When worrying about GNU Emacs-like keysym syntax, if the symbol
+ name starts with c-whatever (or s-whatever, or m-whatever), check
+ for a function binding for that before erroring. Otherwise command
+ remapping and C mode interact badly, since most of the C mode
+ commands are regarded as GNU Emacs-style keysyms.
+
2012-11-06 Aidan Kehoe <kehoea(a)parhasard.net>
* keymap.c (event_binding):
diff -r be87f507f510 -r 4d15e903800b src/keymap.c
--- a/src/keymap.c Tue Nov 06 22:27:15 2012 +0000
+++ b/src/keymap.c Tue Nov 06 22:33:58 2012 +0000
@@ -1344,7 +1344,11 @@
sanitize the Sun keyboards, and would make it trickier to
conditionalize a .emacs file for multiple X servers.
*/
- if (((int) qxestrlen (name) >= 2 && name[1] == '-')
+ if (((int) qxestrlen (name) >= 2 && name[1] == '-'
+ /* Check for a function binding if the symbol looks like
+ c-..., otherwise command remapping and C mode interact
+ badly. */
+ && NILP (Ffunctionp (XSYMBOL_FUNCTION (*keysym))))
#if 1
||
/* Ok, this is a bit more dubious - prevent people from doing things
--
‘Liston operated so fast that he once accidentally amputated an assistant’s
fingers along with a patient’s leg, […] The patient and the assistant both
died of sepsis, and a spectator reportedly died of shock, resulting in the
only known procedure with a 300% mortality.’ (Atul Gawande, NEJM, 2012)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
[COMMIT] No error from an incorrect number of arguments, recently-added compiler macros
12 years, 1 month
Aidan Kehoe
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1352243526 0
# Node ID 7f4c8574a590f3e3457bdecf5716aa21a64626c8
# Parent 4d15e903800b152c8f2710467d8e0693dd054570
No error from an incorrect number of arguments, recently-added compiler macros
lisp/ChangeLog addition:
2012-11-06 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (equal, member, assoc, rassoc):
Never error at compile time in these compiler macros because of an
incorrect number of arguments.
diff -r 4d15e903800b -r 7f4c8574a590 lisp/ChangeLog
--- a/lisp/ChangeLog Tue Nov 06 22:33:58 2012 +0000
+++ b/lisp/ChangeLog Tue Nov 06 23:12:06 2012 +0000
@@ -1,3 +1,9 @@
+2012-11-06 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cl-macs.el (equal, member, assoc, rassoc):
+ Never error at compile time in these compiler macros because of an
+ incorrect number of arguments.
+
2012-10-14 Aidan Kehoe <kehoea(a)parhasard.net>
* help.el:
diff -r 4d15e903800b -r 7f4c8574a590 lisp/cl-macs.el
--- a/lisp/cl-macs.el Tue Nov 06 22:33:58 2012 +0000
+++ b/lisp/cl-macs.el Tue Nov 06 23:12:06 2012 +0000
@@ -3238,34 +3238,46 @@
(defun cl-cdr-or-pi (object)
(if (consp object) (cdr object) pi))
-(define-compiler-macro equal (&whole form a b)
- (if (or (cl-equal-equivalent-to-eq-p (cl-const-expr-val a pi))
- (cl-equal-equivalent-to-eq-p (cl-const-expr-val b pi)))
- (cons 'eq (cdr form))
- form))
-
-(define-compiler-macro member (&whole form elt list)
- (if (or (cl-equal-equivalent-to-eq-p (cl-const-expr-val elt pi))
- (every #'cl-equal-equivalent-to-eq-p
- (cl-const-expr-val list '(1.0))))
- (cons 'memq (cdr form))
- form))
-
-(define-compiler-macro assoc (&whole form elt list)
- (if (or (cl-equal-equivalent-to-eq-p (cl-const-expr-val elt pi))
- (not (find-if-not #'cl-equal-equivalent-to-eq-p
- (cl-const-expr-val list '((1.0 . nil)))
-:key #'cl-car-or-pi)))
- (cons 'assq (cdr form))
- form))
-
-(define-compiler-macro rassoc (&whole form elt list)
- (if (or (cl-equal-equivalent-to-eq-p (cl-const-expr-val elt pi))
- (not (find-if-not #'cl-equal-equivalent-to-eq-p
- (cl-const-expr-val list '((nil . 1.0)))
+(define-compiler-macro equal (&whole form &rest args)
+ (cond
+ ((not (eql (length form) 3))
+ form)
+ ((or (cl-equal-equivalent-to-eq-p (cl-const-expr-val (pop args) pi))
+ (cl-equal-equivalent-to-eq-p (cl-const-expr-val (pop args) pi)))
+ (cons 'eq (cdr form)))
+ (t form)))
+
+(define-compiler-macro member (&whole form &rest args)
+ (cond
+ ((not (eql (length form) 3))
+ form)
+ ((or (cl-equal-equivalent-to-eq-p (cl-const-expr-val (pop args) pi))
+ (every #'cl-equal-equivalent-to-eq-p
+ (cl-const-expr-val (pop args) '(1.0))))
+ (cons 'memq (cdr form)))
+ (t form)))
+
+(define-compiler-macro assoc (&whole form &rest args)
+ (cond
+ ((not (eql (length form) 3))
+ form)
+ ((or (cl-equal-equivalent-to-eq-p (cl-const-expr-val (pop args) pi))
+ (not (find-if-not #'cl-equal-equivalent-to-eq-p
+ (cl-const-expr-val (pop args) '((1.0 . nil)))
+:key #'cl-car-or-pi)))
+ (cons 'assq (cdr form)))
+ (t form)))
+
+(define-compiler-macro rassoc (&whole form &rest args)
+ (cond
+ ((not (eql (length form) 3))
+ form)
+ ((or (cl-equal-equivalent-to-eq-p (cl-const-expr-val (pop args) pi))
+ (not (find-if-not #'cl-equal-equivalent-to-eq-p
+ (cl-const-expr-val (pop args) '((nil . 1.0)))
:key #'cl-cdr-or-pi)))
- (cons 'rassq (cdr form))
- form))
+ (cons 'rassq (cdr form)))
+ (t form)))
(macrolet
((define-star-compiler-macros (&rest macros)
--
‘Liston operated so fast that he once accidentally amputated an assistant’s
fingers along with a patient’s leg, […] The patient and the assistant both
died of sepsis, and a spectator reportedly died of shock, resulting in the
only known procedure with a 300% mortality.’ (Atul Gawande, NEJM, 2012)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
commit/XEmacs: 4 new changesets
12 years, 1 month
Bitbucket
4 new commits in XEmacs:
https://bitbucket.org/xemacs/xemacs/changeset/b490ddbd42aa/
changeset: b490ddbd42aa
user: kehoea
date: 2012-11-06 22:34:15
summary: Back out 7371081ce8f7, I have a better approach.
affected #: 6 files
diff -r 7b5f88e5b456b61e5108c84079389b2235ee5c77 -r b490ddbd42aab637aa8332b0fc3dbb722f60dc44 lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,10 +1,3 @@
-2012-10-14 Aidan Kehoe <kehoea(a)parhasard.net>
-
- * help.el:
- * help.el (describe-function-1):
- Add some newlines here when dealing with remapped commands, thank
- you Robert Pluim.
-
2012-10-13 Mats Lidell <matsl(a)xemacs.org>
* process.el (call-process-shell-command): New function from GNU.
diff -r 7b5f88e5b456b61e5108c84079389b2235ee5c77 -r b490ddbd42aab637aa8332b0fc3dbb722f60dc44 lisp/help.el
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1544,10 +1544,10 @@
(format "\n\\[%s]" function))))
(when commands-remapped-to
(if (cdr commands-remapped-to)
- (princ (format "\n\nThe following functions are \
+ (princ (format "The following functions are \
remapped to it:\n`%s'" (mapconcat #'prin1-to-string commands-remapped-to
"', `")))
- (princ (format "\n\n`%s' is remapped to it.\n"
+ (princ (format "`%s' is remapped to it.\n"
(car
commands-remapped-to))))))))))))))
diff -r 7b5f88e5b456b61e5108c84079389b2235ee5c77 -r b490ddbd42aab637aa8332b0fc3dbb722f60dc44 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,14 +1,3 @@
-2012-10-14 Aidan Kehoe <kehoea(a)parhasard.net>
-
- Have command remapping work interactively too, thank you Robert
- Pluim.
- * event-stream.c (Fdispatch_event):
- Obey command remapping here, it wasn't done for us.
- * keymap.c:
- * keymap.c (command_remapping_for_event): New, needed to observe
- command remapping interactively.
- * lisp.h: Make it available.
-
2012-10-14 Aidan Kehoe <kehoea(a)parhasard.net>
Respect face and display table information in the minibuffer
diff -r 7b5f88e5b456b61e5108c84079389b2235ee5c77 -r b490ddbd42aab637aa8332b0fc3dbb722f60dc44 src/event-stream.c
--- a/src/event-stream.c
+++ b/src/event-stream.c
@@ -4550,6 +4550,8 @@
int magic_undo = 0;
Elemcount magic_undo_count = 20;
+ Vthis_command = leaf;
+
/* Don't push an undo boundary if the command set the prefix arg,
or if we are executing a keyboard macro, or if in the
minibuffer. If the command we are about to execute is
@@ -4565,8 +4567,6 @@
if (SYMBOLP (leaf))
{
Lisp_Object prop = Fget (leaf, Qself_insert_defer_undo, Qnil);
- Lisp_Object remap = Qnil;
-
if (NATNUMP (prop))
{
magic_undo = 1;
@@ -4587,16 +4587,8 @@
magic_undo = 1;
else if (EQ (leaf, Qself_insert_command))
magic_undo = 1;
-
- remap = command_remapping_for_event (leaf, event);
- if (!NILP (remap))
- {
- leaf = remap;
- }
}
- Vthis_command = leaf;
-
if (!magic_undo)
command_builder->self_insert_countdown = 0;
if (NILP (XCONSOLE (console)->prefix_arg)
diff -r 7b5f88e5b456b61e5108c84079389b2235ee5c77 -r b490ddbd42aab637aa8332b0fc3dbb722f60dc44 src/keymap.c
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -2127,20 +2127,6 @@
return Qnil;
}
-Lisp_Object
-command_remapping_for_event (Lisp_Object command, Lisp_Object event0)
-{
- /* This function can GC */
- Lisp_Object maps[100];
- int nmaps;
-
- nmaps = get_relevant_keymaps (event0, Qnil, countof (maps), maps);
- if (nmaps > countof (maps))
- nmaps = countof (maps);
-
- return command_remapping (command, nmaps, maps);
-}
-
DEFUN ("command-remapping", Fcommand_remapping, 1, 3, 0, /*
Return the remapping for command COMMAND.
diff -r 7b5f88e5b456b61e5108c84079389b2235ee5c77 -r b490ddbd42aab637aa8332b0fc3dbb722f60dc44 src/lisp.h
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -5473,9 +5473,6 @@
EXFUN (Fmake_sparse_keymap, 1);
EXFUN (Fset_keymap_parents, 2);
-Lisp_Object command_remapping_for_event (Lisp_Object command,
- Lisp_Object event0);
-
void where_is_to_char (Lisp_Object, Eistring *);
/* Defined in lread.c */
https://bitbucket.org/xemacs/xemacs/changeset/be87f507f510/
changeset: be87f507f510
user: kehoea
date: 2012-11-06 23:27:15
summary: Handle interactive command remapping a little better than 7371081ce8f7, keymap.c
src/ChangeLog addition:
2012-11-06 Aidan Kehoe <kehoea(a)parhasard.net>
* keymap.c (event_binding):
Do command remapping here for interactive lookups; avoids a
relatively expensive repeated call to get_relevant_keymaps(), as
was necessary in 7371081ce8f7 (which changeset has been backed
out).
lisp/ChangeLog addition:
2012-10-14 Aidan Kehoe <kehoea(a)parhasard.net>
* help.el:
* help.el (describe-function-1):
Add some newlines here when dealing with remapped commands, thank
you Robert Pluim.
affected #: 4 files
diff -r b490ddbd42aab637aa8332b0fc3dbb722f60dc44 -r be87f507f5100953f14b0405f0ccbd825e941fe7 lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,10 @@
+2012-10-14 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * help.el:
+ * help.el (describe-function-1):
+ Add some newlines here when dealing with remapped commands, thank
+ you Robert Pluim.
+
2012-10-13 Mats Lidell <matsl(a)xemacs.org>
* process.el (call-process-shell-command): New function from GNU.
diff -r b490ddbd42aab637aa8332b0fc3dbb722f60dc44 -r be87f507f5100953f14b0405f0ccbd825e941fe7 lisp/help.el
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1544,10 +1544,10 @@
(format "\n\\[%s]" function))))
(when commands-remapped-to
(if (cdr commands-remapped-to)
- (princ (format "The following functions are \
+ (princ (format "\n\nThe following functions are \
remapped to it:\n`%s'" (mapconcat #'prin1-to-string commands-remapped-to
"', `")))
- (princ (format "`%s' is remapped to it.\n"
+ (princ (format "\n\n`%s' is remapped to it.\n"
(car
commands-remapped-to))))))))))))))
diff -r b490ddbd42aab637aa8332b0fc3dbb722f60dc44 -r be87f507f5100953f14b0405f0ccbd825e941fe7 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
+2012-11-06 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * keymap.c (event_binding):
+ Do command remapping here for interactive lookups; avoids a
+ relatively expensive repeated call to get_relevant_keymaps(), as
+ was necessary in 7371081ce8f7 (which changeset has been backed
+ out).
+
2012-10-14 Aidan Kehoe <kehoea(a)parhasard.net>
Respect face and display table information in the minibuffer
diff -r b490ddbd42aab637aa8332b0fc3dbb722f60dc44 -r be87f507f5100953f14b0405f0ccbd825e941fe7 src/keymap.c
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -2996,7 +2996,7 @@
event_binding (Lisp_Object event0, int accept_default)
{
/* This function can GC */
- Lisp_Object maps[100];
+ Lisp_Object maps[100], result;
int nmaps;
assert (EVENTP (event0));
@@ -3004,8 +3004,20 @@
nmaps = get_relevant_keymaps (event0, Qnil, countof (maps), maps);
if (nmaps > countof (maps))
nmaps = countof (maps);
- return process_event_binding_result (lookup_events (event0, nmaps, maps,
- accept_default));
+
+ result = process_event_binding_result (lookup_events (event0, nmaps, maps,
+ accept_default));
+
+ if (!NILP (result) && SYMBOLP (result))
+ {
+ Lisp_Object remap = command_remapping (result, nmaps, maps);
+ if (!NILP (remap))
+ {
+ result = remap;
+ }
+ }
+
+ return result;
}
/* like event_binding, but specify a keymap to search */
https://bitbucket.org/xemacs/xemacs/changeset/4d15e903800b/
changeset: 4d15e903800b
user: kehoea
date: 2012-11-06 23:33:58
summary: Be more careful about erroring with probable GNU-syntax keysyms, keymap.c
src/ChangeLog addition:
2012-11-06 Aidan Kehoe <kehoea(a)parhasard.net>
* keymap.c (define_key_check_and_coerce_keysym):
When worrying about GNU Emacs-like keysym syntax, if the symbol
name starts with c-whatever (or s-whatever, or m-whatever), check
for a function binding for that before erroring. Otherwise command
remapping and C mode interact badly, since most of the C mode
commands are regarded as GNU Emacs-style keysyms.
affected #: 2 files
diff -r be87f507f5100953f14b0405f0ccbd825e941fe7 -r 4d15e903800b152c8f2710467d8e0693dd054570 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
+2012-11-06 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * keymap.c (define_key_check_and_coerce_keysym):
+ When worrying about GNU Emacs-like keysym syntax, if the symbol
+ name starts with c-whatever (or s-whatever, or m-whatever), check
+ for a function binding for that before erroring. Otherwise command
+ remapping and C mode interact badly, since most of the C mode
+ commands are regarded as GNU Emacs-style keysyms.
+
2012-11-06 Aidan Kehoe <kehoea(a)parhasard.net>
* keymap.c (event_binding):
diff -r be87f507f5100953f14b0405f0ccbd825e941fe7 -r 4d15e903800b152c8f2710467d8e0693dd054570 src/keymap.c
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1344,7 +1344,11 @@
sanitize the Sun keyboards, and would make it trickier to
conditionalize a .emacs file for multiple X servers.
*/
- if (((int) qxestrlen (name) >= 2 && name[1] == '-')
+ if (((int) qxestrlen (name) >= 2 && name[1] == '-'
+ /* Check for a function binding if the symbol looks like
+ c-..., otherwise command remapping and C mode interact
+ badly. */
+ && NILP (Ffunctionp (XSYMBOL_FUNCTION (*keysym))))
#if 1
||
/* Ok, this is a bit more dubious - prevent people from doing things
https://bitbucket.org/xemacs/xemacs/changeset/7f4c8574a590/
changeset: 7f4c8574a590
user: kehoea
date: 2012-11-07 00:12:06
summary: No error from an incorrect number of arguments, recently-added compiler macros
lisp/ChangeLog addition:
2012-11-06 Aidan Kehoe <kehoea(a)parhasard.net>
* cl-macs.el (equal, member, assoc, rassoc):
Never error at compile time in these compiler macros because of an
incorrect number of arguments.
affected #: 2 files
diff -r 4d15e903800b152c8f2710467d8e0693dd054570 -r 7f4c8574a590f3e3457bdecf5716aa21a64626c8 lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2012-11-06 Aidan Kehoe <kehoea(a)parhasard.net>
+
+ * cl-macs.el (equal, member, assoc, rassoc):
+ Never error at compile time in these compiler macros because of an
+ incorrect number of arguments.
+
2012-10-14 Aidan Kehoe <kehoea(a)parhasard.net>
* help.el:
diff -r 4d15e903800b152c8f2710467d8e0693dd054570 -r 7f4c8574a590f3e3457bdecf5716aa21a64626c8 lisp/cl-macs.el
--- a/lisp/cl-macs.el
+++ b/lisp/cl-macs.el
@@ -3238,34 +3238,46 @@
(defun cl-cdr-or-pi (object)
(if (consp object) (cdr object) pi))
-(define-compiler-macro equal (&whole form a b)
- (if (or (cl-equal-equivalent-to-eq-p (cl-const-expr-val a pi))
- (cl-equal-equivalent-to-eq-p (cl-const-expr-val b pi)))
- (cons 'eq (cdr form))
- form))
-
-(define-compiler-macro member (&whole form elt list)
- (if (or (cl-equal-equivalent-to-eq-p (cl-const-expr-val elt pi))
- (every #'cl-equal-equivalent-to-eq-p
- (cl-const-expr-val list '(1.0))))
- (cons 'memq (cdr form))
- form))
-
-(define-compiler-macro assoc (&whole form elt list)
- (if (or (cl-equal-equivalent-to-eq-p (cl-const-expr-val elt pi))
- (not (find-if-not #'cl-equal-equivalent-to-eq-p
- (cl-const-expr-val list '((1.0 . nil)))
-:key #'cl-car-or-pi)))
- (cons 'assq (cdr form))
- form))
-
-(define-compiler-macro rassoc (&whole form elt list)
- (if (or (cl-equal-equivalent-to-eq-p (cl-const-expr-val elt pi))
- (not (find-if-not #'cl-equal-equivalent-to-eq-p
- (cl-const-expr-val list '((nil . 1.0)))
+(define-compiler-macro equal (&whole form &rest args)
+ (cond
+ ((not (eql (length form) 3))
+ form)
+ ((or (cl-equal-equivalent-to-eq-p (cl-const-expr-val (pop args) pi))
+ (cl-equal-equivalent-to-eq-p (cl-const-expr-val (pop args) pi)))
+ (cons 'eq (cdr form)))
+ (t form)))
+
+(define-compiler-macro member (&whole form &rest args)
+ (cond
+ ((not (eql (length form) 3))
+ form)
+ ((or (cl-equal-equivalent-to-eq-p (cl-const-expr-val (pop args) pi))
+ (every #'cl-equal-equivalent-to-eq-p
+ (cl-const-expr-val (pop args) '(1.0))))
+ (cons 'memq (cdr form)))
+ (t form)))
+
+(define-compiler-macro assoc (&whole form &rest args)
+ (cond
+ ((not (eql (length form) 3))
+ form)
+ ((or (cl-equal-equivalent-to-eq-p (cl-const-expr-val (pop args) pi))
+ (not (find-if-not #'cl-equal-equivalent-to-eq-p
+ (cl-const-expr-val (pop args) '((1.0 . nil)))
+:key #'cl-car-or-pi)))
+ (cons 'assq (cdr form)))
+ (t form)))
+
+(define-compiler-macro rassoc (&whole form &rest args)
+ (cond
+ ((not (eql (length form) 3))
+ form)
+ ((or (cl-equal-equivalent-to-eq-p (cl-const-expr-val (pop args) pi))
+ (not (find-if-not #'cl-equal-equivalent-to-eq-p
+ (cl-const-expr-val (pop args) '((nil . 1.0)))
:key #'cl-cdr-or-pi)))
- (cons 'rassq (cdr form))
- form))
+ (cons 'rassq (cdr form)))
+ (t form)))
(macrolet
((define-star-compiler-macros (&rest macros)
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches