unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* string-rectangle provides on-the-fly preview, undesirably
@ 2017-07-02 23:31 Bob Proulx
  2017-07-02 23:51 ` Drew Adams
  2017-08-05 20:37 ` Stefan Monnier
  0 siblings, 2 replies; 6+ messages in thread
From: Bob Proulx @ 2017-07-02 23:31 UTC (permalink / raw)
  To: help-gnu-emacs

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.



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

* RE: string-rectangle provides on-the-fly preview, undesirably
  2017-07-02 23:31 string-rectangle provides on-the-fly preview, undesirably Bob Proulx
@ 2017-07-02 23:51 ` Drew Adams
  2017-08-05 20:06   ` Bob Proulx
  2017-08-05 20:37 ` Stefan Monnier
  1 sibling, 1 reply; 6+ messages in thread
From: Drew Adams @ 2017-07-02 23:51 UTC (permalink / raw)
  To: Bob Proulx, help-gnu-emacs

> 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)))



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

* Re: string-rectangle provides on-the-fly preview, undesirably
  2017-07-02 23:51 ` Drew Adams
@ 2017-08-05 20:06   ` Bob Proulx
  2017-08-05 20:35     ` John Mastro
  0 siblings, 1 reply; 6+ messages in thread
From: Bob Proulx @ 2017-08-05 20:06 UTC (permalink / raw)
  To: help-gnu-emacs

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



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

* Re: string-rectangle provides on-the-fly preview, undesirably
  2017-08-05 20:06   ` Bob Proulx
@ 2017-08-05 20:35     ` John Mastro
  2017-08-05 21:00       ` Bob Proulx
  0 siblings, 1 reply; 6+ messages in thread
From: John Mastro @ 2017-08-05 20:35 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

Bob Proulx <bob@proulx.com> 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



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

* Re: string-rectangle provides on-the-fly preview, undesirably
  2017-07-02 23:31 string-rectangle provides on-the-fly preview, undesirably Bob Proulx
  2017-07-02 23:51 ` Drew Adams
@ 2017-08-05 20:37 ` Stefan Monnier
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Monnier @ 2017-08-05 20:37 UTC (permalink / raw)
  To: help-gnu-emacs

> 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




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

* Re: string-rectangle provides on-the-fly preview, undesirably
  2017-08-05 20:35     ` John Mastro
@ 2017-08-05 21:00       ` Bob Proulx
  0 siblings, 0 replies; 6+ messages in thread
From: Bob Proulx @ 2017-08-05 21:00 UTC (permalink / raw)
  To: help-gnu-emacs

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





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

end of thread, other threads:[~2017-08-05 21:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-02 23:31 string-rectangle provides on-the-fly preview, undesirably Bob Proulx
2017-07-02 23:51 ` Drew Adams
2017-08-05 20:06   ` Bob Proulx
2017-08-05 20:35     ` John Mastro
2017-08-05 21:00       ` Bob Proulx
2017-08-05 20:37 ` Stefan Monnier

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).