From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Leo Newsgroups: gmane.emacs.bugs Subject: bug#20454: 24.4; Emacs keyboard macros not working correctly Date: Wed, 29 Apr 2015 04:49:27 +0000 (UTC) Message-ID: <982083367.276894.1430282967819.JavaMail.yahoo@mail.yahoo.com> Reply-To: Leo NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_276893_744573501.1430282967811" X-Trace: ger.gmane.org 1430287591 4759 80.91.229.3 (29 Apr 2015 06:06:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Apr 2015 06:06:31 +0000 (UTC) To: 20454@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Apr 29 08:06:17 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YnL8P-0000C3-Rg for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Apr 2015 08:06:14 +0200 Original-Received: from localhost ([::1]:37058 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnL8O-0007jm-Pz for geb-bug-gnu-emacs@m.gmane.org; Wed, 29 Apr 2015 02:06:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48515) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnL8K-0007hD-3Q for bug-gnu-emacs@gnu.org; Wed, 29 Apr 2015 02:06:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnL8G-0004aE-1H for bug-gnu-emacs@gnu.org; Wed, 29 Apr 2015 02:06:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45467) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnL8F-0004aA-Tp for bug-gnu-emacs@gnu.org; Wed, 29 Apr 2015 02:06:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YnL8F-0006Sy-FC for bug-gnu-emacs@gnu.org; Wed, 29 Apr 2015 02:06:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Leo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 29 Apr 2015 06:06:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20454 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: "bug-gnu-emacs@gnu.org" Original-Received: via spool by submit@debbugs.gnu.org id=B.143028754624822 (code B ref -1); Wed, 29 Apr 2015 06:06:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 29 Apr 2015 06:05:46 +0000 Original-Received: from localhost ([127.0.0.1]:55442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YnL7v-0006SD-J6 for submit@debbugs.gnu.org; Wed, 29 Apr 2015 02:05:45 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44242) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YnJz3-0004aO-BV for submit@debbugs.gnu.org; Wed, 29 Apr 2015 00:52:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnJyw-00024l-DD for submit@debbugs.gnu.org; Wed, 29 Apr 2015 00:52:24 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:54515) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnJyw-00024f-AD for submit@debbugs.gnu.org; Wed, 29 Apr 2015 00:52:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnJyu-0000JF-No for bug-gnu-emacs@gnu.org; Wed, 29 Apr 2015 00:52:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnJyr-00022T-GN for bug-gnu-emacs@gnu.org; Wed, 29 Apr 2015 00:52:20 -0400 Original-Received: from nm41-vm4.bullet.mail.gq1.yahoo.com ([67.195.87.91]:49609) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnJyr-00021p-4l for bug-gnu-emacs@gnu.org; Wed, 29 Apr 2015 00:52:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1430283135; bh=8c8z8TEWmYvJ4WxFwlK0M9qY8/DGDeGsW3cC6ozaIu4=; h=Date:From:Reply-To:To:Subject:From:Subject; b=Xw51mwA8CFniOJZn8/v0RZAmEXIqOdk2nsyjdAGzwhtuZp0RmR74pFfXUBEIaMW5Buq0N2TTXEq+MK+DAjrcOYCQ0afgyQz7FmjvwEu/U0rDaqh1TXCHo/0qIRO5OOatYar1wYs8ZFvWn1KboHyiMrX/Tlqjf/r05/BwA6hE8jVZYU7/XFWC88hWJ9ncHZKXfqdlQQVZGnp1cw5j3Ib1rkYzCB/xLQx6xhZ+4uouuuMlPN4HA3xCihA+6pCJOnqt9xB0DKIXLWJV9XfdA0KoBOyOdVhYRd0lAMTe32PCM4lwd0hTdtMooeFAMU+ZI+pjRK2LjwvUQWQLRI2HF0hozA== Original-Received: from [127.0.0.1] by nm41.bullet.mail.gq1.yahoo.com with NNFMP; 29 Apr 2015 04:52:15 -0000 Original-Received: from [98.137.12.191] by nm41.bullet.mail.gq1.yahoo.com with NNFMP; 29 Apr 2015 04:49:29 -0000 Original-Received: from [66.196.81.173] by tm12.bullet.mail.gq1.yahoo.com with NNFMP; 29 Apr 2015 04:49:28 -0000 Original-Received: from [98.139.212.216] by tm19.bullet.mail.bf1.yahoo.com with NNFMP; 29 Apr 2015 04:49:28 -0000 Original-Received: from [127.0.0.1] by omp1025.mail.bf1.yahoo.com with NNFMP; 29 Apr 2015 04:49:28 -0000 X-Yahoo-Newman-Property: ymail-4 X-Yahoo-Newman-Id: 870156.51996.bm@omp1025.mail.bf1.yahoo.com X-YMail-OSG: e5jiIlgVM1kwXK6Kj41M6.brphD.VowVvq8cyfUA78fO8YuhpZyOeZf7piF0bLh 4PQnngwlve8f0B5Y9lehQytRKHcVGgVrp9Sm6KtOwEz1GH8WuziWZnJuGe_or2uH7fMzZv37BIsf mavsF3YJqZsjyyheVzIow8OEtiszGIOEkAneYvc53poOik.33IrD62Tee0Xw.SvF5Krd1UifsO36 VHfbuGBTvPinCF0KgocpRro7C8hxbsj0CBNdfbQneB7MJ1c2hR8WIf2xTZOo5KjxILGzUZqIypEA v0X8hkSCyYgFJjhQ0acGp_pUMXgAcQOvu9zxolmnWhMGeUISzmXvlsPi1pSwehdJQEQBfWDeslo7 aWE_TllMFSId9LYyF6xTY3nBGdjPBD1U4DWOLX2VjYAhTJR65zR1nqcwWgt65z_ViI48KzDK8gye sSzyRKyvOYdI1ChnbsXnp13t5iM8xbIJf6X5zY3t_u3IE7TDoBDWhclEIDEhpD1lfJuBcvCGYPXL Y2rD8YTAGgiaS2y9bxSRdOosw Original-Received: by 66.196.80.123; Wed, 29 Apr 2015 04:49:28 +0000 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Wed, 29 Apr 2015 02:05:42 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:102202 Archived-At: ------=_Part_276893_744573501.1430282967811 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hello, I'm reporting the following bug that I found in Emacs. The textbelow lines = up better with a monospace font. So if you want, you could copy and paste it into an emacs buffer to see thetext aligned cor= rectly. Keyboard macros not working correctly ------------------------------------ Emacs has a problem when defining a keyboard macro using and . If the macro contains a key sequence consisting of a prefix key followed by an ASCII-character key, there is no problem. However, if the key following the prefix key is something other than an single character, such as a function key, a keypad key, or an arrow key, the defined macro doesn't work when it is subsequently executed with . And, there is no error message. See details below. Platform & Emacs version ------------------------ =C2=A0=C2=A0 GNU Emacs 24.4.1 (i686-pc-mingw32) =C2=A0=C2=A0 =C2=A0=C2=A0 of 2014-10-24 on LEG570 =C2=A0 =C2=A0 =C2=A0 Configured using: `configure --prefix=3D/c/usr' =C2=A0=C2=A0 Windows 7 Home Premium (64-bit) - version 6.1.7600 =C2=A0=C2=A0 Intel Core i7 CPU - 1.73 GHz - 6 GB RAM =C2=A0=C2=A0 ASUS Notebook G73Jw Started Emacs at Command Prompt with this command: -------------------------------------------------- =C2=A0=C2=A0 run_emacs.bat -Q Executed this lisp code in *Scratch* buffer: -------------------------------------------- =C2=A0=C2=A0 (progn =C2=A0 =C2=A0 =C2=A0 (setq f5-key-map (make-sparse-keymap "F5-Key-prefix")) =C2=A0 =C2=A0 =C2=A0 (define-key global-map [f5] f5-key-map) =C2=A0 =C2=A0 =C2=A0 (define-key f5-key-map [(g)]=C2=A0=C2=A0 'forward-word= ) =C2=A0 =C2=A0 =C2=A0 (define-key f5-key-map [f6]=C2=A0=C2=A0=C2=A0 'forward= -word) =C2=A0 =C2=A0 =C2=A0 (define-key f5-key-map [kp-4]=C2=A0 'forward-word) =C2=A0 =C2=A0 =C2=A0 (define-key f5-key-map [right] 'forward-word) =C2=A0=C2=A0 ) Case=C2=A0 This key =C2=A0 #=C2=A0=C2=A0=C2=A0 sequence=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Produces = this result ----=C2=A0 --------=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 -------------------- =C2=A0 1=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 moves cursor fo= rward by 1 word =C2=A0 2=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 moves cursor forward= by 1 word =C2=A0 3=C2=A0=C2=A0 =C2=A0=C2=A0 moves cursor forward by 1 word =C2=A0 4=C2=A0=C2=A0 =C2=A0 moves cursor forward by 1 word Case=C2=A0=C2=A0 Define macro by using=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 Result when pressing =C2=A0 # =C2=A0 =C2=A0 this key sequence:=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0 =C2=A0 =C2=A0=C2=A0 again: ----=C2=A0=C2=A0 ---------------------=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 -------------------- =C2=A011=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 moves cursor forward by 1 word =C2=A012=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 nothing =C2=A013=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 nothing =C2=A014=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 nothing =C2=A015=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0 moves cu= rsor forward by 1 word Cases #12, #13, and #14 do not work at all. Nothing happens, and there is no error message. Case #11 is the only case where the macro works correctly. Even though the macro in case #15 appears to work, it isn't working correctly. It should move the cursor forward by one word AND one character, but it only moves by one word. My guess is that, in case #15 (as in case #12), the key is being ignored. =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - - - - - - - - - - = - - - - - - - - - In an effort to help debug case #15, I executed this additional lisp code in the *scratch* buffer: =C2=A0=C2=A0 (progn =C2=A0=C2=A0 =C2=A0=C2=A0 (defun define-macro-f8 () "" =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0 =C2=A0 (interactive) (name-last-kbd-macro '= macro-f8)) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (defun insert-macro-f8 () "" =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0 =C2=A0 (interactive) (insert-kbd-macro 'mac= ro-f8)) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (define-key global-map [f7] 'define-macro-f8= ) =C2=A0=C2=A0=C2=A0 =C2=A0 (define-key global-map [f8] 'macro-f8) =C2=A0=C2=A0 =C2=A0=C2=A0 (define-key global-map [f9] 'insert-macro-f8) =C2=A0=C2=A0 ) Whereupon, this key sequence puts the macro (from case #15) into : =C2=A0=C2=A0 Then, every time I press , the cursor moves forward, as before, by one word (NOT one word and one character, as it should). And then, when I press , this macro definition is inserted into the buffer: =C2=A0=C2=A0 (fset 'macro-f8 [f5 right]) As you can see, the key is missing. =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - - - - - - - - - - = - - - - - - - - - By the way, I tried something similar in Xemacs, and it has no problem defining keyboard macros containing the same key sequences. So, probably, my platform is not causing the problem. Thank you. Best regards,Leo ------=_Part_276893_744573501.1430282967811 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hell= o,

=
I'm reporting the = following bug that I found in Emacs. The text
below lines up better with a monospace fon= t. So if you want,
you could copy and paste it into an emacs buffer to see the
=
text aligned corre= ctly.

Keyboard macros not working correctly
-----------= -------------------------
Emacs has a problem when= defining a keyboard macro using <f3>
and &l= t;f4>. If the macro contains a key sequence consisting of
a prefix key followed by an ASCII-character key, there is no
problem. However, if the key following the prefix key= is
something other than an single character, such= as a function
key, a keypad key, or an arrow key,= the defined macro doesn't
work when it is subsequ= ently executed with <f4>. And, there
is no e= rror message. See details below.

Platform & Emacs version
------------= ------------
   GNU Emacs 24.4.1 (i686-p= c-mingw32)
      of 2014-10-24= on LEG570
      Configured using: = `configure --prefix=3D/c/usr'
   Windows= 7 Home Premium (64-bit) - version 6.1.7600
 =   Intel Core i7 CPU - 1.73 GHz - 6 GB RAM
&nb= sp;  ASUS Notebook G73Jw

Started Emacs at Command Prompt with this command:
--------------------------------------------------
   run_emacs.bat -Q

Executed this lisp code in *Scratch* buffer:
--------------------------------------------
   (progn
      (se= tq f5-key-map (make-sparse-keymap "F5-Key-prefix"))
      (define-key global-map [f5] f5-key-map)

      (define-key f5-= key-map [(g)]   'forward-word)
  &n= bsp;   (define-key f5-key-map [f6]    'forward-word)      (define-key f5-key-map [kp-4]&n= bsp; 'forward-word)
      (define-k= ey f5-key-map [right] 'forward-word)
   = )

Case  This key  #    sequence   = ;   Produces this result
----  ----= ----      --------------------
  1   <f5> <g>    &nbs= p; moves cursor forward by 1 word
  2 &n= bsp; <f5> <f6>     moves cursor forward by = 1 word
  3   <f5> <kp-4>= ;   moves cursor forward by 1 word
 = ; 4   <f5> <right>  moves cursor forward by 1 wo= rd

Case   Defi= ne macro by using         Result wh= en pressing
  #     this key sequen= ce:             <f4>= ; again:
----   ---------------------&nb= sp;        --------------------
 11    <f3> <f5> <g>= <f4>          &nbs= p; moves cursor forward by 1 word
 12 &n= bsp;  <f3> <f5> <f6> <f4>   &nb= sp;       nothing
&n= bsp;13    <f3> <f5> <kp-4> <f4> = ;        nothing
 14    <f3> <f5> <right> <f4>=         nothing
 15    <f3> <f5> <f6> <right> = <f4>   moves cursor forward by 1 word

Cases #12, #13, and #14 do not work at all.= Nothing happens, and
there is no error message.
Case #11 is the only case= where the macro works correctly.

Even though the macro in case #15 appears to work, it isn't worki= ng
correctly. It should move the cursor forward by= one word AND one
character, but it only moves by = one word. My guess is that, in
case #15 (as in cas= e #12), the key <f6> is being ignored.

         = - - - - - - - - - - - - - - - - - - -

In an effort to help debug case #15, I executed this
additional lisp code in the *scratch* buffer:

   (progn
      (defun define-macro-f8 () ""
         (interactive) (nam= e-last-kbd-macro 'macro-f8))
   &nb= sp;  (defun insert-macro-f8 () ""
  = ;       (interactive) (insert-kbd-macro 'macro-f8))
      (define-key global-map= [f7] 'define-macro-f8)
      = (define-key global-map [f8] 'macro-f8)
  = ;    (define-key global-map [f9] 'insert-macro-f8)
   )

Whereupon, this key sequence puts the macro (from case #15) into <f8&g= t;:

   <f3&= gt; <f5> <f6> <right> <f4> <f7>

Then, every time I press <f8>, = the cursor moves forward, as before, by
one word (= NOT one word and one character, as it should). And then,
when I press <f9>, this macro definition is inserted into the = buffer:

   (fs= et 'macro-f8 [f5 right])

As you can see, the <f6> key is missing.
        &nb= sp; - - - - - - - - - - - - - - - - - - -

By the way, I tried something similar in Xemacs, and it h= as no
problem defining keyboard macros containing = the same key sequences.
So, probably, my platform = is not causing the problem.

Thank = you.

Best regards,
Leo

------=_Part_276893_744573501.1430282967811--