From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Ehud Karni" Newsgroups: gmane.emacs.devel Subject: Re: what-cursor-position - why not list the line # as well? Date: Mon, 3 Apr 2006 12:51:18 +0300 Organization: Mivtach-Simon Insurance agencies Message-ID: <200604030951.k339pIk4008123@beta.mvs.co.il> References: Reply-To: ehud@unix.mvs.co.il NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-8-i Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1144057910 32712 80.91.229.2 (3 Apr 2006 09:51:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 3 Apr 2006 09:51:50 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Apr 03 11:51:46 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FQLir-0006Jq-HH for ged-emacs-devel@m.gmane.org; Mon, 03 Apr 2006 11:51:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FQLir-0005ol-1f for ged-emacs-devel@m.gmane.org; Mon, 03 Apr 2006 05:51:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FQLie-0005og-Gd for emacs-devel@gnu.org; Mon, 03 Apr 2006 05:51:32 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FQLic-0005oI-Om for emacs-devel@gnu.org; Mon, 03 Apr 2006 05:51:32 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FQLic-0005oF-ML for emacs-devel@gnu.org; Mon, 03 Apr 2006 05:51:30 -0400 Original-Received: from [193.16.147.12] (helo=unix.mvs.co.il) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FQLla-0002LX-H6; Mon, 03 Apr 2006 05:54:35 -0400 Original-Received: from beta.mvs.co.il (beta [10.253.0.3]) by unix.mvs.co.il (8.13.0/8.13.0) with ESMTP id k339pKoX022480 for ; Mon, 3 Apr 2006 12:51:20 +0300 Original-Received: from beta.mvs.co.il (localhost [127.0.0.1]) by beta.mvs.co.il (8.13.4/8.13.4) with ESMTP id k339pK1l008128 for ; Mon, 3 Apr 2006 12:51:20 +0300 Original-Received: (from root@localhost) by beta.mvs.co.il (8.13.4/8.13.4/Submit) id k339pIk4008123; Mon, 3 Apr 2006 12:51:18 +0300 Original-To: "Eli Zaretskii" , " Drew Adams" In-reply-to: (message from Drew Adams on Sun, 2 Apr 2006 11:51:05 -0700) X-Mailer: Emacs 21.3.1 rmail (send-msg 1.108) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:52358 Archived-At: 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 Better Safe Than Sorry