Package: emacs-goodies-el
Version: 34.1
Severity: normal
Tags: patch

(home-end-home) and (home-end-end) use (recent-keys) to get the list
of recent commands. This explicitly does NOT work inside keyboard
macros. The attached patch reverts to "normal" <home> and <end>
behavior if we are defining or executing a macro.

-- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.37-trunk-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages emacs-goodies-el depends on:
ii  bash                      4.1-3          The GNU Bourne Again SHell
ii  dpkg                      1.15.8.6       Debian package management system
ii  emacs [emacsen]           23.2+1-5.1     The GNU Emacs editor (metapackage)
ii  emacs23 [emacsen]         23.2+1-7       The GNU Emacs editor (with GTK+ us
ii  install-info              4.13a.dfsg.1-6 Manage installed documentation in 

Versions of packages emacs-goodies-el recommends:
pn  dict                          <none>     (no description available)
ii  perl-doc                      5.10.1-16  Perl documentation
ii  wget                          1.12-2.1   retrieves files from the web

emacs-goodies-el suggests no packages.

-- no debconf information
--- home-end.el	2011-02-20 17:15:51.000000000 -0800
+++ home-end.patched.el	2011-02-20 17:24:00.000000000 -0800
@@ -47,20 +47,23 @@
 First hitting key goes to beginning of line, second in a row goes to
 beginning of window, third in a row goes to beginning of buffer."
   (interactive "P")
-  (if arg
-      (beginning-of-buffer arg)
-    (let* ((keys (recent-keys))
-           (len (length keys))
-           (key1 (if (> len 0) (elt keys (- len 1)) nil))
-           (key2 (if (> len 1) (elt keys (- len 2)) nil))
-           (key3 (if (> len 2) (elt keys (- len 3)) nil))
-           (key-equal-1 (equal key1 key2))
-           (key-equal-2 (and key-equal-1 (equal key2 key3))))
-      (cond (key-equal-2 (goto-char (point-min)))
-            (key-equal-1 (push-mark home-end-marker)
-                         (move-to-window-line 0))
-            (t (setq home-end-marker (copy-marker (point)))
-               (beginning-of-line))))))
+  (if (or executing-kbd-macro
+          defining-kbd-macro)
+      (move-beginning-of-line arg)
+    (if arg
+        (beginning-of-buffer arg)
+      (let* ((keys (recent-keys))
+             (len (length keys))
+             (key1 (if (> len 0) (elt keys (- len 1)) nil))
+             (key2 (if (> len 1) (elt keys (- len 2)) nil))
+             (key3 (if (> len 2) (elt keys (- len 3)) nil))
+             (key-equal-1 (equal key1 key2))
+             (key-equal-2 (and key-equal-1 (equal key2 key3))))
+        (cond (key-equal-2 (goto-char (point-min)))
+              (key-equal-1 (push-mark home-end-marker)
+                           (move-to-window-line 0))
+              (t (setq home-end-marker (copy-marker (point)))
+                 (beginning-of-line)))))))
 
 ;;;###autoload
 (defun home-end-end (&optional arg)
@@ -68,20 +71,23 @@
 First hitting key goes to end of line, second in a row goes to end
 of window, third in a row goes to end of buffer."
   (interactive "P")
-  (if arg
-      (beginning-of-buffer arg)
-    (let* ((keys (recent-keys))
-           (len (length keys))
-           (key1 (if (> len 0) (elt keys (- len 1)) nil))
-           (key2 (if (> len 1) (elt keys (- len 2)) nil))
-           (key3 (if (> len 2) (elt keys (- len 3)) nil))
-           (key-equal-1 (equal key1 key2))
-           (key-equal-2 (and key-equal-1 (equal key2 key3))))
-      (cond (key-equal-2 (goto-char (point-max)))
-            (key-equal-1 (push-mark home-end-marker)
-                         (move-to-window-line -1)
-                         (end-of-line))
-            (t (setq home-end-marker (copy-marker (point)))
-               (end-of-line))))))
+  (if (or executing-kbd-macro
+          defining-kbd-macro)
+      (move-end-of-line arg)
+    (if arg
+        (beginning-of-buffer arg)
+      (let* ((keys (recent-keys))
+             (len (length keys))
+             (key1 (if (> len 0) (elt keys (- len 1)) nil))
+             (key2 (if (> len 1) (elt keys (- len 2)) nil))
+             (key3 (if (> len 2) (elt keys (- len 3)) nil))
+             (key-equal-1 (equal key1 key2))
+             (key-equal-2 (and key-equal-1 (equal key2 key3))))
+        (cond (key-equal-2 (goto-char (point-max)))
+              (key-equal-1 (push-mark home-end-marker)
+                           (move-to-window-line -1)
+                           (end-of-line))
+              (t (setq home-end-marker (copy-marker (point)))
+                 (end-of-line)))))))
 
 (provide 'home-end)

Reply via email to