Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Elisp: Setting column position?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michael Schuerig  
View profile  
 More options Jan 14 2009, 8:07 pm
Newsgroups: comp.emacs
From: Michael Schuerig <mich...@schuerig.de>
Date: Thu, 15 Jan 2009 02:07:33 +0100
Local: Wed, Jan 14 2009 8:07 pm
Subject: Elisp: Setting column position?

I've written my first elisp functions to move the current line up or
down

(defun move-line-down ()
  (interactive)
  (save-excursion
    (next-line)
    (transpose-lines 1))
  (next-line))

(defun move-line-up ()
  (interactive)
  (save-excursion
    (next-line)
    (transpose-lines -1)))

(global-set-key [\M-down] 'move-line-down)
(global-set-key [\M-up] 'move-line-up)

and while they do almost what I want, they don't do it exactly. After
executing one of these functions, point is moved to the first column,
whereas I want it, of course, to stay in the same column. I've tinkered
with current-column and set-goal-column, but without success.
Surprisingly, there doesn't seem to be a function to move the point to
a specific column. What am I missing?

Michael

--
Michael Schuerig
mailto:mich...@schuerig.de
http://www.schuerig.de/michael/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Johan Bockgård  
View profile  
 More options Jan 15 2009, 12:38 pm
Newsgroups: comp.emacs
From: bojohan+n...@dd.chalmers.se (Johan Bockgård)
Date: Thu, 15 Jan 2009 18:38:45 +0100
Local: Thurs, Jan 15 2009 12:38 pm
Subject: Re: Elisp: Setting column position?

Michael Schuerig <mich...@schuerig.de> writes:
> Surprisingly, there doesn't seem to be a function to move the point to
> a specific column. What am I missing?

move-to-column

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Schuerig  
View profile  
 More options Jan 15 2009, 2:31 pm
Newsgroups: comp.emacs
From: Michael Schuerig <mich...@schuerig.de>
Date: Thu, 15 Jan 2009 20:31:41 +0100
Local: Thurs, Jan 15 2009 2:31 pm
Subject: Re: Elisp: Setting column position?

Johan Bockgård wrote:
> Michael Schuerig <mich...@schuerig.de> writes:

>> Surprisingly, there doesn't seem to be a function to move the point
>> to a specific column. What am I missing?

> move-to-column

Thanks, that does what I want. I have absolutely no idea why I didn't
find it myself.

Michael

--
Michael Schuerig
mailto:mich...@schuerig.de
http://www.schuerig.de/michael/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ted Zlatanov  
View profile  
 More options Jan 16 2009, 2:12 pm
Newsgroups: comp.emacs
From: Ted Zlatanov <t...@lifelogs.com>
Date: Fri, 16 Jan 2009 13:12:23 -0600
Local: Fri, Jan 16 2009 2:12 pm
Subject: Re: Elisp: Setting column position?
On Thu, 15 Jan 2009 20:31:41 +0100 Michael Schuerig <mich...@schuerig.de> wrote:

MS> Johan Bockgård wrote:
>> Michael Schuerig <mich...@schuerig.de> writes:

>>> Surprisingly, there doesn't seem to be a function to move the point
>>> to a specific column. What am I missing?

>> move-to-column

MS> Thanks, that does what I want. I have absolutely no idea why I didn't
MS> find it myself.

Well, you have goto-line and goto-char, but then there's move-to-column
and move-to-window-line.  Not to mention jump-to-register.  I usually
end up doing M-x apropos no matter what.

Ted


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Schuerig  
View profile  
 More options Jan 16 2009, 3:10 pm
Newsgroups: comp.emacs
From: Michael Schuerig <mich...@schuerig.de>
Date: Fri, 16 Jan 2009 21:10:44 +0100
Local: Fri, Jan 16 2009 3:10 pm
Subject: Re: Elisp: Setting column position?

Yes, that's exactly what I did, repeatedly. Still, I didn't notice
move-to-column.

Michael

--
Michael Schuerig
mailto:mich...@schuerig.de
http://www.schuerig.de/michael/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Xah Lee  
View profile  
 More options Jan 17 2009, 1:23 pm
Newsgroups: comp.emacs, gnu.emacs.help
From: Xah Lee <xah...@gmail.com>
Date: Sat, 17 Jan 2009 10:23:23 -0800 (PST)
Local: Sat, Jan 17 2009 1:23 pm
Subject: Re: Elisp: Setting column position?
On Jan 16, 12:10 pm, Michael Schuerig <mich...@schuerig.de> wrote:

On Jan 16, 11:12 am, Ted Zlatanov <t...@lifelogs.com> wrote:

i think there's something desired here...

i vaguely recall also wanted move-to-column, but i recall thought it
didn't exist. Yes of course i knew apropos, and elisp-index-search and
reasonably familiar with elisp and its manual.

I think it would be great that in the function's in-line doc, it would
say related functions. For example, if one looks up on goto-line, then
at the bottom it might say:

See also: goto-char, move-to-column, ...

I suggest this in a bug report #1119

http://groups.google.com/group/gnu.emacs.bug/browse_frm/thread/7fe3a2...

not sure what's the status...

  Xah
http://xahlee.org/



 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Xah Lee  
View profile  
 More options Jan 17 2009, 1:29 pm
Newsgroups: comp.emacs, gnu.emacs.help
From: Xah Lee <xah...@gmail.com>
Date: Sat, 17 Jan 2009 10:29:45 -0800 (PST)
Local: Sat, Jan 17 2009 1:29 pm
Subject: Re: Elisp: Setting column position?
On Jan 17, 10:23 am, Xah Lee <xah...@gmail.com> wrote:

Note that listing related functions in a function's doc is in many
programing manuals. e.g Mathematica, MS's JScript, PHP ... they are
quite useful. Because for those not expert yet of a lang (which is
majority), often they do not know similar functions or do not know if
there's manual section that list such, and often are confused about
the differences of many functions that seems the same ....

  Xah
http://xahlee.org/



 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ted Zlatanov  
View profile  
 More options Jan 20 2009, 12:40 pm
Newsgroups: comp.emacs, gnu.emacs.help
Followup-To: comp.emacs
From: Ted Zlatanov <t...@lifelogs.com>
Date: Tue, 20 Jan 2009 11:40:42 -0600
Local: Tues, Jan 20 2009 12:40 pm
Subject: Re: Elisp: Setting column position?
On Sat, 17 Jan 2009 10:23:23 -0800 (PST) Xah Lee <xah...@gmail.com> wrote:

XL> i vaguely recall also wanted move-to-column, but i recall thought it
XL> didn't exist. Yes of course i knew apropos, and elisp-index-search and
XL> reasonably familiar with elisp and its manual.

XL> I think it would be great that in the function's in-line doc, it would
XL> say related functions. For example, if one looks up on goto-line, then
XL> at the bottom it might say:

XL> See also: goto-char, move-to-column, ...

On Sat, 17 Jan 2009 10:29:45 -0800 (PST) Xah Lee <xah...@gmail.com> wrote:

XL> Note that listing related functions in a function's doc is in many
XL> programing manuals. e.g Mathematica, MS's JScript, PHP ... they are
XL> quite useful. Because for those not expert yet of a lang (which is
XL> majority), often they do not know similar functions or do not know if
XL> there's manual section that list such, and often are confused about
XL> the differences of many functions that seems the same ....

I agree this would be useful.  It's best done with tags IMO, rather than
explicitly listing the related functions.  For example, motion commands
should be tagged "motion" and then every command with that tag can
automatically list every motion command.  The key is that the extra work
is in classification, not in tediously listing every command's peers.

Tags I could use: motion, file, coding-system, menu, buffer, process

Each package should probably tag its commands with the package name.

Short tags are not always descriptive enough, but long tags get
unpleasantly verbose so the real art is in balancing between the two.

Anything more hierarchical than tags is painful to manage in the long run.

Ted


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Xah Lee  
View profile  
 More options Jan 20 2009, 12:46 pm
Newsgroups: comp.emacs, gnu.emacs.help
From: Xah Lee <xah...@gmail.com>
Date: Tue, 20 Jan 2009 09:46:09 -0800 (PST)
Local: Tues, Jan 20 2009 12:46 pm
Subject: Re: Elisp: Setting column position?
On Jan 20, 9:40 am, Ted Zlatanov <t...@lifelogs.com> wrote:

can you send this suggestion to the emacs dev? :)

  Xah
http://xahlee.org/



 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »