unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* what-cursor-position - why not list the line # as well?
@ 2006-04-02  1:02 Drew Adams
  2006-04-02  3:27 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Drew Adams @ 2006-04-02  1:02 UTC (permalink / raw)


`what-cursor-position' gives lots of info about the cursor position,
including the column:

 Char: d (100, #o144, #x64) point=298976 (99%) column=51

Why not have it also provide the line #? That way, people wouldn't need to
use `what-line' as well as `what-cursor-position' to get all the info (and
`what-line' is unbound in many buffers).

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

* Re: what-cursor-position - why not list the line # as well?
  2006-04-02  1:02 what-cursor-position - why not list the line # as well? Drew Adams
@ 2006-04-02  3:27 ` Eli Zaretskii
  2006-04-02 15:05   ` Drew Adams
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2006-04-02  3:27 UTC (permalink / raw)
  Cc: emacs-devel

> From: "Drew Adams" <drew.adams@oracle.com>
> Date: Sat, 1 Apr 2006 17:02:02 -0800
> 
> `what-cursor-position' gives lots of info about the cursor position,
> including the column:
> 
>  Char: d (100, #o144, #x64) point=298976 (99%) column=51
> 
> Why not have it also provide the line #?

Because the line number is shown by default in the mode line?

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

* RE: what-cursor-position - why not list the line # as well?
  2006-04-02  3:27 ` Eli Zaretskii
@ 2006-04-02 15:05   ` Drew Adams
  2006-04-02 17:36     ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Drew Adams @ 2006-04-02 15:05 UTC (permalink / raw)


    > `what-cursor-position' gives lots of info about the cursor position,
    > including the column:
    >  Char: d (100, #o144, #x64) point=298976 (99%) column=51
    > Why not have it also provide the line #?

    Because the line number is shown by default in the mode line?

That's just the default mode-line behavior, and you cannot copy+paste the
info.

I use both the column and line numbers in the mode line, but I would still
find it handy to have both in `C-x =' also.

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

* Re: what-cursor-position - why not list the line # as well?
  2006-04-02 15:05   ` Drew Adams
@ 2006-04-02 17:36     ` Eli Zaretskii
  2006-04-02 18:51       ` Drew Adams
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2006-04-02 17:36 UTC (permalink / raw)
  Cc: emacs-devel

> From: "Drew Adams" <drew.adams@oracle.com>
> Date: Sun, 2 Apr 2006 08:05:23 -0700
> 
> I use both the column and line numbers in the mode line, but I would still
> find it handy to have both in `C-x =' also.

*Shrug* If you need that information frequently, you could write a
simple function that puts it into the kill ring, and bind it to some
key.

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

* RE: what-cursor-position - why not list the line # as well?
  2006-04-02 17:36     ` Eli Zaretskii
@ 2006-04-02 18:51       ` Drew Adams
  2006-04-02 23:17         ` Stephen Berman
                           ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Drew Adams @ 2006-04-02 18:51 UTC (permalink / raw)


    > I use both the column and line numbers in the mode line, but
    > I would still find it handy to have both in `C-x =' also.

    *Shrug* If you need that information frequently, you could write a
    simple function that puts it into the kill ring, and bind it to some
    key.

Why "*Shrug*"? Are you upset? I can of course write lots of functions, but
this is something I proposed adding to an existing Emacs command.  The
question is, why not?

The only reason you gave was that that info is already (by default) in the
mode line. That's a fair argument, but I replied: 1) That default behavior
does not mean that it is in the mode line for everyone all of the time. 2)
You cannot copy+paste mode-line info (AFAIK).

Instead of responding to either a) my reasons for making this change or b)
my reasons why your argument against it is insufficient, you tell me that I
can always code the functionality myself, for my own use. Do you think that
reply helps advance the discussion? Can we discuss the pros and cons of the
proposal?

Why such teeth-pulling over a simple (probably trivial) proposal? If you
don't think it's a good idea, please provide some arguments to further the
discussion.

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

* Re: what-cursor-position - why not list the line # as well?
  2006-04-02 18:51       ` Drew Adams
@ 2006-04-02 23:17         ` Stephen Berman
  2006-04-03  3:39         ` Eli Zaretskii
  2006-04-03  9:51         ` Ehud Karni
  2 siblings, 0 replies; 8+ messages in thread
From: Stephen Berman @ 2006-04-02 23:17 UTC (permalink / raw)


On Sun, 2 Apr 2006 11:51:05 -0700 "Drew Adams" <drew.adams@oracle.com> wrote:

>     > I use both the column and line numbers in the mode line, but
>     > I would still find it handy to have both in `C-x =' also.
[...]
> You cannot copy+paste mode-line info (AFAIK).

You can use format-mode-line, e.g. evalling (format-mode-line
mode-line-format 0) returns an unpropertized string of the mode line.

Steve Berman

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

* Re: what-cursor-position - why not list the line # as well?
  2006-04-02 18:51       ` Drew Adams
  2006-04-02 23:17         ` Stephen Berman
@ 2006-04-03  3:39         ` Eli Zaretskii
  2006-04-03  9:51         ` Ehud Karni
  2 siblings, 0 replies; 8+ messages in thread
From: Eli Zaretskii @ 2006-04-03  3:39 UTC (permalink / raw)
  Cc: emacs-devel

> From: "Drew Adams" <drew.adams@oracle.com>
> Date: Sun, 2 Apr 2006 11:51:05 -0700
> 
>     *Shrug* If you need that information frequently, you could write a
>     simple function that puts it into the kill ring, and bind it to some
>     key.
> 
> Why "*Shrug*"? Are you upset? I can of course write lots of functions, but
> this is something I proposed adding to an existing Emacs command.  The
> question is, why not?

``Why not'' is never a good question, because if we were guided by it,
we will make Emacs unbearably large and complex.

> Instead of responding to either a) my reasons for making this change or b)
> my reasons why your argument against it is insufficient, you tell me that I
> can always code the functionality myself, for my own use. Do you think that
> reply helps advance the discussion?

It should be obvious from what I said that I think you are asking for
a feature that would be used only very rarely.  Does expressing an
opinion advances a discussion (I always thought it was)?

> Why such teeth-pulling over a simple (probably trivial) proposal?

Please drop the attitude, Drew, it makes it hard to argue with your
suggestions in a rational way.

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

* Re: what-cursor-position - why not list the line # as well?
  2006-04-02 18:51       ` Drew Adams
  2006-04-02 23:17         ` Stephen Berman
  2006-04-03  3:39         ` Eli Zaretskii
@ 2006-04-03  9:51         ` Ehud Karni
  2 siblings, 0 replies; 8+ messages in thread
From: Ehud Karni @ 2006-04-03  9:51 UTC (permalink / raw)
  Cc: emacs-devel

On Sun, 2 Apr 2006 11:51:05 -0700, Drew Adams wrote:
>
>   DA> I use both the column and line numbers in the mode line, but
>   DA> I would still find it handy to have both in `C-x =' also.
>
> EZ> *Shrug* If you need that information frequently, you could write a
> EZ> simple function that puts it into the kill ring, and bind it to some
> EZ> key.
>
> The only reason you gave was that that info is already (by default) in the
> mode line. That's a fair argument, but I replied: 1) That default behavior
> does not mean that it is in the mode line for everyone all of the time. 2)
> You cannot copy+paste mode-line info (AFAIK).

Here is a simple function that is used here (for years):

(defun char-position-msg (&optional FULL)
 "print position message with line number, calls `what-cursor-position'
In addition, with prefix argument, show details about that character
in *Help* buffer.  See also the command `describe-char-after'."
   (interactive "P")
       (let ((cp (what-cursor-position FULL))
             (lp (what-line)))
           (message "%s %s" cp lp)))


Now the pro and con reasons.
PRO: The line number is not displayed in some (many) occasions - if
     the file has long lines, when the buffer is narrowed.
CON: The line number function may be VERY time consuming for very
     large buffers (depends on the machine you run Emacs on).

Ehud.


--
 Ehud Karni           Tel: +972-3-7966-561  /"\
 Mivtach - Simon      Fax: +972-3-7966-667  \ /  ASCII Ribbon Campaign
 Insurance agencies   (USA) voice mail and   X   Against   HTML   Mail
 http://www.mvs.co.il  FAX:  1-815-5509341  / \
 GnuPG: 98EA398D <http://www.keyserver.net/>    Better Safe Than Sorry

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

end of thread, other threads:[~2006-04-03  9:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-02  1:02 what-cursor-position - why not list the line # as well? Drew Adams
2006-04-02  3:27 ` Eli Zaretskii
2006-04-02 15:05   ` Drew Adams
2006-04-02 17:36     ` Eli Zaretskii
2006-04-02 18:51       ` Drew Adams
2006-04-02 23:17         ` Stephen Berman
2006-04-03  3:39         ` Eli Zaretskii
2006-04-03  9:51         ` Ehud Karni

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