unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#14095: 24.3.50; REGRESSION: `repeat' broken by use of `set-temporary-overlay-map'
@ 2013-03-30 17:13 Drew Adams
  2013-06-13 20:44 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Drew Adams @ 2013-03-30 17:13 UTC (permalink / raw)
  To: 14095

I believe this regression was introduced at the same time as the
regression of bug #12232 (which has been fixed).  The change that
introduced this problem was to use `set-temporary-overlay-map'.
 
The code for `repeat' before that change, e.g. the code from Emacs 23.4,
had this:
 
(when repeat-repeat-char
  (let (repeat-on-final-keystroke
        (undo-inhibit-record-point t))
    (setq real-last-command 'repeat)
    (setq repeat-undo-count 1)
    (unwind-protect
        (while (let ((evt (read-key)))
                 (eq (or (car-safe evt) evt)
                     (or (car-safe repeat-repeat-char)
                         repeat-repeat-char)))
          (repeat repeat-arg))
      ;; Make sure `repeat-undo-count' is reset.
      (setq repeat-undo-count nil))
    (setq unread-command-events (list last-input-event))))
 
That was changed to this (the current code):
 
(when repeat-repeat-char
  (set-temporary-overlay-map ; <===================
   (let ((map (make-sparse-keymap)))
     (define-key map (vector repeat-repeat-char)
       (if (null repeat-message-function) 'repeat
         (let ((fun repeat-message-function))
           (lambda ()
             (interactive)
             (let ((repeat-message-function fun))
               (setq this-command 'repeat)
               (setq real-this-command 'repeat)
               (call-interactively 'repeat))))))
     map)))
 
This change breaks the use of `repeat' in the following context, because
Isearch uses `overriding-terminal-local-map'.  Recipe:
 
emacs -Q

(defun isearchp-yank-line ()
    "Yank text from buffer up to end of line onto search string.
You can repeat this by hitting the last key again..."
    (interactive)
    (require 'repeat nil t)
    (isearchp-repeat-command 'isearch-yank-line))

(defun isearchp-repeat-command (command)
  "Repeat COMMAND."
  (let ((repeat-message-function  'ignore))
    (setq last-repeatable-command  command)
    (repeat nil)))

(define-key isearch-mode-map (kbd "C-y C-e")
            'isearchp-yank-line)
 
C-s  C-y  C-e  C-e  C-e
 
That works if the old definition of `repeat' is used.  It does not work
with the new definition, which uses `set-temporary-overlay-map', because
the temporary map is overruled by `overriding(-terminal)-local-map'.
 
Users should be able to use `repeat' in contexts such as this.  For
Isearch, for example, this lets you put multiple yank commands on the
same prefix key (e.g., `C-y').
 
For instance, I bind 8 yank commands to prefix C-y, 5 of which are
repeatable (i.e., they are repeatable in Emacs 22-23 and should also
be repeatable in later releases):
 
 C-y C-_   isearchp-yank-symbol-or-char
 C-y C-(   isearchp-yank-sexp-symbol-or-char
 C-y C-2   isearch-yank-secondary
 C-y C-c   isearchp-yank-char
 C-y C-e   isearchp-yank-line
 C-y C-w   isearchp-yank-word-or-char
 C-y C-y   isearch-yank-kill
 C-y M-y   isearch-yank-pop
 
(FWIW/FYI: It took me quite a while to figure out why this was not working.)

In GNU Emacs 24.3.50.1 (i386-mingw-nt5.1.2600)
 of 2013-03-23 on VBOX
Bzr revision: 112115 eliz@gnu.org-20130323093300-rjs0dgskxm9u0ya4
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.7) --no-opt --enable-checking --cflags
 -IC:/emacs/libs/libXpm-3.5.10/include -IC:/emacs/libs/libXpm-3.5.10/src
 -IC:/emacs/libs/libpng-dev_1.4.3-1_win32/include
 -IC:/emacs/libs/zlib-dev_1.2.5-2_win32/include
 -IC:/emacs/libs/giflib-4.1.4-1-lib/include
 -IC:/emacs/libs/jpeg-6b-4-lib/include
 -IC:/emacs/libs/tiff-3.8.2-1-lib/include
 -IC:/emacs/libs/libxml2-2.7.8-w32-bin/include/libxml2
 -IC:/emacs/libs/gnutls-3.1.10-w32/include
 -IC:/emacs/libs/libiconv-1.14-2-mingw32-dev/include'
 






^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-06-20  2:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-30 17:13 bug#14095: 24.3.50; REGRESSION: `repeat' broken by use of `set-temporary-overlay-map' Drew Adams
2013-06-13 20:44 ` Stefan Monnier
2013-06-14  3:42   ` Drew Adams
2013-06-14  4:14     ` Stefan Monnier
2013-06-20  2:24       ` Drew Adams

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).