bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#29478: [Patch] bug#29478: 26.0.90; `C-h k' followed by mouse clicks


From: Eli Zaretskii
Subject: bug#29478: [Patch] bug#29478: 26.0.90; `C-h k' followed by mouse clicks no longer shows down event
Date: Sat, 27 Jan 2018 10:28:30 +0200

> From: Stefan Monnier <monnier@IRO.UMontreal.CA>
> Cc: acm@muc.de, 29478@debbugs.gnu.org, npostavs@users.sourceforge.net
> Date: Fri, 26 Jan 2018 17:37:22 -0500
> 
> >>> If you want a patch that applies, the one below should work.
> >> Thanks.  It needs some more work.  E.g., "C-h k C-mouse-1" signals an
> >> error:
> >>   help-fns--analyze-function: Symbol’s function definition is void: nil
> > The patch below fixes this...
> 
> Sorry, wrong patch!
> 
> I meant this one,
> 
> 
>         Stefan
> 
> 
> diff --git a/lisp/help.el b/lisp/help.el
> index 014af5141e..1f92c38927 100644
> --- a/lisp/help.el
> +++ b/lisp/help.el
> @@ -1,4 +1,4 @@
> -;;; help.el --- help commands for Emacs
> +;;; help.el --- help commands for Emacs  -*- lexical-binding:t -*-
>  
>  ;; Copyright (C) 1985-1986, 1993-1994, 1998-2018 Free Software
>  ;; Foundation, Inc.
> @@ -593,19 +593,26 @@ help-key-description
>           string
>         (format "%s (translated from %s)" string otherstring))))))
>  
> +(defun help--first-event (keyseq)
> +  (when (> (length keyseq) 0)
> +    (aref keyseq (if (and (symbolp (aref keyseq 0))
> +                       (> (length keyseq) 1)
> +                       (consp (aref keyseq 1)))
> +                     ;; Look at the second event when the first
> +                     ;; is a pseudo-event like `mode-line' of `left-fringe'.
> +                  1
> +                0))))

Should we perhaps test explicitly for pseudo-events, in case some day
we have events we don't want to skip?  Or maybe have an assertion
here, for that future day?

> -(defun describe-key-briefly (&optional key insert untranslated)
> -  "Print the name of the function KEY invokes.  KEY is a string.
> +(defun describe-key-briefly (key-list &optional insert)
> +  "Print the name of the functions KEY-LIST invokes.

Is it a good idea to change the signature of this function?  I'm sure
it's used in many places, including outside Emacs.

>  (defun help-read-key-sequence (&optional no-mouse-movement)
> -  "Reads a key sequence from the user.
> -Returns a list of the form (KEY UP-EVENT), where KEY is the key
> -sequence, and UP-EVENT is the up-event that was discarded by
> -reading KEY, or nil.
> +  "Read \"a\" key sequence from the user.

Why "a" in quotes?

> +Return a list of elements of the form (SEQ . RAW-SEQ), where SEQ is a key
> +sequence, and RAW-SEQ is its untranslated form.

This also changes the format of the return value in incompatible way,
doesn't it?  Is this incompatible change justified?

> -(defun describe-key (&optional key untranslated up-event)
> -  "Display documentation of the function invoked by KEY.
> -KEY can be any kind of a key sequence; it can include keyboard events,
> +(defun describe-key (key-list &optional buffer)
> +  "Display documentation of the function invoked by KEY-LIST.
> +KEY-LIST can be any kind of a key sequence; it can include keyboard events,
>  mouse events, and/or menu events.  When calling from a program,

Same issue here.

Thanks.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]