GNU bug report logs - #23248
25.1.50; user option rectangle-preview is unused

Previous Next

Package: emacs;

Reported by: Mark Oteiza <mvoteiza <at> udel.edu>

Date: Sat, 9 Apr 2016 00:25:02 UTC

Severity: minor

Found in version 25.1.50

Fixed in version 25.0.93

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 23248 in the body.
You can then email your comments to 23248 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#23248; Package emacs. (Sat, 09 Apr 2016 00:25:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mark Oteiza <mvoteiza <at> udel.edu>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 09 Apr 2016 00:25:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mark Oteiza <mvoteiza <at> udel.edu>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.1.50; user option rectangle-preview is unused
Date: Fri, 08 Apr 2016 20:23:44 -0400
Hi,

The defcustom `rectangle-preview' in rect.el--for controlling whether the
preview is shown for C-x r t--is not used.

In GNU Emacs 25.1.50.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars)
 of 2016-03-20 built on logos
Repository revision: 5283593ced29a2c98e4af3607a68ee7a6d10fcac
Configured using:
 'configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --without-gconf --with-modules
 --with-x-toolkit=lucid 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe
 -fstack-protector-strong --param=ssp-buffer-size=4 -g
 -fvar-tracking-assignments -g -fvar-tracking-assignments'
 CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23248; Package emacs. (Thu, 14 Apr 2016 16:16:02 GMT) Full text and rfc822 format available.

Message #8 received at 23248 <at> debbugs.gnu.org (full text, mbox):

From: Mark Oteiza <mvoteiza <at> udel.edu>
To: 23248 <at> debbugs.gnu.org
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>
Subject: 25.1.50; user option rectangle-preview is unused
Date: Thu, 14 Apr 2016 12:15:27 -0400
---
This looks like the correct place for rectangle-preview to me.

diff --git a/lisp/rect.el b/lisp/rect.el
index 685213a..82e2297 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -408,40 +408,41 @@ defcustom rectangle-preview t
   :type 'boolean)
 
 (defun rectangle--string-preview ()
-  (let ((str (minibuffer-contents)))
-    (when (equal str "")
-      (setq str (or (car-safe minibuffer-default)
-                    (if (stringp minibuffer-default) minibuffer-default))))
-    (when str (setq str (propertize str 'face 'region)))
-    (with-selected-window rectangle--string-preview-window
-      (unless (or (null rectangle--string-preview-state)
-                  (equal str (car rectangle--string-preview-state)))
-        (rectangle--string-flush-preview)
-        (apply-on-rectangle
-         (lambda (startcol endcol)
-           (let* ((sc (move-to-column startcol))
-                  (start (if (<= sc startcol) (point)
-                           (forward-char -1)
-                           (setq sc (current-column))
-                           (point)))
-                  (ec (move-to-column endcol))
-                  (end (point))
-                  (ol (make-overlay start end)))
-             (push ol (nthcdr 3 rectangle--string-preview-state))
-             ;; FIXME: The extra spacing doesn't interact correctly with
-             ;; the extra spacing added by the rectangular-region-highlight.
-             (when (< sc startcol)
-               (overlay-put ol 'before-string (rectangle--space-to startcol)))
-             (let ((as (when (< endcol ec)
-                         ;; (rectangle--space-to ec)
-                         (spaces-string (- ec endcol))
-                         )))
-               (if (= start end)
-                   (overlay-put ol 'after-string (if as (concat str as) str))
-                 (overlay-put ol 'display str)
-                 (if as (overlay-put ol 'after-string as))))))
-         (nth 1 rectangle--string-preview-state)
-         (nth 2 rectangle--string-preview-state))))))
+  (when rectangle-preview
+    (let ((str (minibuffer-contents)))
+      (when (equal str "")
+        (setq str (or (car-safe minibuffer-default)
+                      (if (stringp minibuffer-default) minibuffer-default))))
+      (when str (setq str (propertize str 'face 'region)))
+      (with-selected-window rectangle--string-preview-window
+        (unless (or (null rectangle--string-preview-state)
+                    (equal str (car rectangle--string-preview-state)))
+          (rectangle--string-flush-preview)
+          (apply-on-rectangle
+           (lambda (startcol endcol)
+             (let* ((sc (move-to-column startcol))
+                    (start (if (<= sc startcol) (point)
+                             (forward-char -1)
+                             (setq sc (current-column))
+                             (point)))
+                    (ec (move-to-column endcol))
+                    (end (point))
+                    (ol (make-overlay start end)))
+               (push ol (nthcdr 3 rectangle--string-preview-state))
+               ;; FIXME: The extra spacing doesn't interact correctly with
+               ;; the extra spacing added by the rectangular-region-highlight.
+               (when (< sc startcol)
+                 (overlay-put ol 'before-string (rectangle--space-to startcol)))
+               (let ((as (when (< endcol ec)
+                           ;; (rectangle--space-to ec)
+                           (spaces-string (- ec endcol))
+                           )))
+                 (if (= start end)
+                     (overlay-put ol 'after-string (if as (concat str as) str))
+                   (overlay-put ol 'display str)
+                   (if as (overlay-put ol 'after-string as))))))
+           (nth 1 rectangle--string-preview-state)
+           (nth 2 rectangle--string-preview-state)))))))
 
 ;; FIXME: Should this be turned into inhibit-region-highlight and made to apply
 ;; to non-rectangular regions as well?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23248; Package emacs. (Thu, 14 Apr 2016 16:40:01 GMT) Full text and rfc822 format available.

Message #11 received at 23248 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Mark Oteiza <mvoteiza <at> udel.edu>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 23248 <at> debbugs.gnu.org
Subject: Re: bug#23248: 25.1.50; user option rectangle-preview is unused
Date: Thu, 14 Apr 2016 12:38:52 -0400
Note that it does not use the dedicated face either, just 'region.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#23248; Package emacs. (Sat, 16 Apr 2016 16:07:02 GMT) Full text and rfc822 format available.

Message #14 received at 23248 <at> debbugs.gnu.org (full text, mbox):

From: Mark Oteiza <mvoteiza <at> udel.edu>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 23248 <at> debbugs.gnu.org
Subject: Re: bug#23248: 25.1.50; user option rectangle-preview is unused
Date: Sat, 16 Apr 2016 12:06:48 -0400
On 14/04/16 at 12:38pm, Glenn Morris wrote:
> 
> Note that it does not use the dedicated face either, just 'region.

Good catch, thanks. I pushed the previous patch and one for the face.




bug marked as fixed in version 25.0.93, send any further explanations to 23248 <at> debbugs.gnu.org and Mark Oteiza <mvoteiza <at> udel.edu> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 17 Apr 2016 17:12:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 16 May 2016 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 90 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.