unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* put goto-line on modeline
@ 2005-01-17  1:53 Nick Roberts
  2005-01-17 16:10 ` Stefan Monnier
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Nick Roberts @ 2005-01-17  1:53 UTC (permalink / raw)



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

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

* Re: put goto-line on modeline
  2005-01-17  1:53 put goto-line on modeline Nick Roberts
@ 2005-01-17 16:10 ` Stefan Monnier
  2005-01-17 20:36   ` Nick Roberts
  2005-01-17 23:43 ` Richard Stallman
  2005-01-18  5:02 ` Masatake YAMATO
  2 siblings, 1 reply; 18+ messages in thread
From: Stefan Monnier @ 2005-01-17 16:10 UTC (permalink / raw)
  Cc: emacs-devel

> 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?

I'd rather keep mouse-3 for context menus as much as possible.
So maybe you could make a menu with goto-line (and maybe a few more things
like line-number-mode, column-number-mode, ...).


        Stefan

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

* Re: put goto-line on modeline
  2005-01-17 16:10 ` Stefan Monnier
@ 2005-01-17 20:36   ` Nick Roberts
  0 siblings, 0 replies; 18+ messages in thread
From: Nick Roberts @ 2005-01-17 20:36 UTC (permalink / raw)
  Cc: emacs-devel

 > I'd rather keep mouse-3 for context menus as much as possible.

Well its a bit late for that on the mode-line. Currently
mode-line-toggle-read-only mode-line-toggle-modified, mule-line-info etc are
all on mouse-3.

 > So maybe you could make a menu with goto-line (and maybe a few more things
 > like line-number-mode, column-number-mode, ...).

I take your point. There are other functions that might be more appropriate
here.


Nick

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

* Re: put goto-line on modeline
  2005-01-17  1:53 put goto-line on modeline Nick Roberts
  2005-01-17 16:10 ` Stefan Monnier
@ 2005-01-17 23:43 ` Richard Stallman
  2005-01-18  4:43   ` Masatake YAMATO
  2005-01-18  5:02 ` Masatake YAMATO
  2 siblings, 1 reply; 18+ messages in thread
From: Richard Stallman @ 2005-01-17 23:43 UTC (permalink / raw)
  Cc: emacs-devel

    This patch allows the user to invoke goto-line by clicking on the line number
    in the modeline.

This isn't the time for new features.  Anyway, this is not a good
feature.

The user has to enter the line number with the keyboard.  Mixing mouse
clicks and keyboard input is rather inconvenient.  So I think that few
people would use this intentionally.

Please don't install it.

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

* Re: put goto-line on modeline
  2005-01-17 23:43 ` Richard Stallman
@ 2005-01-18  4:43   ` Masatake YAMATO
  2005-01-18  6:54     ` Drew Adams
  0 siblings, 1 reply; 18+ messages in thread
From: Masatake YAMATO @ 2005-01-18  4:43 UTC (permalink / raw)
  Cc: nickrob, emacs-devel

Richard Stallman <rms@gnu.org> wrote:
>     This patch allows the user to invoke goto-line by clicking on the line number
>     in the modeline.
> 
> This isn't the time for new features.  Anyway, this is not a good
> feature.

I think this is a good feature. 

> The user has to enter the line number with the keyboard.  Mixing mouse
> clicks and keyboard input is rather inconvenient.  

How about the menu item "Goto Line..." in "Go To" in "Edit"?  An user
has to use both the mouse and keyboard. However, the menu item is
useful. Furthermore, comparing with the menu item, the item on the line 
number of the mode line is more easy to choose; it is always displayed.

BTW, IBM's thinkpad note pc has a pointing device at the center of its
keyboard. On the note pc, it is quite comfortable to operate mixing
mouse clicks and keyboard input. The happy hacking keyboard is
inferior to the thinkpad's keyboard in this aspects.

Masatake YAMATO

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

* Re: put goto-line on modeline
  2005-01-17  1:53 put goto-line on modeline Nick Roberts
  2005-01-17 16:10 ` Stefan Monnier
  2005-01-17 23:43 ` Richard Stallman
@ 2005-01-18  5:02 ` Masatake YAMATO
  2005-01-18  6:55   ` Drew Adams
  2005-01-19  0:51   ` Richard Stallman
  2 siblings, 2 replies; 18+ messages in thread
From: Masatake YAMATO @ 2005-01-18  5:02 UTC (permalink / raw)
  Cc: emacs-devel

[-- Attachment #1: Type: Text/Plain, Size: 754 bytes --]

> 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?

As I wrote in the other mail, I think this feature is useful.  
I think we can do more on the modeline; I image Gnome's panel.

I have a comment. It is nice if the line number area in the modeline
is highlighted if you move the mouse pointer on it. So an user can
know the area is clickable. A tooltip is helpful but it only tells the
mouse button and function attached to the area. But it doesn't tell the
range of area. See png image attached to this mail. Twice I tried to
implement modeline highlighting code, but I miscarried. What I could
do was highlighting the major mode area.

Masatake YAMATO

[-- Attachment #2: highlight.png --]
[-- Type: Image/Png, Size: 10016 bytes --]

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* RE: put goto-line on modeline
  2005-01-18  4:43   ` Masatake YAMATO
@ 2005-01-18  6:54     ` Drew Adams
  2005-01-18  9:29       ` David Kastrup
  0 siblings, 1 reply; 18+ messages in thread
From: Drew Adams @ 2005-01-18  6:54 UTC (permalink / raw)
  Cc: nickrob, emacs-devel

    I think this is a good feature.

    > The user has to enter the line number with the keyboard.  Mixing mouse
    > clicks and keyboard input is rather inconvenient.

    How about the menu item "Goto Line..." in "Go To" in "Edit"?  An user
    has to use both the mouse and keyboard. However, the menu item is
    useful. Furthermore, comparing with the menu item, the item on the line
    number of the mode line is more easy to choose; it is always displayed.

I won't say whether this feature would be good or bad (I'm ~agnostic on it).

FWIW, Framemaker has long had this feature as the main way to go to a page
or line. When you click the page number in the "mode line", a dialog box
opens, where you can choose the Page Number (and input the number) or Line
Number (and input the number). The dialog box also tells you the first and
last pages and the current line number.

Again, I don't claim that this is a great feature, but it is used elsewhere.

A similar feature that Framemaker uses is clicking the current document zoom
factor (e.g. 100%) in the "mode line" to change it. When you do that, a menu
pops up with various predefined zoom settings to choose from, plus menu
items to Fit Page in Window, Fit Window to Page, and "Set...", which opens a
dialog box for defining the zoom settings in the menu (10 settings). Other
mode-line buttons zoom in and out one step, and go forward and backward a
page.

Just food for thought...for later.

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

* RE: put goto-line on modeline
  2005-01-18  5:02 ` Masatake YAMATO
@ 2005-01-18  6:55   ` Drew Adams
  2005-01-19  0:51   ` Richard Stallman
  1 sibling, 0 replies; 18+ messages in thread
From: Drew Adams @ 2005-01-18  6:55 UTC (permalink / raw)
  Cc: emacs-devel

    I have a comment. It is nice if the line number area in the modeline
    is highlighted if you move the mouse pointer on it. So an user can
    know the area is clickable. A tooltip is helpful but it only tells the
    mouse button and function attached to the area. But it doesn't tell the
    range of area. See png image attached to this mail. Twice I tried to
    implement modeline highlighting code, but I miscarried. What I could
    do was highlighting the major mode area.

Yes, there should be some visual feedback that a button is, well, a button
(and show its size). (Similarly for pulldown-menu buttons and hyperlinks.)
And mouseover highlighting (e.g. "raising" the button) is one good way to do
that.

Tooltips are only a last resort, when there is no other standard visual cue.
They are a general-purpose way to explain something (anything). It's better
to have specific cues for different standard classes of GUI thingies (e.g.
links different from menus different from action buttons). A tooltip can
tell you what something means, but it shouldn't be needed to tell you that
something is a button.

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

* Re: put goto-line on modeline
  2005-01-18  6:54     ` Drew Adams
@ 2005-01-18  9:29       ` David Kastrup
  2005-01-19  0:49         ` Richard Stallman
  0 siblings, 1 reply; 18+ messages in thread
From: David Kastrup @ 2005-01-18  9:29 UTC (permalink / raw)
  Cc: Masatake YAMATO, nickrob, rms, emacs-devel

"Drew Adams" <drew.adams@oracle.com> writes:

>     I think this is a good feature.
>
>     > The user has to enter the line number with the keyboard.
>     > Mixing mouse clicks and keyboard input is rather inconvenient.
>
>     How about the menu item "Goto Line..." in "Go To" in "Edit"?  An
>     user has to use both the mouse and keyboard. However, the menu
>     item is useful. Furthermore, comparing with the menu item, the
>     item on the line number of the mode line is more easy to choose;
>     it is always displayed.
>
> I won't say whether this feature would be good or bad (I'm ~agnostic
> on it).
>
> FWIW, Framemaker has long had this feature as the main way to go to
> a page or line.

xpdf too.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: put goto-line on modeline
  2005-01-18  9:29       ` David Kastrup
@ 2005-01-19  0:49         ` Richard Stallman
  2005-01-19 10:14           ` David Kastrup
  0 siblings, 1 reply; 18+ messages in thread
From: Richard Stallman @ 2005-01-19  0:49 UTC (permalink / raw)
  Cc: jet, nickrob, drew.adams, emacs-devel

    > FWIW, Framemaker has long had this feature as the main way to go to
    > a page or line.

    xpdf too.

It is very inconvenient.

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

* Re: put goto-line on modeline
  2005-01-18  5:02 ` Masatake YAMATO
  2005-01-18  6:55   ` Drew Adams
@ 2005-01-19  0:51   ` Richard Stallman
  2005-01-19  4:40     ` Masatake YAMATO
  2005-01-19 10:17     ` David Kastrup
  1 sibling, 2 replies; 18+ messages in thread
From: Richard Stallman @ 2005-01-19  0:51 UTC (permalink / raw)
  Cc: nickrob, emacs-devel

My decision about this feature is no.

(Please remember that we have a feature freeze
and we are trying to focus on getting the release to work.)

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

* Re: put goto-line on modeline
  2005-01-19  0:51   ` Richard Stallman
@ 2005-01-19  4:40     ` Masatake YAMATO
  2005-01-19 10:17     ` David Kastrup
  1 sibling, 0 replies; 18+ messages in thread
From: Masatake YAMATO @ 2005-01-19  4:40 UTC (permalink / raw)
  Cc: nickrob, emacs-devel

> My decision about this feature is no.
> 
> (Please remember that we have a feature freeze
> and we are trying to focus on getting the release to work.)

Yes, I know that we have a feature freeze.  I just showed an objection
to "Anyway, this is not a good feature." in your mail.

Masatake YAMATO

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

* Re: put goto-line on modeline
  2005-01-19  0:49         ` Richard Stallman
@ 2005-01-19 10:14           ` David Kastrup
  0 siblings, 0 replies; 18+ messages in thread
From: David Kastrup @ 2005-01-19 10:14 UTC (permalink / raw)
  Cc: jet, nickrob, drew.adams, emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     > FWIW, Framemaker has long had this feature as the main way to go to
>     > a page or line.
>
>     xpdf too.
>
> It is very inconvenient.

Hardly more inconvenient than typing
M-x goto-line RET number RET

You have vetoed the proposed M-g keybinding since you thought font
selection a more important operation and found no other place fitting.

So if the function is used so infrequently that it does not even
deserve a keybinding of its own, I don't see how providing an
_intuitive_ way of setting it (though not the most ergonomic one) can
be bad.  We don't have anything better to offer: we can't tell the
user "we left off this functionality because we find you should rather
learn the keybinding".  There is no keybinding.

And even if there were, we could teach it the soft and usual way:
"goto-line is on M-g" in the echo area afterwards.

Leaving off the possibility of clicking the mode-line because it is
supposed to be more inconvenient than a keybinding we don't even have
does not sound logical.

If the function is supposed to be used as frequently that clicking the
mode line is considered a serious impediment to productive work, then
it should have a keybinding.  And even if it has, the mode line is
more easily accessible than a menu entry.  As long as both point out
after use that there is also a keybinding, I don't see what the user
loses.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: put goto-line on modeline
  2005-01-19  0:51   ` Richard Stallman
  2005-01-19  4:40     ` Masatake YAMATO
@ 2005-01-19 10:17     ` David Kastrup
  2005-01-20 21:31       ` Richard Stallman
  1 sibling, 1 reply; 18+ messages in thread
From: David Kastrup @ 2005-01-19 10:17 UTC (permalink / raw)
  Cc: Masatake YAMATO, nickrob, emacs-devel

Richard Stallman <rms@gnu.org> writes:

> My decision about this feature is no.
>
> (Please remember that we have a feature freeze
> and we are trying to focus on getting the release to work.)

Just remember after the next release that the main reason for the
decision now was the feature freeze.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: put goto-line on modeline
  2005-01-19 10:17     ` David Kastrup
@ 2005-01-20 21:31       ` Richard Stallman
  2005-01-20 22:23         ` David Kastrup
  2005-01-21  1:59         ` Nick Roberts
  0 siblings, 2 replies; 18+ messages in thread
From: Richard Stallman @ 2005-01-20 21:31 UTC (permalink / raw)
  Cc: jet, nickrob, emacs-devel

    Just remember after the next release that the main reason for the
    decision now was the feature freeze.

The main reason is that I think it is a bad idea.

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

* Re: put goto-line on modeline
  2005-01-20 21:31       ` Richard Stallman
@ 2005-01-20 22:23         ` David Kastrup
  2005-01-21  1:59         ` Nick Roberts
  1 sibling, 0 replies; 18+ messages in thread
From: David Kastrup @ 2005-01-20 22:23 UTC (permalink / raw)
  Cc: jet, nickrob, emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     Just remember after the next release that the main reason for the
>     decision now was the feature freeze.
>
> The main reason is that I think it is a bad idea.

But we are cutting the discussion on that short now because of the
feature freeze.  Not having any immediately available and/or obvious
binding by mouse _OR_ keyboard does not sound like a much better idea.
We should try to agree on having _something_ when we are through with
the release.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: put goto-line on modeline
  2005-01-20 21:31       ` Richard Stallman
  2005-01-20 22:23         ` David Kastrup
@ 2005-01-21  1:59         ` Nick Roberts
  2005-01-21  9:06           ` David Kastrup
  1 sibling, 1 reply; 18+ messages in thread
From: Nick Roberts @ 2005-01-21  1:59 UTC (permalink / raw)
  Cc: jet, emacs-devel

 >     Just remember after the next release that the main reason for the
 >     decision now was the feature freeze.
 > 
 > The main reason is that I think it is a bad idea.

But on matters which are largely ones of personal preference, it would be
more objective to listen to the opinions of the mailing list.

Nick

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

* Re: put goto-line on modeline
  2005-01-21  1:59         ` Nick Roberts
@ 2005-01-21  9:06           ` David Kastrup
  0 siblings, 0 replies; 18+ messages in thread
From: David Kastrup @ 2005-01-21  9:06 UTC (permalink / raw)
  Cc: jet, rms, emacs-devel

Nick Roberts <nickrob@snap.net.nz> writes:

>  >     Just remember after the next release that the main reason for
>  >     the decision now was the feature freeze.
>  > 
>  > The main reason is that I think it is a bad idea.
>
> But on matters which are largely ones of personal preference, it
> would be more objective to listen to the opinions of the mailing
> list.

Opinions are never objective.  And democracy is not a substitute for a
coherency (that's supposed to be one of the reasons that almost all
existing democracies are representative, with a party system).  But
this is not the time for discussing new features.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

end of thread, other threads:[~2005-01-21  9:06 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-17  1:53 put goto-line on modeline Nick Roberts
2005-01-17 16:10 ` Stefan Monnier
2005-01-17 20:36   ` Nick Roberts
2005-01-17 23:43 ` Richard Stallman
2005-01-18  4:43   ` Masatake YAMATO
2005-01-18  6:54     ` Drew Adams
2005-01-18  9:29       ` David Kastrup
2005-01-19  0:49         ` Richard Stallman
2005-01-19 10:14           ` David Kastrup
2005-01-18  5:02 ` Masatake YAMATO
2005-01-18  6:55   ` Drew Adams
2005-01-19  0:51   ` Richard Stallman
2005-01-19  4:40     ` Masatake YAMATO
2005-01-19 10:17     ` David Kastrup
2005-01-20 21:31       ` Richard Stallman
2005-01-20 22:23         ` David Kastrup
2005-01-21  1:59         ` Nick Roberts
2005-01-21  9:06           ` David Kastrup

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