string-rectangle provides on-the-fly preview, undesirably

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

string-rectangle provides on-the-fly preview, undesirably

Bob Proulx
The command C-x r t string-rectangle in version 24 and previously
would "Replace rectangle contents with STRING on each line
(‘string-rectangle’)."  The same happens in version 25 but
differently.  In version 25 the change is displayed incrementally
character by character as you type.  With a large displayed rectangle
this can cause a lot of dynamic "flicker" as every character on the
display is moved.  This is driving me crazy.

Is there a way to return to the previous version 24 behavior?

Thanks,
Bob

P.S. The NEWS file says:

*** 'string-rectangle' provides on-the-fly preview of the result.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: string-rectangle provides on-the-fly preview, undesirably

Drew Adams
> The command C-x r t string-rectangle in version 24 and previously
> would "Replace rectangle contents with STRING on each line
> (‘string-rectangle’)."  The same happens in version 25 but
> differently.  In version 25 the change is displayed incrementally
> character by character as you type.  With a large displayed
> rectangle
> this can cause a lot of dynamic "flicker" as every character on the
> display is moved.  This is driving me crazy.
>
> Is there a way to return to the previous version 24 behavior?

Someone will correct me if I'm wrong, but they don't seem
to have provided for an easy opt-out of this behavior.

If I'm right, you might want to use `M-x report-emacs-bug'
to suggest that they do so.  It should be very easy to do,
based on what I see in the code.  The previewing feature
should be optional, IMO, even if someone has decided that
it should be on by default.

FWIW, here is the Emacs 24.5 code, which you should still
be able to use.

(defun string-rectangle (start end string)
  "Replace rectangle contents with STRING on each line.
The length of STRING need not be the same as the rectangle width.

Called from a program, takes three args; START, END and STRING."
  (interactive
   (progn (barf-if-buffer-read-only)
          (list
           (region-beginning)
           (region-end)
           (read-string (format "String rectangle (default %s): "
                                (or (car string-rectangle-history) ""))
                        nil 'string-rectangle-history
                        (car string-rectangle-history)))))
  (goto-char
   (apply-on-rectangle 'string-rectangle-line start end string t)))

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: string-rectangle provides on-the-fly preview, undesirably

Bob Proulx
Drew Adams wrote:
> Someone will correct me if I'm wrong, but they don't seem
> to have provided for an easy opt-out of this behavior.

There doesn't seem to be a way to disable the on-the-fly preview
feature.  Gack.

> If I'm right, you might want to use `M-x report-emacs-bug'
> to suggest that they do so.  It should be very easy to do,
> based on what I see in the code.  The previewing feature
> should be optional, IMO, even if someone has decided that
> it should be on by default.

I have done so and filed a bug in the emacs bug tracker.

  http://debbugs.gnu.org/27974

> FWIW, here is the Emacs 24.5 code, which you should still
> be able to use.

Unfortunately string-rectangle-history appears undefined.  I will need
to expand the prior code import a little further.  I haven't dug into
what it will take to really revert to the previous for me.  I'm
actually mostly just using the previous emacs 24 most of the time and
therefore able to avoid it.  However you have shown me that I should
be able to hack this back in using the previous code such that I can
keep my sanity moving forward.  Once I actually do figure it all out I
will post a follow-up with the details.

Thank you for your help!

Bob

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: string-rectangle provides on-the-fly preview, undesirably

John Mastro
Bob Proulx <[hidden email]> wrote:
> Drew Adams wrote:
> > Someone will correct me if I'm wrong, but they don't seem
> > to have provided for an easy opt-out of this behavior.
>
> There doesn't seem to be a way to disable the on-the-fly preview
> feature.  Gack.

This looks relevant:

rectangle-preview is a variable defined in ‘rect.el’.
Its value is t

Documentation:
If non-nil, ‘string-rectangle’ will show an on-the-fly preview.

You can customize this variable.

This variable was introduced, or its default value was changed, in
version 25.1 of Emacs.

        John

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: string-rectangle provides on-the-fly preview, undesirably

Stefan Monnier
In reply to this post by Bob Proulx
> The command C-x r t string-rectangle in version 24 and previously
> would "Replace rectangle contents with STRING on each line
> (‘string-rectangle’)."  The same happens in version 25 but
> differently.  In version 25 the change is displayed incrementally
> character by character as you type.  With a large displayed rectangle
> this can cause a lot of dynamic "flicker" as every character on the
> display is moved.  This is driving me crazy.

I suggest you file a bug-report for it.  We could/should limit the
preview so it's only done on the visible portion of the text.

> Is there a way to return to the previous version 24 behavior?

Yes, the option is called (surprise surprise) `rectangle-preview`.


        Stefan


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: string-rectangle provides on-the-fly preview, undesirably

Bob Proulx
In reply to this post by John Mastro
John Mastro wrote:
> This looks relevant:
>
> rectangle-preview is a variable defined in ‘rect.el’.
> Its value is t
>
> Documentation:
> If non-nil, ‘string-rectangle’ will show an on-the-fly preview.

Stefan Monnier wrote:
> Yes, the option is called (surprise surprise) `rectangle-preview`.

Yes!  That is the control variable I needed.  Thank you!

  (setq rectangle-preview nil)

The news and anti-news should include this information.  I will update
the bug report with this information.

Thanks!
Bob



Loading...