bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#13273: 24.3.50; [PATCH] enhancement request: repeatable `visual-line


From: Vitalie Spinu
Subject: bug#13273: 24.3.50; [PATCH] enhancement request: repeatable `visual-line-mode' line movements
Date: Fri, 28 Dec 2012 21:33:53 +0100
User-agent: Gnus/5.130004 (Ma Gnus v0.4) Emacs/24.2.91 (gnu/linux)

  >> "Drew Adams" <drew.adams@oracle.com>
  >> on Fri, 28 Dec 2012 12:04:27 -0800 wrote:

  >> Here is a short version: apply patch -> test -> emacs 
  >> infloops on every single occasion, i.e "C-h k C-a", "M-q" etc.

  > Try just evaluating the new definitions and key bindings, instead of trying 
to
  > apply a patch etc.  That will show you the proposed behavior.  You should 
not
  > seen any errors, inflooping etc.

  > Someone intending to install the change to Emacs itself can worry about 
applying
  > the patch.  If you just want to evaluate the behavior, you need not do that.

I just did that, and as Eli said, this is a bad idea for built-in
functions.


But the problem with your function is far more simple:
   
   (defun end-of-line (&optional n)
     "Move cursor to end of current line or end of next line if repeated.
   If called interactively with no prefix arg:
    If the previous command was also `end-of-line' then move to the
    end of the next line.  Else move to the end of the current line.
   Otherwise, move to the end of the Nth next line (Nth previous line
    if N <0 )."
     (interactive
      (list (if current-prefix-arg (prefix-numeric-value current-prefix-arg) 
0)))
     (unless n (setq n  0))                ; non-interactive with no arg
     (if (and (eq this-command last-command)  (not current-prefix-arg))
         (forward-line 1)
       (forward-line n))
     (let ((inhibit-field-text-motion  t))  (end-of-line)))

How is this not an infloop?  ----------------^^^^^^^^^^^



    Vitalie
   







reply via email to

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