GNU bug report logs -
#739
Suggested small functions to plug symmetry gaps
Previous Next
Reported by: Reuben Thomas <rrt <at> sc3d.org>
Date: Tue, 19 Aug 2008 13:00:04 UTC
Severity: wishlist
Tags: patch
Done: Chong Yidong <cyd <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 739 in the body.
You can then email your comments to 739 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded to
bug-submit-list <at> lists.donarmstrong.com, Emacs Bugs <bug-gnu-emacs <at> gnu.org>
:
bug#739
; Package
emacs
.
Full text and
rfc822 format available.
Acknowledgement sent to
Reuben Thomas <rrt <at> sc3d.org>
:
New bug report received and forwarded. Copy sent to
Emacs Bugs <bug-gnu-emacs <at> gnu.org>
.
Full text and
rfc822 format available.
Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):
Hi,
I have a couple of functions in my ~/.emacs that are useful, tiny, and plug
obvious "symmetry gaps" in the standard functions. They're not even
original; one at least has been discussed on the list before.
For simple.el:
(defun goto-column (n)
"Goto column COLUMN, counting from column 1 at beginning of line."
(interactive "nGoto column: ")
(move-to-column n))
For rect.el:
(defun copy-rectangle-as-kill (start end)
"Copy the region-rectangle and save it as the last killed one."
(interactive "r")
(setq killed-rectangle (extract-rectangle start end)))
goto-column fills an obvious gap left between goto-char and goto-line, while
copy-rectangle-as-kill mirrors copy-region-as-kill (and has been requested
and suggested before on more than one Emacs mailing list).
Is there some reason not to put these functions in Emacs? I'd be happy to
supply the other obvious missing part (documentation for the manual) if that
helped.
--
http://rrt.sc3d.org/ | resolute, a. obstinate in a good cause (Bierce)
Severity set to `wishlist' from `normal'
Request was from
Chong Yidong <cyd <at> stupidchicken.com>
to
control <at> emacsbugs.donarmstrong.com
.
(Tue, 19 Aug 2008 22:25:06 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Wed, 11 Apr 2012 12:25:01 GMT)
Full text and
rfc822 format available.
Message #10 received at 739 <at> debbugs.gnu.org (full text, mbox):
Reuben Thomas <rrt <at> sc3d.org> writes:
> For simple.el:
>
> (defun goto-column (n)
> "Goto column COLUMN, counting from column 1 at beginning of line."
> (interactive "nGoto column: ")
> (move-to-column n))
This doesn't really seem that useful to me. `C-u 9 <right>' does that
already.
> For rect.el:
>
> (defun copy-rectangle-as-kill (start end)
> "Copy the region-rectangle and save it as the last killed one."
> (interactive "r")
> (setq killed-rectangle (extract-rectangle start end)))
>
> goto-column fills an obvious gap left between goto-char and goto-line,
> while copy-rectangle-as-kill mirrors copy-region-as-kill (and has been
> requested and suggested before on more than one Emacs mailing list).
This is a good idea, especially in read-only buffers. What would the
keystroke be, though? `C-x r c' is already taken...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Wed, 11 Apr 2012 13:49:01 GMT)
Full text and
rfc822 format available.
Message #13 received at 739 <at> debbugs.gnu.org (full text, mbox):
>> (defun goto-column (n)
>> "Goto column COLUMN, counting from column 1 at beginning of line."
>> (interactive "nGoto column: ")
>> (move-to-column n))
> This doesn't really seem that useful to me. `C-u 9 <right>' does that
> already.
No, C-u 9 <right> only works if you're at BOL and if all chars occupy
a single column (e.g. any TAB will throw you off).
But, please don't define a new function/command, just put a interactive
property on `move-to-column' instead.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Wed, 11 Apr 2012 16:06:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 739 <at> debbugs.gnu.org (full text, mbox):
On 11 April 2012 13:23, Lars Magne Ingebrigtsen <larsi <at> gnus.org> wrote:
> Reuben Thomas <rrt <at> sc3d.org> writes:
>
>> For rect.el:
>>
>> (defun copy-rectangle-as-kill (start end)
>> "Copy the region-rectangle and save it as the last killed one."
>> (interactive "r")
>> (setq killed-rectangle (extract-rectangle start end)))
>>
> This is a good idea, especially in read-only buffers. What would the
> keystroke be, though? `C-x r c' is already taken...
The mailing list message in which I found this function suggested C-x
r v, and that's what I use.
--
http://rrt.sc3d.org
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Wed, 11 Apr 2012 17:59:02 GMT)
Full text and
rfc822 format available.
Message #19 received at 739 <at> debbugs.gnu.org (full text, mbox):
> This doesn't really seem that useful to me. `C-u 9 <right>' does that
> already.
> ...
> This is a good idea, especially in read-only buffers. What would the
> keystroke be, though? `C-x r c' is already taken...
It is appropriate to file enhancement requests using `report-emacs-bug'. But
discussion of whether to enhance Emacs following such a request should take
place in emacs-devel, not debbugs.
The list audiences and the list purposes are not the same.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Thu, 12 Apr 2012 16:08:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 739 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
> But, please don't define a new function/command, just put a interactive
> property on `move-to-column' instead.
`move-to-column' already has an interactive spec. :-)
But what did you think about `copy-rectangle-as-kill'? Seems useful to
me.
(On `C-x r v' as suggested.)
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog http://lars.ingebrigtsen.no/
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Thu, 12 Apr 2012 16:20:02 GMT)
Full text and
rfc822 format available.
Message #25 received at 739 <at> debbugs.gnu.org (full text, mbox):
2012/4/12 Lars Magne Ingebrigtsen <larsi <at> gnus.org>:
> Stefan Monnier <monnier <at> iro.umontreal.ca> writes:
>
>> But, please don't define a new function/command, just put a interactive
>> property on `move-to-column' instead.
>
> `move-to-column' already has an interactive spec. :-)
It does, but it could still be extended to prompt for a number if one
isn't given; at the moment, as I originally noted, there is no
columnar equivalent to goto-char and goto-line. If it's not
appropriate to add this behavior to move-to-column, it could be a new
function, as I suggested; this also has the advantage that users might
reasonably infer the existence of goto-column from the other goto-
functions, and be surprised (as I was!) when they don't find it.
--
http://rrt.sc3d.org
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Thu, 12 Apr 2012 18:21:02 GMT)
Full text and
rfc822 format available.
Message #28 received at 739 <at> debbugs.gnu.org (full text, mbox):
>>> But, please don't define a new function/command, just put a interactive
>>> property on `move-to-column' instead.
>> `move-to-column' already has an interactive spec. :-)
> It does, but it could still be extended to prompt for a number if one
> isn't given;
Agreed. Patch welcome.
> at the moment, as I originally noted, there is no
> columnar equivalent to goto-char and goto-line. If it's not
> appropriate to add this behavior to move-to-column, it could be a new
> function, as I suggested; this also has the advantage that users might
> reasonably infer the existence of goto-column from the other goto-
> functions, and be surprised (as I was!) when they don't find it.
I could maybe be persuaded to add a `goto-column' alias.
As for copy-rectangle-as-kill, that sounds perfectly fine to me.
[ Tho I'd much rather do it with M-x push-rectangle-mark RET ...move to
other corner... M-w. E.g. by letting `mark-active' take a third
possible value `rectangle'. ]
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Thu, 12 Apr 2012 20:50:01 GMT)
Full text and
rfc822 format available.
Message #31 received at 739 <at> debbugs.gnu.org (full text, mbox):
On 12 April 2012 19:19, Stefan Monnier <monnier <at> iro.umontreal.ca> wrote:
>>>> But, please don't define a new function/command, just put a interactive
>>>> property on `move-to-column' instead.
>>> `move-to-column' already has an interactive spec. :-)
>> It does, but it could still be extended to prompt for a number if one
>> isn't given;
>
> Agreed. Patch welcome.
I'm glad to see that although move-to-column is a C function, I don't
have to write any C!
Diff against bzr head:
=== modified file 'src/indent.c'
--- src/indent.c 2012-04-09 13:05:48 +0000
+++ src/indent.c 2012-04-12 20:44:45 +0000
@@ -956,7 +956,7 @@
return val >= column;
}
-DEFUN ("move-to-column", Fmove_to_column, Smove_to_column, 1, 2, "p",
+DEFUN ("move-to-column", Fmove_to_column, Smove_to_column, 1, 2,
"(list (or current-prefix-arg (read-number \"Goto column: \")))",
doc: /* Move point to column COLUMN in the current line.
Interactively, COLUMN is the value of prefix numeric argument.
The column of a character is calculated by adding together the widths
---cut-here---
--
http://rrt.sc3d.org
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Thu, 12 Apr 2012 21:23:02 GMT)
Full text and
rfc822 format available.
Message #34 received at 739 <at> debbugs.gnu.org (full text, mbox):
Reuben Thomas <rrt <at> sc3d.org> writes:
> -DEFUN ("move-to-column", Fmove_to_column, Smove_to_column, 1, 2, "p",
> +DEFUN ("move-to-column", Fmove_to_column, Smove_to_column, 1, 2,
> "(list (or current-prefix-arg (read-number \"Goto column: \")))",
This is what "N" does.
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Thu, 12 Apr 2012 21:30:02 GMT)
Full text and
rfc822 format available.
Message #37 received at 739 <at> debbugs.gnu.org (full text, mbox):
On 12 April 2012 22:21, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
> Reuben Thomas <rrt <at> sc3d.org> writes:
>
>> -DEFUN ("move-to-column", Fmove_to_column, Smove_to_column, 1, 2, "p",
>> +DEFUN ("move-to-column", Fmove_to_column, Smove_to_column, 1, 2,
>> "(list (or current-prefix-arg (read-number \"Goto column: \")))",
>
> This is what "N" does.
Great, so, new patch:
=== modified file 'src/indent.c'
--- src/indent.c 2012-04-09 13:05:48 +0000
+++ src/indent.c 2012-04-12 21:26:30 +0000
@@ -956,7 +956,7 @@
return val >= column;
}
-DEFUN ("move-to-column", Fmove_to_column, Smove_to_column, 1, 2, "p",
+DEFUN ("move-to-column", Fmove_to_column, Smove_to_column, 1, 2,
"NGoto column: ",
doc: /* Move point to column COLUMN in the current line.
Interactively, COLUMN is the value of prefix numeric argument.
The column of a character is calculated by adding together the widths
---cut-here---
--
http://rrt.sc3d.org
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Fri, 13 Apr 2012 06:23:01 GMT)
Full text and
rfc822 format available.
Message #40 received at 739 <at> debbugs.gnu.org (full text, mbox):
Reuben Thomas <rrt <at> sc3d.org> writes:
>> This is what "N" does.
>
> Great, so, new patch:
Committed to trunk. Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Fri, 13 Apr 2012 06:28:01 GMT)
Full text and
rfc822 format available.
Message #43 received at 739 <at> debbugs.gnu.org (full text, mbox):
Lars Magne Ingebrigtsen <larsi <at> gnus.org> writes:
>> goto-column fills an obvious gap left between goto-char and goto-line,
>> while copy-rectangle-as-kill mirrors copy-region-as-kill (and has been
>> requested and suggested before on more than one Emacs mailing list).
>
> This is a good idea, especially in read-only buffers. What would the
> keystroke be, though? `C-x r c' is already taken...
How about `C-x r w' (for symmetry with `M-w') and move the binding of
`window-configuration-to-register' to `C-x r W'?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Fri, 13 Apr 2012 18:54:02 GMT)
Full text and
rfc822 format available.
Message #46 received at 739 <at> debbugs.gnu.org (full text, mbox):
On 12 April 2012 22:21, Andreas Schwab <schwab <at> linux-m68k.org> wrote:
> Reuben Thomas <rrt <at> sc3d.org> writes:
>
>> -DEFUN ("move-to-column", Fmove_to_column, Smove_to_column, 1, 2, "p",
>> +DEFUN ("move-to-column", Fmove_to_column, Smove_to_column, 1, 2,
>> "(list (or current-prefix-arg (read-number \"Goto column: \")))",
>
> This is what "N" does.
So why doesn't set-fill-column use N? Because of the default value?
--
http://rrt.sc3d.org
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Sat, 14 Apr 2012 11:34:01 GMT)
Full text and
rfc822 format available.
Message #49 received at 739 <at> debbugs.gnu.org (full text, mbox):
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:
> As for copy-rectangle-as-kill, that sounds perfectly fine to me.
> [ Tho I'd much rather do it with M-x push-rectangle-mark RET ...move to
> other corner... M-w. E.g. by letting `mark-active' take a third
> possible value `rectangle'. ]
Hm. `mark-active'? Anyway, that would make `M-w' not be totally
analogous to `C-w', so then `C-w' should be changed, too, perhaps.
But I think having the rectangle commands live in their own keymap is
kinda nice. When you're in a rectangular kinda mood, you use them a
lot, and it's nice to have them separate from the normal kill/yank
commands.
--
(domestic pets only, the antidote for overdose, milk.)
http://lars.ingebrigtsen.no * Sent from my Rome
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Sat, 14 Apr 2012 11:35:01 GMT)
Full text and
rfc822 format available.
Message #52 received at 739 <at> debbugs.gnu.org (full text, mbox):
Chong Yidong <cyd <at> gnu.org> writes:
> How about `C-x r w' (for symmetry with `M-w') and move the binding of
> `window-configuration-to-register' to `C-x r W'?
I think that's a good idea. I can't imagine that
`window-configuration-to-register' is a command that's used a lot.
--
(domestic pets only, the antidote for overdose, milk.)
http://lars.ingebrigtsen.no * Sent from my Rome
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Sat, 14 Apr 2012 13:49:01 GMT)
Full text and
rfc822 format available.
Message #55 received at 739 <at> debbugs.gnu.org (full text, mbox):
> > How about `C-x r w' (for symmetry with `M-w') and move the
> > binding of `window-configuration-to-register' to `C-x r W'?
>
> I think that's a good idea. I can't imagine that
> `window-configuration-to-register' is a command that's used a lot.
1. That's not a great assumption.
2. `C-x r M-w' is better for symmetry with `M-w'.
Plain `w' has symmetry with lots of other things in Emacs (write commands,
window commands,...). `M-w' is ingrained in finger-memory as a copy operation.
Better to keep `w' for something that actually has a `w' in its name/meaning.
(Yes, I know that Dired uses `w' as `dired-copy-filename-as-kill', but that's
presumably because `M-w' is still available there and the aim was to avoid using
a prefix.)
3. With `M-w', if someone binds `ctl-x-r-map' to a (prefix) key (e.g., a shorter
one than `C-x r'), then s?he gets `M-w' on it, with its "copy" association. As
opposed to getting just `w', with no such useful association. E.g., `<f10>
M-w'.
4. I really don't care. If the above helps, fine.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Mon, 16 Apr 2012 03:13:02 GMT)
Full text and
rfc822 format available.
Message #58 received at 739 <at> debbugs.gnu.org (full text, mbox):
> Hm. `mark-active'? Anyway, that would make `M-w' not be totally
> analogous to `C-w', so then `C-w' should be changed, too, perhaps.
Of course.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Mon, 16 Apr 2012 12:53:02 GMT)
Full text and
rfc822 format available.
Message #61 received at 739 <at> debbugs.gnu.org (full text, mbox):
> So why doesn't set-fill-column use N? Because of the default value?
Yes.
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#739
; Package
emacs
.
(Sat, 14 Jul 2012 02:24:01 GMT)
Full text and
rfc822 format available.
Message #64 received at 739 <at> debbugs.gnu.org (full text, mbox):
"Drew Adams" <drew.adams <at> oracle.com> writes:
> 2. `C-x r M-w' is better for symmetry with `M-w'.
It's an okay choice. If we were starting from scratch, `C-x r w' would
be better, but there's no point causing disruption for the sake of this
small difference. I've committed copy-rectangle-as-kill as C-x r M-w.
bug closed, send any further explanations to
739 <at> debbugs.gnu.org and Reuben Thomas <rrt <at> sc3d.org>
Request was from
Chong Yidong <cyd <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Sat, 14 Jul 2012 02:26: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
.
(Sat, 11 Aug 2012 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 11 years and 281 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.