unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#24364: 25.1; C-x C-x in rectangle-mark-mode leaves corner out
@ 2016-09-04 15:03 Marie-Christine Jones
  2016-09-04 18:50 ` Alan Third
  0 siblings, 1 reply; 4+ messages in thread
From: Marie-Christine Jones @ 2016-09-04 15:03 UTC (permalink / raw)
  To: 24364



When point is at the end of the (*scratch*-) buffer and
rectangle-mark-mode is activated, C-x C-x cycles through all corners but
the bottom left one, in this order (starting in the top right corner):
bottom right, top left, bottom right, top right.  I think it should go
to the bottom left corner as well.

Starting from 'emacs -Q':

 C-x SPC [rectangle-mark-mode]
 C-p [rectangle-previous-line]
 C-p [rectangle-previous-line]
 C-f [rectangle-forward-char]
 C-f [rectangle-forward-char]
 C-x C-x [rectangle-exchange-point-and-mark]
 C-x C-x [rectangle-exchange-point-and-mark]
 C-x C-x [rectangle-exchange-point-and-mark]
 C-x C-x [rectangle-exchange-point-and-mark]
 C-h l [view-lossage]



In GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.5)
 of 2016-08-22 built on slartibartfast
Windowing system distributor 'The X.Org Foundation', version 11.0.11604000
System Description:	Debian GNU/Linux 8.5 (jessie)

Configured features:
XPM JPEG TIFF GIF PNG SOUND GPM DBUS GSETTINGS NOTIFY LIBXML2 FREETYPE
XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11

Important settings:
  value of $LANG: en_GB.utf8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  rectangle-mark-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark set (rectangle mode)
Type C-x 1 to delete the help window.

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec password-cache epg epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util help-fns mail-prsvr mail-utils
help-mode easymenu cl-loaddefs pcase cl-lib rect time-date mule-util
tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type
mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register
page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core frame cl-generic cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european
ethiopic indian cyrillic chinese charscript case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote dbusbind inotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 88335 8634)
 (symbols 48 20096 0)
 (miscs 40 122 146)
 (strings 32 15021 4385)
 (string-bytes 1 426328)
 (vectors 16 12084)
 (vector-slots 8 441102 4380)
 (floats 8 169 31)
 (intervals 56 193 0)
 (buffers 976 18)
 (heap 1024 50002 4363))







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

* bug#24364: 25.1; C-x C-x in rectangle-mark-mode leaves corner out
  2016-09-04 15:03 bug#24364: 25.1; C-x C-x in rectangle-mark-mode leaves corner out Marie-Christine Jones
@ 2016-09-04 18:50 ` Alan Third
  2016-09-04 19:03   ` Eli Zaretskii
  2016-09-04 22:19   ` bug#24364: [PATCH] Fix cursor at bottom left of rectangle (bug#24364) Alan Third
  0 siblings, 2 replies; 4+ messages in thread
From: Alan Third @ 2016-09-04 18:50 UTC (permalink / raw)
  To: Marie-Christine Jones; +Cc: 24364

On Sun, Sep 04, 2016 at 05:03:16PM +0200, Marie-Christine Jones wrote:
> 
> 
> When point is at the end of the (*scratch*-) buffer and
> rectangle-mark-mode is activated, C-x C-x cycles through all corners but
> the bottom left one, in this order (starting in the top right corner):
> bottom right, top left, bottom right, top right.  I think it should go
> to the bottom left corner as well.

It looks as though the problem occurs when the point is on the left
side of the rectangle, and also at the end of a line.

Because it’s an actual position in the buffer (not beyond EOL)
rectangle--point-crutches is nil, and therefore
rectangle--place-cursor is a no‐op.

Unfortunately it looks like when the overlay is put in place the
cursor jumps to the end of it, even though (point) still reports the
EOL without overlay.

My guess is that the overlay behaviour is correct and rect.el needs to
work around that.
-- 
Alan Third





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

* bug#24364: 25.1; C-x C-x in rectangle-mark-mode leaves corner out
  2016-09-04 18:50 ` Alan Third
@ 2016-09-04 19:03   ` Eli Zaretskii
  2016-09-04 22:19   ` bug#24364: [PATCH] Fix cursor at bottom left of rectangle (bug#24364) Alan Third
  1 sibling, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2016-09-04 19:03 UTC (permalink / raw)
  To: Alan Third; +Cc: 24364, mariejones

> Date: Sun, 4 Sep 2016 19:50:03 +0100
> From: Alan Third <alan@idiocy.org>
> Cc: 24364@debbugs.gnu.org
> 
> Unfortunately it looks like when the overlay is put in place the
> cursor jumps to the end of it, even though (point) still reports the
> EOL without overlay.

I'm not sure I understand what you mean by "EOL without overlay", but
if you mean to say that cursor is always displayed after any overlay
strings at point, then that is correct: this has always been Emacs
behavior, since v21.1 at least.

> My guess is that the overlay behaviour is correct and rect.el needs to
> work around that.

Most probably.





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

* bug#24364: [PATCH] Fix cursor at bottom left of rectangle (bug#24364)
  2016-09-04 18:50 ` Alan Third
  2016-09-04 19:03   ` Eli Zaretskii
@ 2016-09-04 22:19   ` Alan Third
  1 sibling, 0 replies; 4+ messages in thread
From: Alan Third @ 2016-09-04 22:19 UTC (permalink / raw)
  To: 24364; +Cc: mariejones

* lisp/rect.el (rectangle--col-pos): Don't assume point at EOL doesn't
require rectangle--point-crutches to be set.
---
 lisp/rect.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/rect.el b/lisp/rect.el
index 13499d6..f9bebc4 100644
--- a/lisp/rect.el
+++ b/lisp/rect.el
@@ -108,7 +108,7 @@ rectangle--pos-cols
 
 (defun rectangle--col-pos (col kind)
   (let ((c (move-to-column col)))
-    (if (= c col)
+    (if (and (= c col) (not (eolp)))
         (if (eq kind 'point)
             (if (window-parameter nil 'rectangle--point-crutches)
                 (setf (window-parameter nil 'rectangle--point-crutches) nil))
-- 
I believe this small change sorts it.
-- 
Alan Third





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

end of thread, other threads:[~2016-09-04 22:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-04 15:03 bug#24364: 25.1; C-x C-x in rectangle-mark-mode leaves corner out Marie-Christine Jones
2016-09-04 18:50 ` Alan Third
2016-09-04 19:03   ` Eli Zaretskii
2016-09-04 22:19   ` bug#24364: [PATCH] Fix cursor at bottom left of rectangle (bug#24364) Alan Third

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