From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Nick Roberts Newsgroups: gmane.emacs.devel Subject: put goto-line on modeline Date: Mon, 17 Jan 2005 14:53:21 +1300 Message-ID: <16875.6801.853047.943117@farnswood.snap.net.nz> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1105928383 23424 80.91.229.6 (17 Jan 2005 02:19:43 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 17 Jan 2005 02:19:43 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 17 03:19:37 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CqMUT-000323-00 for ; Mon, 17 Jan 2005 03:19:37 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CqMgI-0003Sk-Nw for ged-emacs-devel@m.gmane.org; Sun, 16 Jan 2005 21:31:50 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1CqMbu-0002Hx-Sl for emacs-devel@gnu.org; Sun, 16 Jan 2005 21:27:19 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1CqMbn-0002F9-6S for emacs-devel@gnu.org; Sun, 16 Jan 2005 21:27:12 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1CqMbc-00024l-Tj for emacs-devel@gnu.org; Sun, 16 Jan 2005 21:27:01 -0500 Original-Received: from [202.37.101.8] (helo=viper.snap.net.nz) by monty-python.gnu.org with esmtp (Exim 4.34) id 1CqMC4-0005Yq-CD for emacs-devel@gnu.org; Sun, 16 Jan 2005 21:00:36 -0500 Original-Received: from farnswood.snap.net.nz (p213-tnt1.snap.net.nz [202.124.110.213]) by viper.snap.net.nz (Postfix) with ESMTP id E66B722078E for ; Mon, 17 Jan 2005 15:00:34 +1300 (NZDT) Original-Received: by farnswood.snap.net.nz (Postfix, from userid 501) id 72056628AD; Mon, 17 Jan 2005 01:53:24 +0000 (GMT) Original-To: emacs-devel@gnu.org X-Mailer: VM 7.19 under Emacs 21.3.50.38 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: main.gmane.org gmane.emacs.devel:32279 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:32279 This patch allows the user to invoke goto-line by clicking on the line number in the modeline. Are there any objections to me installing it? Nick *** /home/nick/emacs/lisp/bindings.el.~1.137.~ 2004-12-14 09:34:21.000000000 +1300 --- /home/nick/emacs/lisp/bindings.el 2005-01-17 14:45:41.000000000 +1300 *************** *** 83,88 **** --- 83,98 ---- (force-mode-line-update))) + (defun mode-line-goto-line (event) + "Like `go-to-line', for the mode-line." + (interactive "e") + (save-selected-window + (select-window (posn-window (event-start event))) + (let ((arg (read-from-minibuffer "Goto line: "))) + (goto-line (string-to-int arg))) + (force-mode-line-update))) + + (defun mode-line-abbrev-mode (event) "Turn off `abbrev-mode' from the mode-line." (interactive "e") *************** *** 321,327 **** (line-number-mode ((column-number-mode (10 ,(propertize " (%l,%c)" 'help-echo help-echo)) ! (6 ,(propertize " L%l" 'help-echo help-echo)))) ((column-number-mode (5 ,(propertize " C%c" 'help-echo help-echo)))))))) --- 331,340 ---- (line-number-mode ((column-number-mode (10 ,(propertize " (%l,%c)" 'help-echo help-echo)) ! (6 ,(propertize " L%l" 'help-echo "mouse-3: go to line" ! 'local-map (purecopy (make-mode-line-mouse-map ! 'mouse-3 ! #'mode-line-goto-line)))))) ((column-number-mode (5 ,(propertize " C%c" 'help-echo help-echo))))))))