emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r118347: * lisp/help.el (view-lossage): Include the


From: Stefan Monnier
Subject: [Emacs-diffs] trunk r118347: * lisp/help.el (view-lossage): Include the actual commands run.
Date: Mon, 10 Nov 2014 02:59:02 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 118347
revision-id: address@hidden
parent: address@hidden
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Sun 2014-11-09 21:58:52 -0500
message:
  * lisp/help.el (view-lossage): Include the actual commands run.
  * src/keyboard.c (command_loop_1): Record this-command in recent-keys.
  (Frecent_keys): Rewrite. and add optional `include-cmds' arg.
modified:
  etc/NEWS                       news-20141002041645-34n5fasbwydbo8t6-1
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/help.el                   help.el-20091113204419-o5vbwnq5f7feedwu-280
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/keyboard.c                 keyboard.c-20091113204419-o5vbwnq5f7feedwu-449
  test/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-8588
=== modified file 'etc/NEWS'
--- a/etc/NEWS  2014-11-09 17:28:18 +0000
+++ b/etc/NEWS  2014-11-10 02:58:52 +0000
@@ -49,6 +49,8 @@
 
 * Changes in Emacs 25.1
 
+** C-h l now also lists the commands that were run.
+
 ** M-x suggests shorthands and ignores obsolete commands for completion.
 ** x-select-enable-clipboard is renamed select-enable-clipboard.
 x-select-enable-primary and renamed select-enable-primary.

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-11-10 01:29:58 +0000
+++ b/lisp/ChangeLog    2014-11-10 02:58:52 +0000
@@ -1,3 +1,7 @@
+2014-11-10  Stefan Monnier  <address@hidden>
+
+       * help.el (view-lossage): Include the actual commands run.
+
 2014-11-10  Dmitry Gutov  <address@hidden>
 
        * vc/vc-dir.el (vc-dir-hide-state): Also hide `ignored' items when
@@ -5,8 +9,8 @@
 
 2014-11-09  Eric Ludlam  <address@hidden>
 
-       * emacs-lisp/eieio-custom.el (eieio-customize-object): Set
-       eieio-cog (current group) to g, which is an improved form of input
+       * emacs-lisp/eieio-custom.el (eieio-customize-object):
+       Set eieio-cog (current group) to g, which is an improved form of input
        group.
 
 2014-11-09  Juri Linkov  <address@hidden>
@@ -14,8 +18,8 @@
        * isearch.el (isearch-message-prefix): Show "Multi-file" and
        "Multi-buffer" instead of "Multi".  (Bug#13592)
 
-       * misearch.el (multi-isearch-file-list): Autoload
-       multi-isearch-buffer-list and multi-isearch-file-list.
+       * misearch.el (multi-isearch-file-list):
+       Autoload multi-isearch-buffer-list and multi-isearch-file-list.
        (multi-isearch-end): Reset multi-isearch-buffer-list and
        multi-isearch-file-list to nil.
 
@@ -70,8 +74,8 @@
 2014-11-08  Alan Mackenzie  <address@hidden>
 
        Fix wrong bound to c-font-lock-declarators.  Fixes bug #18948.
-       * progmodes/cc-fonts.el (c-font-lock-declarations): Pass
-       "(point-max)" as bound to c-font-lock-declarators, not "limit", as
+       * progmodes/cc-fonts.el (c-font-lock-declarations):
+       Pass "(point-max)" as bound to c-font-lock-declarators, not "limit", as
        the buffer is sometimes narrowed to less than "limit" (e.g., in
        the presence of macros).
 

=== modified file 'lisp/help.el'
--- a/lisp/help.el      2014-08-07 03:25:09 +0000
+++ b/lisp/help.el      2014-11-10 02:58:52 +0000
@@ -448,25 +448,32 @@
   (info "(efaq)Packages that do not come with Emacs"))
 
 (defun view-lossage ()
-  "Display last 300 input keystrokes.
+  "Display last few input keystrokes and the commands run.
 
 To record all your input, use `open-dribble-file'."
   (interactive)
   (help-setup-xref (list #'view-lossage)
                   (called-interactively-p 'interactive))
   (with-help-window (help-buffer)
+    (princ " ")
     (princ (mapconcat (lambda (key)
-                       (if (or (integerp key) (symbolp key) (listp key))
-                           (single-key-description key)
-                         (prin1-to-string key nil)))
-                     (recent-keys)
+                       (cond
+                        ((and (consp key) (null (car key)))
+                         (format "[%s]\n" (if (symbolp (cdr key)) (cdr key)
+                                          "anonymous-command")))
+                        ((or (integerp key) (symbolp key) (listp key))
+                         (single-key-description key))
+                        (t
+                         (prin1-to-string key nil))))
+                     (recent-keys 'include-cmds)
                      " "))
     (with-current-buffer standard-output
       (goto-char (point-min))
-      (while (progn (move-to-column 50) (not (eobp)))
-        (when (search-forward " " nil t)
-          (delete-char -1))
-        (insert "\n"))
+      (while (not (eobp))
+       (move-to-column 50)
+       (unless (eolp)
+         (fill-region (line-beginning-position) (line-end-position)))
+       (forward-line 1))
       ;; jidanni wants to see the last keystrokes immediately.
       (set-marker help-window-point-marker (point)))))
 

=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-11-09 10:23:46 +0000
+++ b/src/ChangeLog     2014-11-10 02:58:52 +0000
@@ -1,3 +1,8 @@
+2014-11-10  Stefan Monnier  <address@hidden>
+
+       * keyboard.c (command_loop_1): Record this-command in recent-keys.
+       (Frecent_keys): Rewrite. and add optional `include-cmds' arg.
+
 2014-11-09  Jan Djärv  <address@hidden>
 
        * nsterm.m (ns_set_vertical_scroll_bar)

=== modified file 'src/keyboard.c'
--- a/src/keyboard.c    2014-11-07 16:25:35 +0000
+++ b/src/keyboard.c    2014-11-10 02:58:52 +0000
@@ -1534,6 +1534,13 @@
 
       /* Execute the command.  */
 
+      {
+       total_keys += total_keys < NUM_RECENT_KEYS;
+       ASET (recent_keys, recent_keys_index,
+             Fcons (Qnil, cmd));
+       if (++recent_keys_index >= NUM_RECENT_KEYS)
+         recent_keys_index = 0;
+      }
       Vthis_command = cmd;
       Vreal_this_command = cmd;
       safe_run_hooks (Qpre_command_hook);
@@ -10048,23 +10055,34 @@
          ? Qt : Qnil);
 }
 
-DEFUN ("recent-keys", Frecent_keys, Srecent_keys, 0, 0, 0,
-       doc: /* Return vector of last 300 events, not counting those from 
keyboard macros.  */)
-  (void)
+DEFUN ("recent-keys", Frecent_keys, Srecent_keys, 0, 1, 0,
+       doc: /* Return vector of last few events, not counting those from 
keyboard macros.
+If INCLUDE-CMDS is non-nil, include the commands that were run,
+represented as events of the form (nil . COMMAND).  */)
+  (Lisp_Object include_cmds)
 {
-  Lisp_Object *keys = XVECTOR (recent_keys)->contents;
-  Lisp_Object val;
+  bool cmds = !NILP (include_cmds);
 
-  if (total_keys < NUM_RECENT_KEYS)
-    return Fvector (total_keys, keys);
+  if (!total_keys
+      || (cmds && total_keys < NUM_RECENT_KEYS))
+    return Fvector (total_keys,
+                   XVECTOR (recent_keys)->contents);
   else
     {
-      val = Fvector (NUM_RECENT_KEYS, keys);
-      vcopy (val, 0, keys + recent_keys_index,
-            NUM_RECENT_KEYS - recent_keys_index);
-      vcopy (val, NUM_RECENT_KEYS - recent_keys_index,
-            keys, recent_keys_index);
-      return val;
+      Lisp_Object es = Qnil;
+      int i = (total_keys < NUM_RECENT_KEYS
+              ? 0 : recent_keys_index);
+      eassert (recent_keys_index < NUM_RECENT_KEYS);
+      do
+       {
+         Lisp_Object e = AREF (recent_keys, i);
+         if (cmds || !CONSP (e) || !NILP (XCAR (e)))
+           es = Fcons (e, es);
+         if (++i >= NUM_RECENT_KEYS)
+           i = 0;
+       } while (i != recent_keys_index);
+      es = Fnreverse (es);
+      return Fvconcat (1, &es);
     }
 }
 

=== modified file 'test/ChangeLog'
--- a/test/ChangeLog    2014-11-08 18:21:38 +0000
+++ b/test/ChangeLog    2014-11-10 02:58:52 +0000
@@ -1,3 +1,8 @@
+2014-11-08  Stefan Monnier  <address@hidden>
+
+       * automated/bytecomp-tests.el (bytecomp-tests--warnings): New tests.
+       * automated/cl-lib-tests.el: Rename from cl-lib.el.
+
 2014-10-28  Ulf Jasper  <address@hidden>
 
        * automated/libxml-tests.el: New file.


reply via email to

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