From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Luc Teirlinck Newsgroups: gmane.emacs.devel Subject: edmacro.el Date: Fri, 3 Dec 2004 21:30:09 -0600 (CST) Message-ID: <200412040330.iB43U9I08163@raven.dms.auburn.edu> NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1102131128 30734 80.91.229.6 (4 Dec 2004 03:32:08 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 4 Dec 2004 03:32:08 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 04 04:32:02 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CaQeQ-0006kb-00 for ; Sat, 04 Dec 2004 04:32:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CaQo3-00088C-Ci for ged-emacs-devel@m.gmane.org; Fri, 03 Dec 2004 22:41:59 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CaQnw-00087x-76 for emacs-devel@gnu.org; Fri, 03 Dec 2004 22:41:52 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CaQnv-00087L-AN for emacs-devel@gnu.org; Fri, 03 Dec 2004 22:41:51 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CaQnv-000870-4q for emacs-devel@gnu.org; Fri, 03 Dec 2004 22:41:51 -0500 Original-Received: from [131.204.53.104] (helo=manatee.dms.auburn.edu) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CaQeF-0002qF-83 for emacs-devel@gnu.org; Fri, 03 Dec 2004 22:31:51 -0500 Original-Received: from raven.dms.auburn.edu (raven.dms.auburn.edu [131.204.53.29]) by manatee.dms.auburn.edu (8.12.10/8.12.10) with ESMTP id iB43ViFu014273 for ; Fri, 3 Dec 2004 21:31:44 -0600 (CST) Original-Received: (from teirllm@localhost) by raven.dms.auburn.edu (8.11.7p1+Sun/8.11.7) id iB43U9I08163; Fri, 3 Dec 2004 21:30:09 -0600 (CST) X-Authentication-Warning: raven.dms.auburn.edu: teirllm set sender to teirllm@dms.auburn.edu using -f Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:30663 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:30663 I propose the following changes to edmacro.el. There are two problems with editing a keyboard macro with `C-x C-k e'. The first is that if the macro is already bound to a key sequence and you just use C-x C-k e and then do C-c C-c in the *Edit Macro* buffer without making any changes, you get warned that this key sequence is already bound to a non-keyboard-macro. The `(get b 'kmacro)' in the patch below eliminates this bug. The second bug concerns Meta characters. If you do say: C-x ( M-4 a RET C-x ) and then name that macro and try to edit it with `C-x C-k e', then instead of `M-4' the Meta version of some strange character gets inserted in the *Edit Macro* buffer. If you do C-c C-c without making any changes and then try to execute the macro you get an error. The reason is that "M-" gets inserted before the M-a without getting rid of the Meta bit to correctly produce a `4' in the buffer. The patch below fixes this. I can install the patch if desired. ===File ~/edmacro.el-diff=================================== *** edmacro.el 30 Sep 2004 08:24:50 -0500 1.33 --- edmacro.el 03 Dec 2004 20:20:03 -0600 *************** *** 1,6 **** ;;; edmacro.el --- keyboard macro editor ! ;; Copyright (C) 1993, 1994 Free Software Foundation, Inc. ;; Author: Dave Gillespie ;; Maintainer: Dave Gillespie --- 1,6 ---- ;;; edmacro.el --- keyboard macro editor ! ;; Copyright (C) 1993, 1994, 2004 Free Software Foundation, Inc. ;; Author: Dave Gillespie ;; Maintainer: Dave Gillespie *************** *** 28,34 **** ;;; Usage: ;; ! ;; The `C-x C-k' (`edit-kbd-macro') command edits a keyboard macro ;; in a special buffer. It prompts you to type a key sequence, ;; which should be one of: ;; --- 28,34 ---- ;;; Usage: ;; ! ;; The `C-x C-k e' (`edit-kbd-macro') command edits a keyboard macro ;; in a special buffer. It prompts you to type a key sequence, ;; which should be one of: ;; *************** *** 266,272 **** (and b (commandp b) (not (arrayp b)) (not (kmacro-extract-lambda b)) (or (not (fboundp b)) ! (not (arrayp (symbol-function b)))) (not (y-or-n-p (format "Key %s is already defined; %s" (edmacro-format-keys key 1) --- 266,273 ---- (and b (commandp b) (not (arrayp b)) (not (kmacro-extract-lambda b)) (or (not (fboundp b)) ! (not (or (arrayp (symbol-function b)) ! (get b 'kmacro)))) (not (y-or-n-p (format "Key %s is already defined; %s" (edmacro-format-keys key 1) *************** *** 458,464 **** (while (memq (aref rest-mac i) (cdr mdigs)) (incf i)) (and (not (memq (aref rest-mac i) pkeys)) ! (prog1 (vconcat "M-" (edmacro-subseq rest-mac 0 i) " ") (callf edmacro-subseq rest-mac i))))) (and (eq (aref rest-mac 0) ?\C-u) (eq (key-binding [?\C-u]) 'universal-argument) --- 459,472 ---- (while (memq (aref rest-mac i) (cdr mdigs)) (incf i)) (and (not (memq (aref rest-mac i) pkeys)) ! (prog1 (vconcat "M-" ! (mapcar ! (lambda (char) ! ;; Eliminate Meta bit. ! (logand char ! (lognot (lsh 1 27)))) ! (edmacro-subseq rest-mac 0 i)) ! " ") (callf edmacro-subseq rest-mac i))))) (and (eq (aref rest-mac 0) ?\C-u) (eq (key-binding [?\C-u]) 'universal-argument) ============================================================