[AC] Auctex texinfo fixes
                
            
            
                11 years, 4 months
            
            
                
                    
                    
                    
                    
                    Michael Sperber
                
 
                
                    
                        
                            
Before this patch, Texinfo 5.2 would barf.  I've pushed this one.
2014-07-05  Michael Sperber  <mike(a)xemacs.org>
	* doc/quickstart.texi (Editing): 
	* doc/preview-latex.texi (The preview images): 
	* doc/auctex.texi (Font Specifiers): Texinfo 5.2 fixes.
-- 
Regards,
Mike
diff --git a/doc/auctex.texi b/doc/auctex.texi
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -413,7 +413,7 @@
 @item C-c C-f C-f
 @kindex C-c C-f C-f
 @cindex @code{\textsf}
-Insert @sans{sans serif} @samp{\textsf@{@point{}@}} text.
+Insert @sansserif{sans serif} @samp{\textsf@{@point{}@}} text.
 
 @item C-c C-f C-t
 @kindex C-c C-f C-t
diff --git a/doc/preview-latex.texi b/doc/preview-latex.texi
--- a/doc/preview-latex.texi
+++ b/doc/preview-latex.texi
@@ -698,8 +698,9 @@
 customizable concerning aspects of that operation, see the customization
 group @code{Preview Gs} for this.
 
+@pindex dvipng
 Another noteworthy setting of @code{preview-image-type} is
-@samp{dvipng}: in this case, the @samp{dvipng}@pindex{dvipng} program
+@samp{dvipng}: in this case, the @samp{dvipng} program
 will get run on @acronym{DVI} output (see below for @acronym{PDF}).
 This is in general much faster than Dvips and Ghostscript.  In that
 case, the option
diff --git a/doc/quickstart.texi b/doc/quickstart.texi
--- a/doc/quickstart.texi
+++ b/doc/quickstart.texi
@@ -163,7 +163,7 @@
 @item C-c C-f C-f
 @kindex C-c C-f C-f
 @cindex @code{\textsf}
-Insert  @sans{sans serif} @samp{\textsf@{@point{}@}} text.
+Insert  @sansserif{sans serif} @samp{\textsf@{@point{}@}} text.
 
 @item C-c C-f C-t
 @kindex C-c C-f C-t
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
                        
                     
                    
                 
             
         
        
        
            
        
        
            
                
                    
                    
                    commit/auctex: sperber: Texinfo 5.2 fixes.
                
            
            
                11 years, 4 months
            
            
                
                    
                    
                    
                    
                    Bitbucket
                
 
                
                    
                        
                            1 new commit in auctex:
https://bitbucket.org/xemacs/auctex/commits/cb9c5f778ee9/
Changeset:   cb9c5f778ee9
User:        sperber
Date:        2014-07-05 14:30:06
Summary:     Texinfo 5.2 fixes.
2014-07-05  Michael Sperber  <mike(a)xemacs.org>
	* doc/quickstart.texi (Editing):
	* doc/preview-latex.texi (The preview images):
	* doc/auctex.texi (Font Specifiers): Texinfo 5.2 fixes.
Affected #:  4 files
diff -r d9365419a59d0d65c2d8fb2931a2d72a0d1e792a -r cb9c5f778ee94e2bdb6fbf90a0250574e4ac144b ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-07-05  Michael Sperber  <mike(a)xemacs.org>
+
+	* doc/quickstart.texi (Editing): 
+	* doc/preview-latex.texi (The preview images): 
+	* doc/auctex.texi (Font Specifiers): Texinfo 5.2 fixes.
+
 2014-06-29  Norbert Koch  <viteno(a)xemacs.org>
 
 	* Makefile (VERSION): XEmacs package 1.52 released.
diff -r d9365419a59d0d65c2d8fb2931a2d72a0d1e792a -r cb9c5f778ee94e2bdb6fbf90a0250574e4ac144b doc/auctex.texi
--- a/doc/auctex.texi
+++ b/doc/auctex.texi
@@ -413,7 +413,7 @@
 @item C-c C-f C-f
 @kindex C-c C-f C-f
 @cindex @code{\textsf}
-Insert @sans{sans serif} @samp{\textsf@{@point{}@}} text.
+Insert @sansserif{sans serif} @samp{\textsf@{@point{}@}} text.
 
 @item C-c C-f C-t
 @kindex C-c C-f C-t
diff -r d9365419a59d0d65c2d8fb2931a2d72a0d1e792a -r cb9c5f778ee94e2bdb6fbf90a0250574e4ac144b doc/preview-latex.texi
--- a/doc/preview-latex.texi
+++ b/doc/preview-latex.texi
@@ -698,8 +698,9 @@
 customizable concerning aspects of that operation, see the customization
 group @code{Preview Gs} for this.
 
+@pindex dvipng
 Another noteworthy setting of @code{preview-image-type} is
-@samp{dvipng}: in this case, the @samp{dvipng}@pindex{dvipng} program
+@samp{dvipng}: in this case, the @samp{dvipng} program
 will get run on @acronym{DVI} output (see below for @acronym{PDF}).
 This is in general much faster than Dvips and Ghostscript.  In that
 case, the option
diff -r d9365419a59d0d65c2d8fb2931a2d72a0d1e792a -r cb9c5f778ee94e2bdb6fbf90a0250574e4ac144b doc/quickstart.texi
--- a/doc/quickstart.texi
+++ b/doc/quickstart.texi
@@ -163,7 +163,7 @@
 @item C-c C-f C-f
 @kindex C-c C-f C-f
 @cindex @code{\textsf}
-Insert  @sans{sans serif} @samp{\textsf@{@point{}@}} text.
+Insert  @sansserif{sans serif} @samp{\textsf@{@point{}@}} text.
 
 @item C-c C-f C-t
 @kindex C-c C-f C-t
Repository URL: https://bitbucket.org/xemacs/auctex/
--
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
                        
                     
                    
                 
             
         
        
        
            
        
        
            
                
                    
                    
                    Re: [COMMIT] Autoload within #'keymapp, as documented.
                
            
            
                11 years, 4 months
            
            
                
                    
                    
                    
                    
                    Aidan Kehoe
                
 
                
                    
                        
                            
 Ar an triú lá de mí Iúil, scríobh Stephen J. Turnbull: 
 > Aidan Kehoe writes:
 > 
 >  > I’d welcome discussion on this.
 > 
 > What's to discuss?  AFAICS your patch fixes a bug.  Autoloads are
 > supposed to be transparent to callers.  If something that autoloads
 > would be keymapp after loading, it should be keymapp even though it
 > hasn't been loaded yet.
Good!
An alternative would be what #'functionp does, which is return t for
autoload objects without loading them. But, it’s currently documented as
autoloading and that’s what the other code assumes.
 > If you think there may be applications that want to know if something
 > is an autoload, we could defun #'autoloadp.
 > 
 >  > src/ChangeLog addition:
 >  > 
 >  > 2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
 >  > 
 >  > 	* keymap.c (Fkeymapp):
 >  > 	Autoload within this, as documented. Our callers are not prepared
 >  > 	to do the intelligent thing if a symbol that is fboundp to an
 >  > 	autoloaded keymap, is not itself #'keymapp.
-- 
‘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] Autoload within #'keymapp, as documented.
                
            
            
                11 years, 4 months
            
            
                
                    
                    
                    
                    
                    Aidan Kehoe
                
 
                
                    
                        
                            
I’d welcome discussion on this. E.g in extents.c:5448, an extent’s keymap
must have #'keymapp give non-nil, so autoloaded keymaps don’t work;
keymap.c:773 maps using keymap_submaps_mapper_0 to force loading of those
maps to be autoloaded, and that doesn’t work; as far as I can see, mapping
across autoloaded submaps hasn’t worked since 1997.
APPROVE COMMIT
Note: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1404319549 -3600
#      Wed Jul 02 17:45:49 2014 +0100
# Node ID 236e4afc565dcd32516d0946525c2c63397573c3
# Parent  0e9f791cc6558e3dba92ffff659d331138f1431e
Autoload within #'keymapp, as documented.
src/ChangeLog addition:
2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
	* keymap.c (Fkeymapp):
	Autoload within this, as documented. Our callers are not prepared
	to do the intelligent thing if a symbol that is fboundp to an
	autoloaded keymap, is not itself #'keymapp.
lisp/ChangeLog addition:
2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
	* byte-optimize.el (side-effect-free-fns):
	#'keymapp is not side-effect-free, it can autoload.
diff -r 0e9f791cc655 -r 236e4afc565d lisp/ChangeLog
--- a/lisp/ChangeLog	Wed Jul 02 16:32:19 2014 +0100
+++ b/lisp/ChangeLog	Wed Jul 02 17:45:49 2014 +0100
@@ -1,3 +1,8 @@
+2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* byte-optimize.el (side-effect-free-fns):
+	#'keymapp is not side-effect-free, it can autoload.
+
 2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	* cmdloop.el:
diff -r 0e9f791cc655 -r 236e4afc565d lisp/byte-optimize.el
--- a/lisp/byte-optimize.el	Wed Jul 02 16:32:19 2014 +0100
+++ b/lisp/byte-optimize.el	Wed Jul 02 17:45:49 2014 +0100
@@ -1340,7 +1340,7 @@
 	 hash-table-p
 	 identity ignore integerp integer-or-marker-p interactive-p
 	 invocation-directory invocation-name
-	 keymapp list list* listp
+	 list list* listp
 	 make-marker mark mark-marker markerp memory-limit minibuffer-window
 	 ;; mouse-movement-p not in XEmacs
 	 natnump nlistp not null number-or-marker-p numberp
diff -r 0e9f791cc655 -r 236e4afc565d src/ChangeLog
--- a/src/ChangeLog	Wed Jul 02 16:32:19 2014 +0100
+++ b/src/ChangeLog	Wed Jul 02 17:45:49 2014 +0100
@@ -1,3 +1,10 @@
+2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* keymap.c (Fkeymapp):
+	Autoload within this, as documented. Our callers are not prepared
+	to do the intelligent thing if a symbol that is fboundp to an
+	autoloaded keymap, is not itself #'keymapp.
+
 2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	* event-stream.c (Fnext_command_event):
diff -r 0e9f791cc655 -r 236e4afc565d src/keymap.c
--- a/src/keymap.c	Wed Jul 02 16:32:19 2014 +0100
+++ b/src/keymap.c	Wed Jul 02 17:45:49 2014 +0100
@@ -1008,7 +1008,7 @@
        (object))
 {
   /* This function can GC */
-  return KEYMAPP (get_keymap (object, 0, 0)) ? Qt : Qnil;
+  return KEYMAPP (get_keymap (object, 0, 1)) ? Qt : Qnil;
 }
 
 /* Check that OBJECT is a keymap (after dereferencing through any
-- 
‘Liston operated so fast that he once accidentally amputated an assistant’s 
fingers along with a patient’s leg, […] The patient and the assistant both 
died of sepsis, and a spectator reportedly died of shock, resulting in the 
only known procedure with a 300% mortality.’ (Atul Gawande, NEJM, 2012)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
                        
                     
                    
                 
             
         
        
        
            
        
        
            
                
                    
                    
                    commit/XEmacs: kehoea: Autoload within #'keymapp, as documented.
                
            
            
                11 years, 4 months
            
            
                
                    
                    
                    
                    
                    Bitbucket
                
 
                
                    
                        
                            1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/236e4afc565d/
Changeset:   236e4afc565d
User:        kehoea
Date:        2014-07-02 18:45:49
Summary:     Autoload within #'keymapp, as documented.
src/ChangeLog addition:
2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
	* keymap.c (Fkeymapp):
	Autoload within this, as documented. Our callers are not prepared
	to do the intelligent thing if a symbol that is fboundp to an
	autoloaded keymap, is not itself #'keymapp.
lisp/ChangeLog addition:
2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
	* byte-optimize.el (side-effect-free-fns):
	#'keymapp is not side-effect-free, it can autoload.
Affected #:  4 files
diff -r 0e9f791cc6558e3dba92ffff659d331138f1431e -r 236e4afc565dcd32516d0946525c2c63397573c3 lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* byte-optimize.el (side-effect-free-fns):
+	#'keymapp is not side-effect-free, it can autoload.
+
 2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	* cmdloop.el:
diff -r 0e9f791cc6558e3dba92ffff659d331138f1431e -r 236e4afc565dcd32516d0946525c2c63397573c3 lisp/byte-optimize.el
--- a/lisp/byte-optimize.el
+++ b/lisp/byte-optimize.el
@@ -1340,7 +1340,7 @@
 	 hash-table-p
 	 identity ignore integerp integer-or-marker-p interactive-p
 	 invocation-directory invocation-name
-	 keymapp list list* listp
+	 list list* listp
 	 make-marker mark mark-marker markerp memory-limit minibuffer-window
 	 ;; mouse-movement-p not in XEmacs
 	 natnump nlistp not null number-or-marker-p numberp
diff -r 0e9f791cc6558e3dba92ffff659d331138f1431e -r 236e4afc565dcd32516d0946525c2c63397573c3 src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,10 @@
+2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* keymap.c (Fkeymapp):
+	Autoload within this, as documented. Our callers are not prepared
+	to do the intelligent thing if a symbol that is fboundp to an
+	autoloaded keymap, is not itself #'keymapp.
+
 2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
 
 	* event-stream.c (Fnext_command_event):
diff -r 0e9f791cc6558e3dba92ffff659d331138f1431e -r 236e4afc565dcd32516d0946525c2c63397573c3 src/keymap.c
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -1008,7 +1008,7 @@
        (object))
 {
   /* This function can GC */
-  return KEYMAPP (get_keymap (object, 0, 0)) ? Qt : Qnil;
+  return KEYMAPP (get_keymap (object, 0, 1)) ? Qt : Qnil;
 }
 
 /* Check that OBJECT is a keymap (after dereferencing through any
Repository URL: https://bitbucket.org/xemacs/xemacs/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
                        
                     
                    
                 
             
         
        
        
            
        
        
            
                
                    
                    
                    [COMMIT] Support `function-key-map' in #'read-char{, -exclusive}, sync API with GNU
                
            
            
                11 years, 4 months
            
            
                
                    
                    
                    
                    
                    Aidan Kehoe
                
 
                
                    
                        
                            
APPROVE COMMIT
NOTE: This patch has been committed.
# HG changeset patch
# User Aidan Kehoe <kehoea(a)parhasard.net>
# Date 1404315139 -3600
#      Wed Jul 02 16:32:19 2014 +0100
# Node ID 0e9f791cc6558e3dba92ffff659d331138f1431e
# Parent  be3ca9e58c92a68d414210b217a4eef5bb6ea9d5
Support `function-key-map' in #'read-char{,-exclusive}, sync API with GNU
lisp/ChangeLog addition:
2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
	* cmdloop.el:
	* cmdloop.el (read-char-1): New.
	* cmdloop.el (read-char, read-char-exclusive):
	Use #'read-char-1 in these function; sync their API with that of
	GNU, respect `function-key-map' where we didn't before, add
	initial support for Quail input methods.
	* keymap.el (next-key-event):
	Accept EVENT and PROMPT arguments, as does #'next-command-event.
	* keymap.el (event-apply-modifiers):
	Use #'functionp here, no need to exclude lambdas from
	`function-key-map'.
	* keymap.el (synthesize-keysym):
	Correct this function's docstring.
src/ChangeLog addition:
2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
	* event-stream.c (Fnext_command_event):
	Only snooze displaying keystrokes if PROMPT is nil. If prompt is
	non-nil, our callers want to see it.
diff -r be3ca9e58c92 -r 0e9f791cc655 lisp/ChangeLog
--- a/lisp/ChangeLog	Thu Jun 19 12:06:33 2014 +0900
+++ b/lisp/ChangeLog	Wed Jul 02 16:32:19 2014 +0100
@@ -1,3 +1,19 @@
+2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* cmdloop.el:
+	* cmdloop.el (read-char-1): New.
+	* cmdloop.el (read-char, read-char-exclusive):
+	Use #'read-char-1 in these function; sync their API with that of
+	GNU, respect `function-key-map' where we didn't before, add
+	initial support for Quail input methods.
+	* keymap.el (next-key-event):
+	Accept EVENT and PROMPT arguments, as does #'next-command-event.
+	* keymap.el (event-apply-modifiers):
+	Use #'functionp here, no need to exclude lambdas from
+	`function-key-map'.
+	* keymap.el (synthesize-keysym):
+	Correct this function's docstring.
+
 2014-04-19  Mats Lidell  <matsl(a)xemacs.org>
 
 	* help.el: Sync from GNU - Link to customize if applicable and
diff -r be3ca9e58c92 -r 0e9f791cc655 lisp/cmdloop.el
--- a/lisp/cmdloop.el	Thu Jun 19 12:06:33 2014 +0900
+++ b/lisp/cmdloop.el	Wed Jul 02 16:32:19 2014 +0100
@@ -520,43 +520,120 @@
     (y-or-n-p-minibuf prompt)))
 
 
+(labels
+    ((read-char-1 (errorp prompt inherit-input-method seconds)
+       "Return a character from command input or the current macro.
+Look up said input in `function-key-map' as appropriate.
 
-(defun read-char ()
-  "Read a character from the command input (keyboard or macro).
-If a mouse click or non-ASCII character is detected, an error is
-signalled.  The character typed is returned as an ASCII value.  This
-is most likely the wrong thing for you to be using: consider using
-the `next-command-event' function instead."
-  (save-excursion
-    (let ((event (next-command-event)))
-      (or inhibit-quit
-	  (and (event-matches-key-specifier-p event (quit-char))
-	       (signal 'quit nil)))
-      (prog1 (or (event-to-character event)
-                 ;; Kludge.  If the event we read was a mouse-release,
-                 ;; discard it and read the next one.
-                 (if (button-release-event-p event)
-                     (event-to-character (next-command-event event)))
-                 (error "Key read has no ASCII equivalent %S" event))
-        ;; this is not necessary, but is marginally more efficient than GC.
-        (deallocate-event event)))))
+PROMPT is a prompt for `next-command-event', which see.
 
-(defun read-char-exclusive ()
-  "Read a character from the command input (keyboard or macro).
-If a mouse click or non-ASCII character is detected, it is discarded.
-The character typed is returned as an ASCII value.  This is most likely
-the wrong thing for you to be using: consider using the
-`next-command-event' function instead."
-  (let (event ch)
-    (while (progn
-	     (setq event (next-command-event))
-	     (or inhibit-quit
-		 (and (event-matches-key-specifier-p event (quit-char))
-		      (signal 'quit nil)))
-	     (setq ch (event-to-character event))
-	     (deallocate-event event)
-	     (null ch)))
-    ch))
+If ERRORP is non-nil, error if the key sequence has no character equivalent.
+Otherwise, loop, discarding non-character keystrokes or mouse movements.
+
+If INHERIT-INPUT-METHOD is non-nil, and a Quail input method is active in
+the current buffer, use its translation when choosing a character to return.
+
+If SECONDS is non-nil, only wait that number of seconds for input. If no
+input is received in that time, return nil."
+       (let ((timeout
+              (if seconds
+                  (add-timeout seconds #'(lambda (ignore)
+                                           (return-from read-char-1 nil))
+                               nil)))
+             (events []) binding character)
+         (unwind-protect
+              (while t
+                ;; Read keystrokes scanning `function-key-map'.
+                (while (keymapp
+                        (setq binding
+                              (lookup-key
+                               function-key-map
+                               (setq events
+                                     (vconcat events (list
+                                                      (next-key-event
+                                                       nil prompt))))))))
+                (when binding
+                  ;; Found something in function-key-map. If it's a function
+                  ;; (e.g. synthesize-keysym), call it.
+                  (if (functionp binding)
+                      (setq binding (funcall binding nil)))
+                  (setq events (map 'vector #'character-to-event binding)))
+                ;; Put the remaining keystrokes back on the input queue.
+                (setq unread-command-events
+                      (nconc (reduce #'cons events :start 1 :from-end t
+:initial-value nil)
+                             unread-command-events))
+                (unless inhibit-quit
+                  (and (event-matches-key-specifier-p (aref events 0)
+                                                      (quit-char))
+                       (signal 'quit nil)))
+                (if (setq character (event-to-character (aref events 0)))
+                    (progn
+                      ;; If we have a character (the usual case), deallocate
+                      ;; the event and return the character.
+                      (deallocate-event (aref events 0))
+                      ;; Handle quail, if we've been asked to (maybe we
+                      ;; should default to this).
+                      (if (and inherit-input-method (and-boundp 'quail-mode
+                                                      quail-mode))
+                          (with-fboundp
+                              '(quail-map-definition quail-lookup-key)
+                            (let ((binding
+                                   (quail-map-definition
+                                    (quail-lookup-key (string character)))))
+                              (if (characterp binding)
+                                  (return-from read-char-1 binding))
+                              ;; #### Bug, we don't allow users to select from
+                              ;; among multiple characters that may be input
+                              ;; with the same key sequence.
+                              (if (and (consp binding)
+                                       (characterp
+                                        (aref (cdr binding) (caar binding))))
+                                  (return-from read-char-1
+                                    (aref (cdr binding) (caar binding)))))))
+                      (return-from read-char-1 character)))
+                (if errorp
+                    (error 'invalid-key-binding "Not a character keystroke"
+                           (aref events 0)))
+                ;; If we're not erroring, loop until we get a character
+                (setq events []))
+           (if timeout (disable-timeout timeout))))))
+  ;; Because of byte compiler limitations, each function has its own copy of
+  ;; #'read-char-1, so why not inline it.
+  (declare (inline read-char-1))
+
+  (defun read-char (&optional prompt inherit-input-method seconds)
+    "Read a character from the command input (keyboard or macro).
+If a mouse click or non-character keystroke is detected, signal an error.
+The character typed is returned as a Lisp object.  This is most likely the
+wrong thing for you to be using: consider using the `next-command-event'
+function instead.
+
+PROMPT is a prompt, as used by `next-command-event'.
+
+If INHERIT-INPUT-METHOD is non-nil, and a Quail input method is active in
+the current buffer, use its translation for the character returned.
+
+If SECONDS is non-nil, only wait that number of seconds for input. If no
+input is received in that time, return nil."
+    (read-char-1 t prompt inherit-input-method seconds))
+
+  (defun read-char-exclusive (&optional prompt inherit-input-method seconds)
+    "Read a character from the command input (keyboard or macro).
+
+If a mouse click or a non-character keystroke is detected, it is discarded.
+The character typed is returned as a Lisp object. This is most likely the
+wrong thing for you to be using: consider using the `next-command-event'
+function instead.
+
+PROMPT is a prompt, as used by `next-command-event'.
+
+If INHERIT-INPUT-METHOD is non-nil, and a Quail input method is active in
+the current buffer, use its translation for the character returned.
+
+If SECONDS is non-nil, only wait that number of seconds for input. If no
+input is received in that time, return nil."
+    (read-char-1 nil prompt inherit-input-method seconds)))
 
 ;;;; Input and display facilities.
 
diff -r be3ca9e58c92 -r 0e9f791cc655 lisp/keymap.el
--- a/lisp/keymap.el	Thu Jun 19 12:06:33 2014 +0900
+++ b/lisp/keymap.el	Wed Jul 02 16:32:19 2014 +0100
@@ -381,12 +381,12 @@
             (setq i (1+ i)))
           new))))
 
-(defun next-key-event ()
+(defun next-key-event (&optional event prompt)
   "Return the next available keyboard event."
-  (let (event)
-    (while (not (key-press-event-p (setq event (next-command-event))))
-      (dispatch-event event))
-    event))
+  (while (not (key-press-event-p
+               (setq event (next-command-event event prompt))))
+    (dispatch-event event))
+  event)
 
 (defun key-sequence-list-description (keys)
   "Convert a key sequence KEYS to the full [(modifiers... key)...] form.
@@ -457,7 +457,7 @@
     (if binding				; found a binding
 	(progn
 	  ;; allow for several modifiers
-	  (if (and (symbolp binding) (fboundp binding))
+	  (if (functionp binding)
 	      (setq binding (funcall binding nil)))
 	  (setq events (append binding nil))
 	  ;; put remaining keystrokes back into input queue
@@ -477,9 +477,9 @@
   (event-apply-modifiers (list symbol)))
 
 (defun synthesize-keysym (ignore-prompt)
-  "Read a sequence of keys, and returned the corresponding key symbol.
-The characters must be from the [-_a-zA-Z0-9].  Reading is terminated
- by RET (which is discarded)."
+  "Read a sequence of characters, and return the corresponding keysym.
+The characters must be ?-, or ?_, or have word syntax.  Reading is
+terminated by RET (which is discarded)."
   (let ((continuep t)
 	event char list)
     (while continuep
diff -r be3ca9e58c92 -r 0e9f791cc655 src/ChangeLog
--- a/src/ChangeLog	Thu Jun 19 12:06:33 2014 +0900
+++ b/src/ChangeLog	Wed Jul 02 16:32:19 2014 +0100
@@ -1,3 +1,9 @@
+2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* event-stream.c (Fnext_command_event):
+	Only snooze displaying keystrokes if PROMPT is nil. If prompt is
+	non-nil, our callers want to see it.
+
 2014-06-19  Stephen J. Turnbull  <stephen(a)xemacs.org>
 
 	* buffer.c (case_fold_search): Improve docstring.
diff -r be3ca9e58c92 -r 0e9f791cc655 src/event-stream.c
--- a/src/event-stream.c	Thu Jun 19 12:06:33 2014 +0900
+++ b/src/event-stream.c	Wed Jul 02 16:32:19 2014 +0100
@@ -2436,7 +2436,11 @@
    
   maybe_echo_keys (XCOMMAND_BUILDER
 		   (XCONSOLE (Vselected_console)->
-		    command_builder), 0); /* #### This sucks bigtime */
+		    command_builder),
+                   /* Only snooze displaying keystrokes if we don't have a
+                      prompt. (If we have a prompt, our callers want us to
+                      show it!) */
+                   !NILP (prompt));
 
   for (;;)
     {
-- 
‘Liston operated so fast that he once accidentally amputated an assistant’s 
fingers along with a patient’s leg, […] The patient and the assistant both 
died of sepsis, and a spectator reportedly died of shock, resulting in the 
only known procedure with a 300% mortality.’ (Atul Gawande, NEJM, 2012)
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://lists.xemacs.org/mailman/listinfo/xemacs-patches
                        
                     
                    
                 
             
         
        
        
            
        
        
            
                
                    
                    
                    commit/XEmacs: kehoea: Support `function-key-map' in #'read-char{, -exclusive}, sync API with GNU
                
            
            
                11 years, 4 months
            
            
                
                    
                    
                    
                    
                    Bitbucket
                
 
                
                    
                        
                            1 new commit in XEmacs:
https://bitbucket.org/xemacs/xemacs/commits/0e9f791cc655/
Changeset:   0e9f791cc655
User:        kehoea
Date:        2014-07-02 17:32:19
Summary:     Support `function-key-map' in #'read-char{,-exclusive}, sync API with GNU
lisp/ChangeLog addition:
2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
	* cmdloop.el:
	* cmdloop.el (read-char-1): New.
	* cmdloop.el (read-char, read-char-exclusive):
	Use #'read-char-1 in these function; sync their API with that of
	GNU, respect `function-key-map' where we didn't before, add
	initial support for Quail input methods.
	* keymap.el (next-key-event):
	Accept EVENT and PROMPT arguments, as does #'next-command-event.
	* keymap.el (event-apply-modifiers):
	Use #'functionp here, no need to exclude lambdas from
	`function-key-map'.
	* keymap.el (synthesize-keysym):
	Correct this function's docstring.
src/ChangeLog addition:
2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
	* event-stream.c (Fnext_command_event):
	Only snooze displaying keystrokes if PROMPT is nil. If prompt is
	non-nil, our callers want to see it.
Affected #:  5 files
diff -r be3ca9e58c92a68d414210b217a4eef5bb6ea9d5 -r 0e9f791cc6558e3dba92ffff659d331138f1431e lisp/ChangeLog
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,19 @@
+2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* cmdloop.el:
+	* cmdloop.el (read-char-1): New.
+	* cmdloop.el (read-char, read-char-exclusive):
+	Use #'read-char-1 in these function; sync their API with that of
+	GNU, respect `function-key-map' where we didn't before, add
+	initial support for Quail input methods.
+	* keymap.el (next-key-event):
+	Accept EVENT and PROMPT arguments, as does #'next-command-event.
+	* keymap.el (event-apply-modifiers):
+	Use #'functionp here, no need to exclude lambdas from
+	`function-key-map'.
+	* keymap.el (synthesize-keysym):
+	Correct this function's docstring.
+
 2014-04-19  Mats Lidell  <matsl(a)xemacs.org>
 
 	* help.el: Sync from GNU - Link to customize if applicable and
diff -r be3ca9e58c92a68d414210b217a4eef5bb6ea9d5 -r 0e9f791cc6558e3dba92ffff659d331138f1431e lisp/cmdloop.el
--- a/lisp/cmdloop.el
+++ b/lisp/cmdloop.el
@@ -520,43 +520,120 @@
     (y-or-n-p-minibuf prompt)))
 
 
+(labels
+    ((read-char-1 (errorp prompt inherit-input-method seconds)
+       "Return a character from command input or the current macro.
+Look up said input in `function-key-map' as appropriate.
 
-(defun read-char ()
-  "Read a character from the command input (keyboard or macro).
-If a mouse click or non-ASCII character is detected, an error is
-signalled.  The character typed is returned as an ASCII value.  This
-is most likely the wrong thing for you to be using: consider using
-the `next-command-event' function instead."
-  (save-excursion
-    (let ((event (next-command-event)))
-      (or inhibit-quit
-	  (and (event-matches-key-specifier-p event (quit-char))
-	       (signal 'quit nil)))
-      (prog1 (or (event-to-character event)
-                 ;; Kludge.  If the event we read was a mouse-release,
-                 ;; discard it and read the next one.
-                 (if (button-release-event-p event)
-                     (event-to-character (next-command-event event)))
-                 (error "Key read has no ASCII equivalent %S" event))
-        ;; this is not necessary, but is marginally more efficient than GC.
-        (deallocate-event event)))))
+PROMPT is a prompt for `next-command-event', which see.
 
-(defun read-char-exclusive ()
-  "Read a character from the command input (keyboard or macro).
-If a mouse click or non-ASCII character is detected, it is discarded.
-The character typed is returned as an ASCII value.  This is most likely
-the wrong thing for you to be using: consider using the
-`next-command-event' function instead."
-  (let (event ch)
-    (while (progn
-	     (setq event (next-command-event))
-	     (or inhibit-quit
-		 (and (event-matches-key-specifier-p event (quit-char))
-		      (signal 'quit nil)))
-	     (setq ch (event-to-character event))
-	     (deallocate-event event)
-	     (null ch)))
-    ch))
+If ERRORP is non-nil, error if the key sequence has no character equivalent.
+Otherwise, loop, discarding non-character keystrokes or mouse movements.
+
+If INHERIT-INPUT-METHOD is non-nil, and a Quail input method is active in
+the current buffer, use its translation when choosing a character to return.
+
+If SECONDS is non-nil, only wait that number of seconds for input. If no
+input is received in that time, return nil."
+       (let ((timeout
+              (if seconds
+                  (add-timeout seconds #'(lambda (ignore)
+                                           (return-from read-char-1 nil))
+                               nil)))
+             (events []) binding character)
+         (unwind-protect
+              (while t
+                ;; Read keystrokes scanning `function-key-map'.
+                (while (keymapp
+                        (setq binding
+                              (lookup-key
+                               function-key-map
+                               (setq events
+                                     (vconcat events (list
+                                                      (next-key-event
+                                                       nil prompt))))))))
+                (when binding
+                  ;; Found something in function-key-map. If it's a function
+                  ;; (e.g. synthesize-keysym), call it.
+                  (if (functionp binding)
+                      (setq binding (funcall binding nil)))
+                  (setq events (map 'vector #'character-to-event binding)))
+                ;; Put the remaining keystrokes back on the input queue.
+                (setq unread-command-events
+                      (nconc (reduce #'cons events :start 1 :from-end t
+:initial-value nil)
+                             unread-command-events))
+                (unless inhibit-quit
+                  (and (event-matches-key-specifier-p (aref events 0)
+                                                      (quit-char))
+                       (signal 'quit nil)))
+                (if (setq character (event-to-character (aref events 0)))
+                    (progn
+                      ;; If we have a character (the usual case), deallocate
+                      ;; the event and return the character.
+                      (deallocate-event (aref events 0))
+                      ;; Handle quail, if we've been asked to (maybe we
+                      ;; should default to this).
+                      (if (and inherit-input-method (and-boundp 'quail-mode
+                                                      quail-mode))
+                          (with-fboundp
+                              '(quail-map-definition quail-lookup-key)
+                            (let ((binding
+                                   (quail-map-definition
+                                    (quail-lookup-key (string character)))))
+                              (if (characterp binding)
+                                  (return-from read-char-1 binding))
+                              ;; #### Bug, we don't allow users to select from
+                              ;; among multiple characters that may be input
+                              ;; with the same key sequence.
+                              (if (and (consp binding)
+                                       (characterp
+                                        (aref (cdr binding) (caar binding))))
+                                  (return-from read-char-1
+                                    (aref (cdr binding) (caar binding)))))))
+                      (return-from read-char-1 character)))
+                (if errorp
+                    (error 'invalid-key-binding "Not a character keystroke"
+                           (aref events 0)))
+                ;; If we're not erroring, loop until we get a character
+                (setq events []))
+           (if timeout (disable-timeout timeout))))))
+  ;; Because of byte compiler limitations, each function has its own copy of
+  ;; #'read-char-1, so why not inline it.
+  (declare (inline read-char-1))
+
+  (defun read-char (&optional prompt inherit-input-method seconds)
+    "Read a character from the command input (keyboard or macro).
+If a mouse click or non-character keystroke is detected, signal an error.
+The character typed is returned as a Lisp object.  This is most likely the
+wrong thing for you to be using: consider using the `next-command-event'
+function instead.
+
+PROMPT is a prompt, as used by `next-command-event'.
+
+If INHERIT-INPUT-METHOD is non-nil, and a Quail input method is active in
+the current buffer, use its translation for the character returned.
+
+If SECONDS is non-nil, only wait that number of seconds for input. If no
+input is received in that time, return nil."
+    (read-char-1 t prompt inherit-input-method seconds))
+
+  (defun read-char-exclusive (&optional prompt inherit-input-method seconds)
+    "Read a character from the command input (keyboard or macro).
+
+If a mouse click or a non-character keystroke is detected, it is discarded.
+The character typed is returned as a Lisp object. This is most likely the
+wrong thing for you to be using: consider using the `next-command-event'
+function instead.
+
+PROMPT is a prompt, as used by `next-command-event'.
+
+If INHERIT-INPUT-METHOD is non-nil, and a Quail input method is active in
+the current buffer, use its translation for the character returned.
+
+If SECONDS is non-nil, only wait that number of seconds for input. If no
+input is received in that time, return nil."
+    (read-char-1 nil prompt inherit-input-method seconds)))
 
 ;;;; Input and display facilities.
 
diff -r be3ca9e58c92a68d414210b217a4eef5bb6ea9d5 -r 0e9f791cc6558e3dba92ffff659d331138f1431e lisp/keymap.el
--- a/lisp/keymap.el
+++ b/lisp/keymap.el
@@ -381,12 +381,12 @@
             (setq i (1+ i)))
           new))))
 
-(defun next-key-event ()
+(defun next-key-event (&optional event prompt)
   "Return the next available keyboard event."
-  (let (event)
-    (while (not (key-press-event-p (setq event (next-command-event))))
-      (dispatch-event event))
-    event))
+  (while (not (key-press-event-p
+               (setq event (next-command-event event prompt))))
+    (dispatch-event event))
+  event)
 
 (defun key-sequence-list-description (keys)
   "Convert a key sequence KEYS to the full [(modifiers... key)...] form.
@@ -457,7 +457,7 @@
     (if binding				; found a binding
 	(progn
 	  ;; allow for several modifiers
-	  (if (and (symbolp binding) (fboundp binding))
+	  (if (functionp binding)
 	      (setq binding (funcall binding nil)))
 	  (setq events (append binding nil))
 	  ;; put remaining keystrokes back into input queue
@@ -477,9 +477,9 @@
   (event-apply-modifiers (list symbol)))
 
 (defun synthesize-keysym (ignore-prompt)
-  "Read a sequence of keys, and returned the corresponding key symbol.
-The characters must be from the [-_a-zA-Z0-9].  Reading is terminated
- by RET (which is discarded)."
+  "Read a sequence of characters, and return the corresponding keysym.
+The characters must be ?-, or ?_, or have word syntax.  Reading is
+terminated by RET (which is discarded)."
   (let ((continuep t)
 	event char list)
     (while continuep
diff -r be3ca9e58c92a68d414210b217a4eef5bb6ea9d5 -r 0e9f791cc6558e3dba92ffff659d331138f1431e src/ChangeLog
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
+2014-07-02  Aidan Kehoe  <kehoea(a)parhasard.net>
+
+	* event-stream.c (Fnext_command_event):
+	Only snooze displaying keystrokes if PROMPT is nil. If prompt is
+	non-nil, our callers want to see it.
+
 2014-06-19  Stephen J. Turnbull  <stephen(a)xemacs.org>
 
 	* buffer.c (case_fold_search): Improve docstring.
diff -r be3ca9e58c92a68d414210b217a4eef5bb6ea9d5 -r 0e9f791cc6558e3dba92ffff659d331138f1431e src/event-stream.c
--- a/src/event-stream.c
+++ b/src/event-stream.c
@@ -2436,7 +2436,11 @@
    
   maybe_echo_keys (XCOMMAND_BUILDER
 		   (XCONSOLE (Vselected_console)->
-		    command_builder), 0); /* #### This sucks bigtime */
+		    command_builder),
+                   /* Only snooze displaying keystrokes if we don't have a
+                      prompt. (If we have a prompt, our callers want us to
+                      show it!) */
+                   !NILP (prompt));
 
   for (;;)
     {
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