all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Newbie: Interactive goto-line ?!
@ 2004-02-24 10:55 Karel Kubat
  2004-02-24 10:58 ` Maurizio Loreti
                   ` (3 more replies)
  0 siblings, 4 replies; 49+ messages in thread
From: Karel Kubat @ 2004-02-24 10:55 UTC (permalink / raw)


Hi all,

A newbie question: I'm tired of typing "^X goto-line", so what I want is the
same functionality, but in fewer keystrokes. E.g, after hitting M-g (or
whatever). 

When I try to bind goto-line to some key, or when I try to defun a new
function and bind that one to some key, then the following happens: the
interpreter tells me that there's no argument. As expected; the docs say
that goto-line needs an argument. But how do I make all this interactive,
just as "^X goto-line" works?

Thanks in advance!
-- 
Karel Kubat <karel@e-tunity.com, karel@qbat.org>
Phone: mobile (+31) 6 2956 4861, office (+31) (0)38 46 06 125
PGP fingerprint: D76E 86EC B457 627A 0A87  0B8D DB71 6BCD 1CF2 6CD5

  You might be a redneck if..
  Your wife has ever said, "Come move this transmission
  so I can take a bath."

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-24 10:55 Newbie: Interactive goto-line ?! Karel Kubat
@ 2004-02-24 10:58 ` Maurizio Loreti
  2004-02-24 11:42   ` Gian Uberto Lauri
  2004-02-24 11:00 ` Karel Kubat
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 49+ messages in thread
From: Maurizio Loreti @ 2004-02-24 10:58 UTC (permalink / raw)


Karel Kubat <karel@e-tunity.com> writes:

> A newbie question: I'm tired of typing "^X goto-line", so what I want is the
> same functionality, but in fewer keystrokes.

(global-set-key "\C-cg" 'goto-line)    ; Link to CTRL-c g

-- 
Maurizio Loreti                         http://www.pd.infn.it/~loreti/mlo.html
Dept. of Physics, Univ. of Padova, Italy              ROT13: ybergv@cq.vasa.vg

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-24 10:55 Newbie: Interactive goto-line ?! Karel Kubat
  2004-02-24 10:58 ` Maurizio Loreti
@ 2004-02-24 11:00 ` Karel Kubat
  2004-02-24 11:34 ` Jiri Pejchal
  2004-02-24 18:35 ` Floyd Davidson
  3 siblings, 0 replies; 49+ messages in thread
From: Karel Kubat @ 2004-02-24 11:00 UTC (permalink / raw)


Umm...

The ^X goto-line should have been of course M-x goto-line in my post.
Thx.
-- 
Karel Kubat <karel@e-tunity.com, karel@qbat.org>
Phone: mobile (+31) 6 2956 4861, office (+31) (0)38 46 06 125
PGP fingerprint: D76E 86EC B457 627A 0A87  0B8D DB71 6BCD 1CF2 6CD5

  You Know It's Going To Be a BAD Day When...
  people think you are 40 ... and you really are.

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-24 10:55 Newbie: Interactive goto-line ?! Karel Kubat
  2004-02-24 10:58 ` Maurizio Loreti
  2004-02-24 11:00 ` Karel Kubat
@ 2004-02-24 11:34 ` Jiri Pejchal
  2004-02-24 22:21   ` Johan Bockgård
  2004-02-24 18:35 ` Floyd Davidson
  3 siblings, 1 reply; 49+ messages in thread
From: Jiri Pejchal @ 2004-02-24 11:34 UTC (permalink / raw)


Karel Kubat <karel@e-tunity.com> writes:

> Hi all,
>
> A newbie question: I'm tired of typing "^X goto-line", so what I want is the
> same functionality, but in fewer keystrokes. E.g, after hitting M-g (or
> whatever).

Well you can add (partial-completion-mode 1) in your .emacs.

Than try this: M-x g-l TAB RET 23 RET and you are on line 23.



Or simply put (global-set-key "\M-G" 'goto-line) in .emacs.


--
Jiri Pejchal

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-24 10:58 ` Maurizio Loreti
@ 2004-02-24 11:42   ` Gian Uberto Lauri
  2004-02-24 16:08     ` Brad Collins
  0 siblings, 1 reply; 49+ messages in thread
From: Gian Uberto Lauri @ 2004-02-24 11:42 UTC (permalink / raw)


>>>>> "ML" == Maurizio Loreti <mlo@foobar.it> writes:

ML> Karel Kubat <karel@e-tunity.com> writes:
>> A newbie question: I'm tired of typing "^X goto-line", so what I
>> want is the same functionality, but in fewer keystrokes.

ML> (global-set-key "\C-cg" 'goto-line) ; Link to CTRL-c g

If the keyboard configuration supports Hyper and Super you can save
a keystroke by using one of these Space Cadet modifiers.

(global-set-key [?\s-g] 'goto-line)

Under X11 the use of Super and Hyper requires some tinkering with
the keyboard configuration, under Windows just these line of 
Emacs Lisp in your .emacs:

 (setq w32-apps-modifier 'hyper)
 (setq w32-lwindow-modifier 'super)
 (setq w32-rwindow-modifier 'meta)
 (setq w32-alt-is-meta t)
 (setq w32-pass-lwindow-to-system nil)   ; appropriate for modifier
 (setq w32-pass-rwindow-to-system nil) ; appropriate for modifier
 (setq w32-pass-alt-to-system nil)

 /\            ___
/___/\__|_|\_|__|___Gian Uberto Lauri_____________________
  //--\ | | \|  |   Integralista GNUslamico e fancazzista 
\/

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-24 11:42   ` Gian Uberto Lauri
@ 2004-02-24 16:08     ` Brad Collins
  0 siblings, 0 replies; 49+ messages in thread
From: Brad Collins @ 2004-02-24 16:08 UTC (permalink / raw)



Also don't forget that if you are using a command several times you
can use history and auto-complete to save keystrokes.

So if you've called M-x goto-line once before, then type M-x and then
use the `up' arrow to find it again.

For auto-complete :  M-x goto-l<SPC> will complete the command.

These are both real time savers, especially for long commands.

b/

--
Brad Collins
Chenla Labs
Bangkok, Thailand

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-24 10:55 Newbie: Interactive goto-line ?! Karel Kubat
                   ` (2 preceding siblings ...)
  2004-02-24 11:34 ` Jiri Pejchal
@ 2004-02-24 18:35 ` Floyd Davidson
  2004-02-24 21:01   ` Kevin Rodgers
  3 siblings, 1 reply; 49+ messages in thread
From: Floyd Davidson @ 2004-02-24 18:35 UTC (permalink / raw)


Karel Kubat <karel@e-tunity.com> wrote:
>Hi all,
>
>A newbie question: I'm tired of typing "^X goto-line", so what I want is the
>same functionality, but in fewer keystrokes. E.g, after hitting M-g (or
>whatever).
>
>When I try to bind goto-line to some key, or when I try to defun a new
>function and bind that one to some key, then the following happens: the
>interpreter tells me that there's no argument. As expected; the docs say
>that goto-line needs an argument. But how do I make all this interactive,
>just as "^X goto-line" works?
>
>Thanks in advance!

I'm not sure what the default bindings are, but I've always used
any emacs with M-g bound to the goto-line function.  That means
going to line 214 is as easy as the key sequence 'ESC 214 ESG g'

This is what is in my .emacs file:

 (define-key esc-map  "g" 'goto-line)

--
Floyd L. Davidson           <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)                         floyd@barrow.com

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-24 18:35 ` Floyd Davidson
@ 2004-02-24 21:01   ` Kevin Rodgers
  2004-02-24 23:38     ` Floyd Davidson
  0 siblings, 1 reply; 49+ messages in thread
From: Kevin Rodgers @ 2004-02-24 21:01 UTC (permalink / raw)


Floyd Davidson wrote:

> I'm not sure what the default bindings are, but I've always used
> any emacs with M-g bound to the goto-line function.  That means
> going to line 214 is as easy as the key sequence 'ESC 214 ESG g'
> 
> This is what is in my .emacs file:
> 
>  (define-key esc-map  "g" 'goto-line)

By default M-g is a prefix key, bound to facemenu-keymap.  I prefer:

(global-set-key "\C-cg" 'goto-line)
(global-set-key "\C-cG" 'goto-char)

-- 
Kevin Rodgers

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-24 11:34 ` Jiri Pejchal
@ 2004-02-24 22:21   ` Johan Bockgård
  0 siblings, 0 replies; 49+ messages in thread
From: Johan Bockgård @ 2004-02-24 22:21 UTC (permalink / raw)


Jiri Pejchal <xpejchal@fi.muni.cz> writes:

> Than try this: M-x g-l TAB RET 23 RET and you are on line 23.

The TAB is unnecessary.

-- 
Johan Bockgård

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-24 21:01   ` Kevin Rodgers
@ 2004-02-24 23:38     ` Floyd Davidson
  2004-02-25  5:33       ` Eli Zaretskii
                         ` (3 more replies)
  0 siblings, 4 replies; 49+ messages in thread
From: Floyd Davidson @ 2004-02-24 23:38 UTC (permalink / raw)


Kevin Rodgers <ihs_4664@yahoo.com> wrote:
>Floyd Davidson wrote:
>
>> I'm not sure what the default bindings are, but I've always used
>> any emacs with M-g bound to the goto-line function.  That means
>> going to line 214 is as easy as the key sequence 'ESC 214 ESG g'
>> This is what is in my .emacs file:
>>  (define-key esc-map  "g" 'goto-line)
>
>By default M-g is a prefix key, bound to facemenu-keymap.  I prefer:
>
>(global-set-key "\C-cg" 'goto-line)
>(global-set-key "\C-cG" 'goto-char)

Wellll...  that is an abomination that shouldn't be allowed
to survive!  (Okay, the fact that I've been using M-g bound
to goto-line for 20 years has something to do with my opinion,
but...)

How often do you ever use the facemenu-keymap command, compared
to the goto-line command?  In my case, I regularly use
goto-line, and simply *never* use the facemenu-keymap command.
(I don't use that functionality at all, even by menu or
otherwise, as I basically never change any of the faces on the
fly.)

Hence a nice short key sequence like M-g should be assigned to
a commonly used command, and an often used command like goto-line
is a good example (which I can't imagine binding to a three key
sequence).

--
Floyd L. Davidson           <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)                         floyd@barrow.com

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-24 23:38     ` Floyd Davidson
@ 2004-02-25  5:33       ` Eli Zaretskii
       [not found]       ` <mailman.436.1077687252.340.help-gnu-emacs@gnu.org>
                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 49+ messages in thread
From: Eli Zaretskii @ 2004-02-25  5:33 UTC (permalink / raw)


> Newsgroups: gnu.emacs.help
> From: Floyd Davidson <floyd@barrow.com>
> Date: Tue, 24 Feb 2004 14:38:51 -0900
> 
> How often do you ever use the facemenu-keymap command, compared
> to the goto-line command?  In my case, I regularly use
> goto-line, and simply *never* use the facemenu-keymap command.

It's the opposite in my case.  For example, "M-g M-g" is invaluable as
a means to fix bad font-lock fontifications (a.k.a. syntax
highlighting).

If you find yourself using goto-line too often, you should take a good
look at the way you use Emacs: most uses of goto-line should be
unnecessary because Emacs interface with various programs that report
line numbers, such as compilers, Grep, etc., have commands to
automatically visit the file and line number being reported.

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

* Re: Newbie: Interactive goto-line ?!
       [not found]       ` <mailman.436.1077687252.340.help-gnu-emacs@gnu.org>
@ 2004-02-25  6:31         ` Floyd Davidson
  2004-02-25  8:56           ` Kai Grossjohann
                             ` (2 more replies)
  2004-02-25 17:58         ` Stefan Monnier
  1 sibling, 3 replies; 49+ messages in thread
From: Floyd Davidson @ 2004-02-25  6:31 UTC (permalink / raw)


Eli Zaretskii <eliz@elta.co.il> wrote:
>> Newsgroups: gnu.emacs.help
>> From: Floyd Davidson <floyd@barrow.com>
>> Date: Tue, 24 Feb 2004 14:38:51 -0900
>>
>> How often do you ever use the facemenu-keymap command, compared
>> to the goto-line command?  In my case, I regularly use
>> goto-line, and simply *never* use the facemenu-keymap command.
>
>It's the opposite in my case.  For example, "M-g M-g" is invaluable as
>a means to fix bad font-lock fontifications (a.k.a. syntax
>highlighting).

That is not a default binding for either GNU Emacs or XEmacs, so
I'm not positive which function you have bound to it.  For that
purpose I have a menu item which does font-lock-fontify-buffer.
I rarely use it, which is why it's a menu item rather than
bound to a key sequence.  (My menus are not the default menus.)

Incidentally, with XEmacs the default binding for M-g is the
goto-line function.

>If you find yourself using goto-line too often, you should take a good
>look at the way you use Emacs: most uses of goto-line should be
>unnecessary because Emacs interface with various programs that report
>line numbers, such as compilers, Grep, etc., have commands to
>automatically visit the file and line number being reported.

If you are not using goto-line you are missing a very quick way
to move around in files.

--
Floyd L. Davidson           <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)                         floyd@barrow.com

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-25  6:31         ` Floyd Davidson
@ 2004-02-25  8:56           ` Kai Grossjohann
  2004-02-25 10:05           ` Eli Zaretskii
       [not found]           ` <mailman.452.1077703465.340.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 49+ messages in thread
From: Kai Grossjohann @ 2004-02-25  8:56 UTC (permalink / raw)


Floyd Davidson <floyd@barrow.com> writes:

> If you are not using goto-line you are missing a very quick way
> to move around in files.

Really?  Where do the line numbers come from that you enter after
goto-line?

I guess that, for most people, the line numbers come from compiler
output and suchlike.  And there are features in Emacs that allow you
to middle-click on the compiler output, without having to type the
line number manually.

Kai

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-25  6:31         ` Floyd Davidson
  2004-02-25  8:56           ` Kai Grossjohann
@ 2004-02-25 10:05           ` Eli Zaretskii
       [not found]           ` <mailman.452.1077703465.340.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 49+ messages in thread
From: Eli Zaretskii @ 2004-02-25 10:05 UTC (permalink / raw)


> Newsgroups: gnu.emacs.help
> From: Floyd Davidson <floyd@barrow.com>
> Date: Tue, 24 Feb 2004 21:31:51 -0900
> Xref: shelby.stanford.edu gnu.emacs.help:121236
> Sender: help-gnu-emacs-bounces+eliz=elta.co.il@gnu.org
> >
> >For example, "M-g M-g" is invaluable as a means to fix bad
> >font-lock fontifications (a.k.a. syntax highlighting).
> 
> That is not a default binding for either GNU Emacs or XEmacs, so
> I'm not positive which function you have bound to it.

Did you try "C-h c M-g M-g"?  In my Emacs it says

   M-g M-g runs the command font-lock-fontify-block

AFAICS, this is the default binding of GNU Emacs since Emacs 20.x at
least (couldn't check in Emacs 19 where I'm typing this).

> Incidentally, with XEmacs the default binding for M-g is the
> goto-line function.

Yes, we considered this during development of Emacs 20.1 and rejected
this binding, since M-g is a prefix of commands that change fonts and
text properties like bold, underlined, etc.

> >If you find yourself using goto-line too often, you should take a good
> >look at the way you use Emacs: most uses of goto-line should be
> >unnecessary because Emacs interface with various programs that report
> >line numbers, such as compilers, Grep, etc., have commands to
> >automatically visit the file and line number being reported.
> 
> If you are not using goto-line you are missing a very quick way
> to move around in files.

I was serious.  If you have serious counter-arguments why goto-line is
better then "C-x `" and its ilk, please tell.

In a nutshell, the reason why goto-line should not be a frequently
used command is that normally there's no reason to want to get to line
number N unless you have a program that told you there's something
interesting on that line.

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

* Re: Newbie: Interactive goto-line ?!
       [not found]           ` <mailman.452.1077703465.340.help-gnu-emacs@gnu.org>
@ 2004-02-25 16:29             ` Floyd Davidson
  2004-02-26 17:32               ` Eli Zaretskii
       [not found]               ` <mailman.580.1077816762.340.help-gnu-emacs@gnu.org>
  2004-02-26 17:36             ` Dan Katz
  1 sibling, 2 replies; 49+ messages in thread
From: Floyd Davidson @ 2004-02-25 16:29 UTC (permalink / raw)


Eli Zaretskii <eliz@elta.co.il> wrote:
>> From: Floyd Davidson <floyd@barrow.com>
>> >
>> >For example, "M-g M-g" is invaluable as a means to fix bad
>> >font-lock fontifications (a.k.a. syntax highlighting).
>>
>> That is not a default binding for either GNU Emacs or XEmacs, so
>> I'm not positive which function you have bound to it.
>
>Did you try "C-h c M-g M-g"?  In my Emacs it says
>
>   M-g M-g runs the command font-lock-fontify-block

Run Emacs with the -q option.  At least in the latest Emacs
release (21.3.1) that won't be defined.  You can then do C-h b,
mark the whole buffer, and pipe it through grep to find what
exactly is defined.

  M-g d         facemenu-set-default
  M-g b         facemenu-set-bold
  M-g i         facemenu-set-italic
  M-g l         facemenu-set-bold-italic
  M-g u         facemenu-set-underline
  M-g o         facemenu-set-faceq

If you then load the font-lock package, the following are added,

  M-g ESC       Prefix Command
  M-g ESC g     font-lock-fontify-block

For my style of use, none of those needs to have key bindings.
The only one that I would ever consider using is the font-lock
command, and since my need to use it is very rare, I've made
that (actually, font-lock-fontify-buffer) a menu option so
that it neither clutters my mind nor wastes a useful key binding.

Of course, /your/ needs might be very different.

>AFAICS, this is the default binding of GNU Emacs since Emacs 20.x at
>least (couldn't check in Emacs 19 where I'm typing this).

 GNU Emacs 21.3.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)

>> Incidentally, with XEmacs the default binding for M-g is the
>> goto-line function.
>
>Yes, we considered this during development of Emacs 20.1 and rejected
>this binding, since M-g is a prefix of commands that change fonts and
>text properties like bold, underlined, etc.

So you were aware all along that it is not uncontroversial.  In
fact, at some point in history it was changed to make it that
prefix rather than the default goto-line that XEmacs and others
bind to it.  With all due respect, a lot of people clearly
believe that first change was the mistake; and just as clearly
if they do it is because they think goto-line is a useful
function.  Ergo, your statement that it isn't goes against the
grain of a widely held belief.  Six of one, half a dozen of
another!

(Your mistake was say that it isn't for anyone.  You should
merely have pointed out that it isn't useful to *you*.)

>> >If you find yourself using goto-line too often, you should take a good
>> >look at the way you use Emacs: most uses of goto-line should be
>> >unnecessary because Emacs interface with various programs that report
>> >line numbers, such as compilers, Grep, etc., have commands to
>> >automatically visit the file and line number being reported.
>>
>> If you are not using goto-line you are missing a very quick way
>> to move around in files.
>
>I was serious.  If you have serious counter-arguments why goto-line is
>better then "C-x `" and its ilk, please tell.

But I did not say any such thing.

I said that if you aren't using it, you are missing out on a
quick way to move around in files.  When other methods are
quicker, they should be used.

Let me be a little more succinct.  Your statement that if I use
goto-line then I'm not using emacs well, because goto-line should
be unnecessary, is both /arrogant/ and /ignorant/.

I suggest we drop this part of the discussion because it is
abjectly silly to assume that your usage is the one true way.
It *is* appropriate to explain to someone how you happen to use
it, as an example they might find helpful.

_To_ _suggest_ _that_ _someone_ _else's_ _example_ _of_ _use_ _is_ _wrong_ _is_
_not_ _acceptable_.

>In a nutshell, the reason why goto-line should not be a frequently
>used command is that normally there's no reason to want to get to line
>number N unless you have a program that told you there's something
>interesting on that line.

Perhaps you do not use Emacs enough or in ways that don't
provide you with sufficient examples.  What you've left out of
your equation is temporal effect.  If the
compiler/grep/emacs/other-utility gave you a number, and you
then proceed to do a variety of useful things for *any* period
of time, be it 1 second or 10 days, the availability of that
number in that way is diminished, if not entirely gone.  The
question, if that number then becomes useful, is which way is
easiest to reproduce it for Emacs.  *You* might want to
re-compile something to get it, but I'll just use the goto-line
function, because for me, though maybe not for you, that is
indeed much faster.

--
Floyd L. Davidson           <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)                         floyd@barrow.com

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-24 23:38     ` Floyd Davidson
  2004-02-25  5:33       ` Eli Zaretskii
       [not found]       ` <mailman.436.1077687252.340.help-gnu-emacs@gnu.org>
@ 2004-02-25 16:47       ` Kevin Rodgers
  2004-02-25 17:35         ` Floyd Davidson
  2004-02-25 18:01       ` Stefan Monnier
  3 siblings, 1 reply; 49+ messages in thread
From: Kevin Rodgers @ 2004-02-25 16:47 UTC (permalink / raw)


Floyd Davidson wrote:
 > Kevin Rodgers <ihs_4664@yahoo.com> wrote:
 >>Floyd Davidson wrote:
 >>>I'm not sure what the default bindings are, but I've always used
 >>>any emacs with M-g bound to the goto-line function.  That means
 >>>going to line 214 is as easy as the key sequence 'ESC 214 ESG g'
 >>>This is what is in my .emacs file:
 >>> (define-key esc-map  "g" 'goto-line)
 >>>
 >>By default M-g is a prefix key, bound to facemenu-keymap.  I prefer:
 >>
 >>(global-set-key "\C-cg" 'goto-line)
 >>(global-set-key "\C-cG" 'goto-char)
 >
 > Wellll...  that is an abomination that shouldn't be allowed
 > to survive!  (Okay, the fact that I've been using M-g bound
 > to goto-line for 20 years has something to do with my opinion,
 > but...)

M-g is reserved for Emacs to bind.  The `C-c LETTER' keys are reserved
for the user to bind.

 > How often do you ever use the facemenu-keymap command, compared
 > to the goto-line command?  In my case, I regularly use
 > goto-line, and simply *never* use the facemenu-keymap command.
 > (I don't use that functionality at all, even by menu or
 > otherwise, as I basically never change any of the faces on the
 > fly.)

I seldom use goto-line, and never use the facemenu-* commands.

 > Hence a nice short key sequence like M-g should be assigned to
 > a commonly used command, and an often used command like goto-line
 > is a good example

Whether goto-line is often used, whether it should be often used, and
whether M-g is a good binding for it are all arguable points.

 > (which I can't imagine binding to a three key
 > sequence).

`C-c g' is a 2-character key sequence.

-- 
Kevin Rodgers

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-25 16:47       ` Kevin Rodgers
@ 2004-02-25 17:35         ` Floyd Davidson
  0 siblings, 0 replies; 49+ messages in thread
From: Floyd Davidson @ 2004-02-25 17:35 UTC (permalink / raw)


Kevin Rodgers <ihs_4664@yahoo.com> wrote:
>Floyd Davidson wrote:
> > Kevin Rodgers <ihs_4664@yahoo.com> wrote:
> >>Floyd Davidson wrote:
> >>>I'm not sure what the default bindings are, but I've always used
> >>>any emacs with M-g bound to the goto-line function.  That means
> >>>going to line 214 is as easy as the key sequence 'ESC 214 ESG g'
> >>>This is what is in my .emacs file:
> >>> (define-key esc-map  "g" 'goto-line)
> >>>
> >>By default M-g is a prefix key, bound to facemenu-keymap.  I prefer:
> >>
> >>(global-set-key "\C-cg" 'goto-line)
> >>(global-set-key "\C-cG" 'goto-char)
> >
> > Wellll...  that is an abomination that shouldn't be allowed
> > to survive!  (Okay, the fact that I've been using M-g bound
> > to goto-line for 20 years has something to do with my opinion,
> > but...)
>
>M-g is reserved for Emacs to bind.  The `C-c LETTER' keys are reserved
>for the user to bind.

I believe you have misunderstood what that means though.  We
are, I believe, talking about configuration changes in a user's
~/.emacs file, not package development for addition to the
.../emacs/lisp/ directory.

Consider where I have in the past been forced to regularly use 3
or 4 different emacsen (today I am retired, and happily down to
just XEmacs for regular use, and GNU Emacs on occasion).  I've
made an effort to have one set of key bindings that for *all* of
the emacsen that I use.  Over the years some of them have
changed, while others have become embedded in concrete that has
hardened with time...

In short, key bindings are *all* a personal choice, and Emacs
does not reserve *any* of them.

The fact that GNU people have decided to bind something
particular to a key has virtually no significance to me at all,
as far as whether I'm likely to change it or not.  I learned
emacs on a variation of Mince, and still use some of the Mince
concepts.  Your C-a key no doubt only goes to the beginning of
a line, and from there does nothing.  Mine will go to the
beginning of a line, and then it will go up to the previous
line.  C-e has the same effect by going to the next line.  It
takes coding up a macro or lisp function for various emacsen
such as GNU Emacs, XEmacs, Microemacs and others, but it makes
editing much faster!

If a command is used with a fair amount of regularity, I want it
bound to a key sequence.  The frequency of its use is a major
factor in selecting the key sequence.

> > How often do you ever use the facemenu-keymap command, compared
> > to the goto-line command?  In my case, I regularly use
> > goto-line, and simply *never* use the facemenu-keymap command.
> > (I don't use that functionality at all, even by menu or
> > otherwise, as I basically never change any of the faces on the
> > fly.)
>
>I seldom use goto-line, and never use the facemenu-* commands.

Hence, why waste key bindings with facemenu commands.

> > Hence a nice short key sequence like M-g should be assigned to
> > a commonly used command, and an often used command like goto-line
> > is a good example
>
>Whether goto-line is often used, whether it should be often used, and
>whether M-g is a good binding for it are all arguable points.

Those who are saying it should never be used are not thinking
about what they are saying.  Of course, you have ignored the
context of my statement above...  which clearly applies only to
*my* often using that command.  That is not arguable.

> > (which I can't imagine binding to a three key
> > sequence).
>
>`C-c g' is a 2-character key sequence.

Which is insignificant.  But the fact that *three* keys must be
pressed to invoke it is, which is why I mentioned it.

--
Floyd L. Davidson           <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)                         floyd@barrow.com

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

* Re: Newbie: Interactive goto-line ?!
       [not found]       ` <mailman.436.1077687252.340.help-gnu-emacs@gnu.org>
  2004-02-25  6:31         ` Floyd Davidson
@ 2004-02-25 17:58         ` Stefan Monnier
  2004-02-26  6:04           ` Eli Zaretskii
       [not found]           ` <mailman.541.1077775437.340.help-gnu-emacs@gnu.org>
  1 sibling, 2 replies; 49+ messages in thread
From: Stefan Monnier @ 2004-02-25 17:58 UTC (permalink / raw)


> It's the opposite in my case.  For example, "M-g M-g" is invaluable as
> a means to fix bad font-lock fontifications (a.k.a. syntax
> highlighting).

I'd be interested to know when that happens.
I mean... I know I can come up with cases, but I basically never bump into
them, so if you have real-world cases where font-lock needs M-g M-g to fix
things, I'd be interested to know so we can try and get those things
right automatically.

The only one I actually know about is the multi-line regexp case (such as
in \title{...\n...} in LaTeX) but this is solved AFAIK with
(setq font-lock-multiline t).


        Stefan

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-24 23:38     ` Floyd Davidson
                         ` (2 preceding siblings ...)
  2004-02-25 16:47       ` Kevin Rodgers
@ 2004-02-25 18:01       ` Stefan Monnier
  2004-02-26  7:08         ` Kai Grossjohann
  3 siblings, 1 reply; 49+ messages in thread
From: Stefan Monnier @ 2004-02-25 18:01 UTC (permalink / raw)


> Hence a nice short key sequence like M-g should be assigned to
> a commonly used command, and an often used command like goto-line
> is a good example (which I can't imagine binding to a three key
> sequence).

As mentioned here in the past, I use C-s by hacking my isearch.el such that
it does "incremental goto-line" when the search string is made of
digits only.
This came about because I originally had goto-line bound to M-g but much too
often instictively hit C-s instead of M-g ('cause I was "searching for line
N"), so I figured I should "follow my fingers" rather than re-train them.


        Stefan

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-25 17:58         ` Stefan Monnier
@ 2004-02-26  6:04           ` Eli Zaretskii
       [not found]           ` <mailman.541.1077775437.340.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 49+ messages in thread
From: Eli Zaretskii @ 2004-02-26  6:04 UTC (permalink / raw)


> Newsgroups: gnu.emacs.help
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Wed, 25 Feb 2004 17:58:54 GMT
> 
> > It's the opposite in my case.  For example, "M-g M-g" is invaluable as
> > a means to fix bad font-lock fontifications (a.k.a. syntax
> > highlighting).
> 
> I'd be interested to know when that happens.

When I'm in the middle of editing and the current block is not yet
syntactically complete, as far as font-lock is aware of the syntax.

I didn't mean to say that it happens to me every day, but it does
happen.  For me, font-lock's fontifications are an important clue of
the code structure, I use it for making sure the code is correct and
frequently find bugs before they hit me.

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-25 18:01       ` Stefan Monnier
@ 2004-02-26  7:08         ` Kai Grossjohann
  2004-02-26 19:38           ` Alan Mackenzie
  0 siblings, 1 reply; 49+ messages in thread
From: Kai Grossjohann @ 2004-02-26  7:08 UTC (permalink / raw)


Stefan Monnier <monnier@iro.umontreal.ca> writes:

> As mentioned here in the past, I use C-s by hacking my isearch.el such that
> it does "incremental goto-line" when the search string is made of
> digits only.

This sounds très cool.  Have you posted it to gnu.emacs.sources
before?  If the feature isn't easily extractable from isearch.el, then
it might be useful to provide hooks in isearch.el that allow for
putting in this feature, then to provide an extra *.el file that does
this.

Or maybe it's sufficient to add Yet Another User Option.

WDYT?
Kai

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-25 16:29             ` Floyd Davidson
@ 2004-02-26 17:32               ` Eli Zaretskii
       [not found]               ` <mailman.580.1077816762.340.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 49+ messages in thread
From: Eli Zaretskii @ 2004-02-26 17:32 UTC (permalink / raw)


> Newsgroups: gnu.emacs.help
> From: Floyd Davidson <floyd@barrow.com>
> Date: Wed, 25 Feb 2004 07:29:29 -0900
> >>
> >> That is not a default binding for either GNU Emacs or XEmacs, so
> >> I'm not positive which function you have bound to it.
> >
> >Did you try "C-h c M-g M-g"?  In my Emacs it says
> >
> >   M-g M-g runs the command font-lock-fontify-block
> 
> Run Emacs with the -q option.  At least in the latest Emacs
> release (21.3.1) that won't be defined.  You can then do C-h b,
> mark the whole buffer, and pipe it through grep to find what
> exactly is defined.
> 
>   M-g d         facemenu-set-default
>   M-g b         facemenu-set-bold
>   M-g i         facemenu-set-italic
>   M-g l         facemenu-set-bold-italic
>   M-g u         facemenu-set-underline
>   M-g o         facemenu-set-faceq
> 
> If you then load the font-lock package, the following are added,
> 
>   M-g ESC       Prefix Command
>   M-g ESC g     font-lock-fontify-block

("M-g ESC g" == "M-g M-g")

I guess we mean different things when we say ``default binding''.  For
me, this includes the bindings defined by packages that aren't
preloaded, as opposed to user-defined bindings on his/her .emacs file.

And on top of that, I couldn't imagine that someone nowadays would use
Emacs without global-font-lock-mode turned on.  I guess I was wrong.

> >Yes, we considered this during development of Emacs 20.1 and rejected
> >this binding, since M-g is a prefix of commands that change fonts and
> >text properties like bold, underlined, etc.
> 
> So you were aware all along that it is not uncontroversial.  In
> fact, at some point in history it was changed to make it that
> prefix rather than the default goto-line that XEmacs and others
> bind to it.  With all due respect, a lot of people clearly
> believe that first change was the mistake; and just as clearly
> if they do it is because they think goto-line is a useful
> function.  Ergo, your statement that it isn't goes against the
> grain of a widely held belief.  Six of one, half a dozen of
> another!

I don't know where you get the statistics.  The decision was made IIRC
based on the majority of Emacs developers at that time.  So it's not
my own personal preference or something.

> Your mistake was say that it isn't for anyone.

Where did I say that?  If I did, that's some kind of bad wording for
which I apologize, since I never meant to say that.

> Let me be a little more succinct.  Your statement that if I use
> goto-line then I'm not using emacs well, because goto-line should
> be unnecessary, is both /arrogant/ and /ignorant/.
> 
> I suggest we drop this part of the discussion because it is
> abjectly silly to assume that your usage is the one true way.
> It *is* appropriate to explain to someone how you happen to use
> it, as an example they might find helpful.
> 
> _To_ _suggest_ _that_ _someone_ _else's_ _example_ _of_ _use_ _is_ _wrong_ _is_
> _not_ _acceptable_.

I didn't say your usage was wrong.  I suggested that you take a good
look at it, but I didn't dictate any conclusions; that is something
that you should do for yourself.  If you conclude that nothing should
be changed, fine.

The suggestion was based on collective experience of many Emacs users
and developers (you might recall that Kai Grossjohann told you
essentially the same thing, that C-x ` is supposed to reduce the use
of goto-line to a minimum).  I fail to see how a suggestion to
reconsider something could be classified as arrogance, ignorance, or
any other derogatory term.  Nor can I understand, for that matter, why
did you need to change a technical discussion into name-calling.

> Perhaps you do not use Emacs enough or in ways that don't
> provide you with sufficient examples.  What you've left out of
> your equation is temporal effect.  If the
> compiler/grep/emacs/other-utility gave you a number, and you
> then proceed to do a variety of useful things for *any* period
> of time, be it 1 second or 10 days, the availability of that
> number in that way is diminished, if not entirely gone.  The
> question, if that number then becomes useful, is which way is
> easiest to reproduce it for Emacs.  *You* might want to
> re-compile something to get it, but I'll just use the goto-line
> function

I don't need to recompile because the output of the compiler is still
there in the *compilation* buffer.

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

* Re: Newbie: Interactive goto-line ?!
       [not found]           ` <mailman.452.1077703465.340.help-gnu-emacs@gnu.org>
  2004-02-25 16:29             ` Floyd Davidson
@ 2004-02-26 17:36             ` Dan Katz
  1 sibling, 0 replies; 49+ messages in thread
From: Dan Katz @ 2004-02-26 17:36 UTC (permalink / raw)



On 25 Feb 2004, Eli Zaretskii wrote:

> I was serious.  If you have serious counter-arguments why goto-line
> is better then "C-x `" and its ilk, please tell.
>
> In a nutshell, the reason why goto-line should not be a frequently
> used command is that normally there's no reason to want to get to
> line number N unless you have a program that told you there's
> something interesting on that line.

Or someone else told you so, perhaps.  I work in an environment where
we have several people in an open environment working in the same code
base, each at their own computer.  It rather frequently happens that
someone in the area will make a request like "can you tell me what's
going on at line 356 of foobar.c" at which point goto-line is rather
useful, and useful frequently enough that I've bound goto-line to
"M-g" from time to time.

Note that I'm not advocating for changing the default binding of "M-g"
and that I'm not saying that goto-line is better than the "C-x `"
mechanism in cases where the latter is applicable.  I simply wanted to
point out an environment in which goto-line is useful enough to
warrant being bound to a simple key-chord.  

Of course, since it's emacs I can do all this rebinding myself without
bothering the maintainers... :-) 

But the newbies the OP is worried about might have a harder time,
perhaps.


Dan

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

* Re: Newbie: Interactive goto-line ?!
       [not found]               ` <mailman.580.1077816762.340.help-gnu-emacs@gnu.org>
@ 2004-02-26 17:50                 ` Jesper Harder
  2004-02-26 18:22                   ` David Kastrup
                                     ` (2 more replies)
  0 siblings, 3 replies; 49+ messages in thread
From: Jesper Harder @ 2004-02-26 17:50 UTC (permalink / raw)


Eli Zaretskii <eliz@elta.co.il> writes:

> And on top of that, I couldn't imagine that someone nowadays would
> use Emacs without global-font-lock-mode turned on.

I agree.  Which begs the question: Why on earth is it turned _off_ by
default?

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-26 17:50                 ` Jesper Harder
@ 2004-02-26 18:22                   ` David Kastrup
  2004-02-26 20:47                     ` Floyd L. Davidson
  2004-02-27 16:42                     ` Stefan Monnier
  2004-02-26 19:03                   ` Eli Zaretskii
       [not found]                   ` <mailman.586.1077822322.340.help-gnu-emacs@gnu.org>
  2 siblings, 2 replies; 49+ messages in thread
From: David Kastrup @ 2004-02-26 18:22 UTC (permalink / raw)


Jesper Harder <harder@myrealbox.com> writes:

> Eli Zaretskii <eliz@elta.co.il> writes:
> 
> > And on top of that, I couldn't imagine that someone nowadays would
> > use Emacs without global-font-lock-mode turned on.
> 
> I agree.  Which begs the question: Why on earth is it turned _off_
> by default?

I have it turned off.  I use Emacs mostly for TeX programming, and
there its competence in analysing complex TeX documents is not
convincing (complex TeX documents can hardly be tackled by anything
but TeX, since syntax categories in this macro language change on the
fly).

I am exposed to large amounts of text all the time.  The contrast on
screen is already much lower than on paper, I need not lower it more
artificially.  In a typical TeX macro document, more than half of the
important text consists of comments.  Making those less readable by
casting them into some weird color is contraproductive.

Colored text is also disadvantaging people with reading disabilities.
Using a full-contrast display at the start for configuring an
unreadable one is easier than using an unreadable one for configuring
a full-contrast display.

On of the few customizations I use when testing things with XEmacs is
to turn off its default font lock mode.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-26 17:50                 ` Jesper Harder
  2004-02-26 18:22                   ` David Kastrup
@ 2004-02-26 19:03                   ` Eli Zaretskii
       [not found]                   ` <mailman.586.1077822322.340.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 49+ messages in thread
From: Eli Zaretskii @ 2004-02-26 19:03 UTC (permalink / raw)


> Newsgroups: gnu.emacs.help
> From: Jesper Harder <harder@myrealbox.com>
> Date: Thu, 26 Feb 2004 18:50:25 +0100
> 
> > And on top of that, I couldn't imagine that someone nowadays would
> > use Emacs without global-font-lock-mode turned on.
> 
> I agree.  Which begs the question: Why on earth is it turned _off_ by
> default?

Conservatism.  It's a matter of time.

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

* Re: Newbie: Interactive goto-line ?!
       [not found]                   ` <mailman.586.1077822322.340.help-gnu-emacs@gnu.org>
@ 2004-02-26 19:28                     ` David Kastrup
  2004-02-26 21:25                       ` Kevin Rodgers
                                         ` (2 more replies)
  0 siblings, 3 replies; 49+ messages in thread
From: David Kastrup @ 2004-02-26 19:28 UTC (permalink / raw)


"Eli Zaretskii" <eliz@elta.co.il> writes:

> > Newsgroups: gnu.emacs.help
> > From: Jesper Harder <harder@myrealbox.com>
> > Date: Thu, 26 Feb 2004 18:50:25 +0100
> > 
> > > And on top of that, I couldn't imagine that someone nowadays
> > > would use Emacs without global-font-lock-mode turned on.
> > 
> > I agree.  Which begs the question: Why on earth is it turned _off_
> > by default?
> 
> Conservatism.  It's a matter of time.

Ok, we should tackle this, I think.  It is something that beginners
complain about all the time, and that the more intelligent persons
will be able to turn off by just clicking the first entry in the
"Options" menu.

How about if we have a command-line option -bw (and probably also -wb
since many vision-impaired people prefer white on black) that will,
among other things, turn off font-locking?  Then the initial problem
for vision-impaired people will be at least possible to solve by
reading the man page prior to starting Emacs.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-26  7:08         ` Kai Grossjohann
@ 2004-02-26 19:38           ` Alan Mackenzie
  0 siblings, 0 replies; 49+ messages in thread
From: Alan Mackenzie @ 2004-02-26 19:38 UTC (permalink / raw)


Kai Grossjohann <kai@emptydomain.de> wrote on Thu, 26 Feb 2004 08:08:09
+0100:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> As mentioned here in the past, I use C-s by hacking my isearch.el such
>> that it does "incremental goto-line" when the search string is made of
>> digits only.

> This sounds très cool.  Have you posted it to gnu.emacs.sources
> before?  If the feature isn't easily extractable from isearch.el, then
> it might be useful to provide hooks in isearch.el that allow for
> putting in this feature, then to provide an extra *.el file that does
> this.

I agree!

> Or maybe it's sufficient to add Yet Another User Option.

> WDYT?

Install it into isearch.el and make it user option, Stefan!

> Kai

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-26 18:22                   ` David Kastrup
@ 2004-02-26 20:47                     ` Floyd L. Davidson
  2004-02-27  9:17                       ` Alan Mackenzie
  2004-02-29 15:29                       ` Kai Grossjohann
  2004-02-27 16:42                     ` Stefan Monnier
  1 sibling, 2 replies; 49+ messages in thread
From: Floyd L. Davidson @ 2004-02-26 20:47 UTC (permalink / raw)


David Kastrup <dak@gnu.org> wrote:
>Jesper Harder <harder@myrealbox.com> writes:
>>
>> I agree.  Which begs the question: Why on earth is it turned _off_
>> by default?
>
>I have it turned off.  I use Emacs mostly for TeX programming, and
>there its competence in analysing complex TeX documents is not
>convincing (complex TeX documents can hardly be tackled by anything
>but TeX, since syntax categories in this macro language change on the
>fly).
>
>I am exposed to large amounts of text all the time.  The contrast on
>screen is already much lower than on paper, I need not lower it more
>artificially.  In a typical TeX macro document, more than half of the
>important text consists of comments.  Making those less readable by
>casting them into some weird color is contraproductive.

This is indeed a significant problem.  I've tried, with no
success, to find a way to change font-lock face colors when
switching between major modes.  That is because what for me is
appropriate for C or Lisp programming is one set, which just
makes TeX too hard to look at, or the other way around.  I can
manage to set up manually invoked reconfigurations of face
properties, but I've not had any luck at all trying to change
them automatically when switching from one buffer to another
where different major modes are being used in the two buffers.

That is something I would really like to have.

>Colored text is also disadvantaging people with reading disabilities.
>Using a full-contrast display at the start for configuring an
>unreadable one is easier than using an unreadable one for configuring
>a full-contrast display.

!!  However, I'm somewhat the opposite, and try to avoid eye
strain by reducing the contrast, or even more, by reducing the
overall brightness of the screen (I can't tolerate a white
background for very long, as an example).  Yet widely varying
levels of contrast between different colored text is just
extremely annoying to me.  So the trick is to find different
color combinations that are about the same level of contrast for
any text that I want to read.  Then I choose low contrast for
text that I want to become invisible yet available to verify
that it does exist (but does not need to be actually read).  And
I want only things that need immediate attention to be either
bright or high contrast.  If I want to force my attention to it
immediately, it can be bright white or bright red, because I
can't stand having either of them on the screen!

>On of the few customizations I use when testing things with XEmacs is
>to turn off its default font lock mode.

Regardless, the idea that next-error eliminates the need for
using goto-line is only true for people doing certain kinds of
editing.  It is great for C programming, but even there it
doesn't solve all problems (and the suggestion that the
compilation buffer is still available is ridiculous compared to
the ease of using M-g for goto-line).

I think the significance of all this is that we all use a
very configurable editor *because* we do so many different things
in so many different ways.  It doesn't bother me a bit that GNU
Emacs uses one binding for M-g and XEmacs uses a different binding,
because in either case it is easy to bind M-g to whatever I want.

I do take offense at someone suggesting that M-g should not be
rebound to goto-line (or whatever).  Bindings aren't sacred at
the user level.  And command usage varies with each user and
with the type of work being done.

--
Floyd L. Davidson           <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)                         floyd@barrow.com

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-26 19:28                     ` David Kastrup
@ 2004-02-26 21:25                       ` Kevin Rodgers
  2004-02-27 12:59                       ` Eli Zaretskii
       [not found]                       ` <mailman.648.1077887747.340.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 49+ messages in thread
From: Kevin Rodgers @ 2004-02-26 21:25 UTC (permalink / raw)


David Kastrup wrote:
 > How about if we have a command-line option -bw (and probably also -wb
 > since many vision-impaired people prefer white on black) that will,
 > among other things, turn off font-locking?

I think a single -mc option (aka --mono-chrome) would be good enough,
since it would be orthogonal to the -rv option (aka --reverse-video).

-- 
Kevin Rodgers

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-26 20:47                     ` Floyd L. Davidson
@ 2004-02-27  9:17                       ` Alan Mackenzie
  2004-02-27 12:56                         ` Eli Zaretskii
  2004-02-27 15:17                         ` Johan Bockgård
  2004-02-29 15:29                       ` Kai Grossjohann
  1 sibling, 2 replies; 49+ messages in thread
From: Alan Mackenzie @ 2004-02-27  9:17 UTC (permalink / raw)


Floyd L. Davidson <floyd@barrow.com> wrote on Thu, 26 Feb 2004 11:47:26 -0900:

> I've tried, with no success, to find a way to change font-lock face
> colors when switching between major modes.  That is because what for me
> is appropriate for C or Lisp programming is one set, which just makes
> TeX too hard to look at, or the other way around.  I can manage to set
> up manually invoked reconfigurations of face properties, but I've not
> had any luck at all trying to change them automatically when switching
> from one buffer to another where different major modes are being used
> in the two buffers.

> That is something I would really like to have.

It would appear that buffer-local faces can not be created.  I don't know
why this should be so.  It seems to be an inconsistency in Emacs, because
just about anything else can be made buffer local.

[ .... ]

> Regardless, the idea that next-error eliminates the need for using
> goto-line is only true for people doing certain kinds of editing.  It
> is great for C programming, but even there it doesn't solve all
> problems (and the suggestion that the compilation buffer is still
> available is ridiculous compared to the ease of using M-g for
> goto-line).

I'd have to agree with you there.  In particular, beginning users need
goto-line, because it takes time to learn how to use next-error and
friends, and beginners already have enough new stuff to cope with.  It
takes even more time to learn how to set the regexp to extract line
numbers from the messages from an arbitrary compiler.

Personally, my M-g is bound to the face stuff, and I find M-g M-g to fix
fontification useful.  I also use M-g d quite a bit, after copying
fontified program text into a plaintext log.  But I do get tired of
typing M-x goto-l<tab>.  Maybe C-x M-g would be an unbad binding for me.
It's not a very good one.  Actually, C-M-g would be better for me, but
something in Emacs is discarding the "M-" bit and converting it to a
plain C-g.  :-(

> I think the significance of all this is that we all use a very
> configurable editor *because* we do so many different things in so many
> different ways.  It doesn't bother me a bit that GNU Emacs uses one
> binding for M-g and XEmacs uses a different binding, because in either
> case it is easy to bind M-g to whatever I want.

Well said, that man!

> I do take offense at someone suggesting that M-g should not be rebound
> to goto-line (or whatever).  Bindings aren't sacred at the user level.
> And command usage varies with each user and with the type of work being
> done.

Well, don't take too much offence.  Eli Z. is a member of the Emacs core
development team, so from his viewpoint the default bindings are
critically important.  I think the Emacs team gets quite a few tirades
along the lines "the standard bindings are idiotic, change them to my
way!", and it's easy to become oversensitive to a post which looks a bit
like that.  (I'm not suggesting your post was such a tirade - it clearly
wasn't.)  Also, Eli's native language isn't English.

At the same time, Eli keeps an eye open for genuine problems normal users
are having, so as to be able to fix them and feed improvements through to
the next Emacs version.  His questions to you would have been more about
trying to understand your problems and make you aware of alternatives,
rather than trying to persuade you to do things the "right" way.

> Floyd L. Davidson

-- 
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-27  9:17                       ` Alan Mackenzie
@ 2004-02-27 12:56                         ` Eli Zaretskii
  2004-02-27 15:17                         ` Johan Bockgård
  1 sibling, 0 replies; 49+ messages in thread
From: Eli Zaretskii @ 2004-02-27 12:56 UTC (permalink / raw)


> From: Alan Mackenzie<none@example.invalid>
> Newsgroups: gnu.emacs.help
> Date: Fri, 27 Feb 2004 09:17:21 +0000
> 
> It would appear that buffer-local faces can not be created.  I don't know
> why this should be so.

Faces in Emacs are frame-local by design.  Making them buffer-local
would mean a thorough rewrite of the face-handling code, IIRC.  Of
course, volunteers are welcome.

> But I do get tired of typing M-x goto-l<tab>.  Maybe C-x M-g would
> be an unbad binding for me.

I bind goto-line to "C-x g", since I don't use registers.

> At the same time, Eli keeps an eye open for genuine problems normal users
> are having, so as to be able to fix them and feed improvements through to
> the next Emacs version.  His questions to you would have been more about
> trying to understand your problems and make you aware of alternatives,
> rather than trying to persuade you to do things the "right" way.

That's what I meant to achieve, thanks for spelling it out.

Also, if someone in this thread suggested that M-g should not be
rebound, ever, it wasn't me.  All I said was that M-g is useful to me,
and that the fact that "C-c g" suggested by someone else was too long
for the OP's liking might mean that goto-line is perhaps overused and
other useful features are perhaps underused.  How that could trigger
accusations of arrogance, I don't understand.  Perhaps I do need an
English class to improve my command of the language.

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-26 19:28                     ` David Kastrup
  2004-02-26 21:25                       ` Kevin Rodgers
@ 2004-02-27 12:59                       ` Eli Zaretskii
       [not found]                       ` <mailman.648.1077887747.340.help-gnu-emacs@gnu.org>
  2 siblings, 0 replies; 49+ messages in thread
From: Eli Zaretskii @ 2004-02-27 12:59 UTC (permalink / raw)


> From: David Kastrup <dak@gnu.org>
> Newsgroups: gnu.emacs.help
> Date: 26 Feb 2004 20:28:47 +0100
> > > 
> > > I agree.  Which begs the question: Why on earth is it turned _off_
> > > by default?
> > 
> > Conservatism.  It's a matter of time.
> 
> Ok, we should tackle this, I think.  It is something that beginners
> complain about all the time, and that the more intelligent persons
> will be able to turn off by just clicking the first entry in the
> "Options" menu.
> 
> How about if we have a command-line option -bw (and probably also -wb
> since many vision-impaired people prefer white on black) that will,
> among other things, turn off font-locking?

I'd rather suggest that the issue of making global-font-lock-mode on
by default be raised on the developers' mailing list each time a new
release is about to enter a pretest, until we succeed in convincing
The Powers That Be to agree to it.  Until now, this was discussed a
few times, and you-all know the results...

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-27  9:17                       ` Alan Mackenzie
  2004-02-27 12:56                         ` Eli Zaretskii
@ 2004-02-27 15:17                         ` Johan Bockgård
  2004-02-27 15:29                           ` David Kastrup
  1 sibling, 1 reply; 49+ messages in thread
From: Johan Bockgård @ 2004-02-27 15:17 UTC (permalink / raw)


Alan Mackenzie<none@example.invalid> writes:

> Floyd L. Davidson <floyd@barrow.com> wrote:
>
>> I've tried, with no success, to find a way to change font-lock face
>> colors when switching between major modes. [...] That is something
>> I would really like to have.
>
> It would appear that buffer-local faces can not be created. I don't
> know why this should be so. It seems to be an inconsistency in
> Emacs, because just about anything else can be made buffer local.

"You can make Font Lock mode use any face, but several faces are
defined specifically for Font Lock mode. Each of these symbols is both
a face name, and a variable whose default value is the symbol itself."

Make the variable buffer local.

-- 
Johan Bockgård

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-27 15:17                         ` Johan Bockgård
@ 2004-02-27 15:29                           ` David Kastrup
  2004-02-27 16:04                             ` Johan Bockgård
  0 siblings, 1 reply; 49+ messages in thread
From: David Kastrup @ 2004-02-27 15:29 UTC (permalink / raw)


bojohan+news@dd.chalmers.se (Johan Bockgård) writes:

> Alan Mackenzie<none@example.invalid> writes:
> 
> > Floyd L. Davidson <floyd@barrow.com> wrote:
> >
> >> I've tried, with no success, to find a way to change font-lock face
> >> colors when switching between major modes. [...] That is something
> >> I would really like to have.
> >
> > It would appear that buffer-local faces can not be created. I don't
> > know why this should be so. It seems to be an inconsistency in
> > Emacs, because just about anything else can be made buffer local.
> 
> "You can make Font Lock mode use any face, but several faces are
> defined specifically for Font Lock mode. Each of these symbols is both
> a face name, and a variable whose default value is the symbol itself."
> 
> Make the variable buffer local.

Wasn't it the case that faces were stored in variable properties?
Those are not buffer-local AFAIR.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-27 15:29                           ` David Kastrup
@ 2004-02-27 16:04                             ` Johan Bockgård
  0 siblings, 0 replies; 49+ messages in thread
From: Johan Bockgård @ 2004-02-27 16:04 UTC (permalink / raw)


David Kastrup <dak@gnu.org> writes:

> bojohan+news@dd.chalmers.se (Johan Bockgård) writes:
>
>> "You can make Font Lock mode use any face, but several faces are
>> defined specifically for Font Lock mode. Each of these symbols is both
>> a face name, and a variable whose default value is the symbol itself."
>> 
>> Make the variable buffer local.
>
> Wasn't it the case that faces were stored in variable properties?
> Those are not buffer-local AFAIR.

That is beside the point. Font lock uses the variables, not the
symbols (AFAICS).

-- 
Johan Bockgård

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

* Re: Newbie: Interactive goto-line ?!
       [not found]           ` <mailman.541.1077775437.340.help-gnu-emacs@gnu.org>
@ 2004-02-27 16:31             ` Stefan Monnier
  2004-02-27 17:59               ` Eli Zaretskii
  0 siblings, 1 reply; 49+ messages in thread
From: Stefan Monnier @ 2004-02-27 16:31 UTC (permalink / raw)


>> > It's the opposite in my case.  For example, "M-g M-g" is invaluable as
>> > a means to fix bad font-lock fontifications (a.k.a. syntax
>> > highlighting).
>> 
>> I'd be interested to know when that happens.

> When I'm in the middle of editing and the current block is not yet
> syntactically complete, as far as font-lock is aware of the syntax.

Well, since you say that M-g M-g fixes it, that means that something is
complete enough for font-lock but just not for the on-the-fly font-locking.
I'd love to see real concrete cases because I can't do much useful
improvement with your above description.


        Stefan

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-26 18:22                   ` David Kastrup
  2004-02-26 20:47                     ` Floyd L. Davidson
@ 2004-02-27 16:42                     ` Stefan Monnier
  2004-02-27 16:58                       ` David Kastrup
  1 sibling, 1 reply; 49+ messages in thread
From: Stefan Monnier @ 2004-02-27 16:42 UTC (permalink / raw)


> I have it turned off.  I use Emacs mostly for TeX programming, and
> there its competence in analysing complex TeX documents is not
> convincing (complex TeX documents can hardly be tackled by anything
> but TeX, since syntax categories in this macro language change on the
> fly).

Hell yes!  TeX's pretty awful in this respect.  Even Perl is easier.
If you have any idea what to do, I'd like to know.  Even doing something
like "turn off font-lock if the buffer is tex-mode and has \catcode or
somesuch" is not good enough: you have to look for funny catcode in all the
packages included.

> I am exposed to large amounts of text all the time.  The contrast on
> screen is already much lower than on paper, I need not lower it more
> artificially.

I have changed most of my font-lock faces to be black-on-white (my default
scheme) and I use bold & italics to distinguish things.

> In a typical TeX macro document, more than half of the
> important text consists of comments.

Have you tried my new doctex-mode ?  It's not using AUCTeX so it's probably
no good for you, but you might like the idea.  I don't hack on such docs
enough to have a good feel for what would be really useful, tho.  The idea
is just to try and turn those "code in comment" back into non-comments.

> Making those less readable by
> casting them into some weird color is contraproductive.

Hmm... I do have comments in a greyish color to make them less visible, but
then I try to avoid having important stuff in comments.


        Stefan

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

* Re: Newbie: Interactive goto-line ?!
       [not found]                       ` <mailman.648.1077887747.340.help-gnu-emacs@gnu.org>
@ 2004-02-27 16:47                         ` Stefan Monnier
  2004-02-27 17:56                           ` Eli Zaretskii
  0 siblings, 1 reply; 49+ messages in thread
From: Stefan Monnier @ 2004-02-27 16:47 UTC (permalink / raw)


> I'd rather suggest that the issue of making global-font-lock-mode on
> by default be raised on the developers' mailing list each time a new
> release is about to enter a pretest, until we succeed in convincing

I see no reason not to try and push it at times unrelated to a new release.
After all, it can be changed at any time.


        Stefan

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-27 16:42                     ` Stefan Monnier
@ 2004-02-27 16:58                       ` David Kastrup
  2004-02-27 18:07                         ` Stefan Monnier
  0 siblings, 1 reply; 49+ messages in thread
From: David Kastrup @ 2004-02-27 16:58 UTC (permalink / raw)


Stefan Monnier <monnier@iro.umontreal.ca> writes:

> > I have it turned off.  I use Emacs mostly for TeX programming, and
> > there its competence in analysing complex TeX documents is not
> > convincing (complex TeX documents can hardly be tackled by
> > anything but TeX, since syntax categories in this macro language
> > change on the fly).
> 
> > I am exposed to large amounts of text all the time.  The contrast
> > on screen is already much lower than on paper, I need not lower it
> > more artificially.
> 
> I have changed most of my font-lock faces to be black-on-white (my
> default scheme) and I use bold & italics to distinguish things.

If one happens to have sane bold and italic fonts, probably not the
worst idea.

An emacs -mc option (monochrome) as mentioned here could do this as
well instead of switching font locking off altogether.  I think that
such a setting could get me to live with font lock.

> > In a typical TeX macro document, more than half of the important
> > text consists of comments.
> 
> Have you tried my new doctex-mode ?  It's not using AUCTeX so it's
> probably no good for you, but you might like the idea.

The thing in CVS?  That merely fiddles with fontlock, right?

> I don't hack on such docs enough to have a good feel for what would
> be really useful, tho.  The idea is just to try and turn those "code
> in comment" back into non-comments.

We (actually, mostly Ralf Angeli) currently are working on filling and
insertion and other stuff in AUCTeX that will accept comments as a
separate syntax domain with regard to LaTeX command insertion and
indentation.  Separate branch named new-fill, currently.  Very
impressive.

We have not yet taken a look at the related font lock issue, however.

> Hmm... I do have comments in a greyish color to make them less
> visible, but then I try to avoid having important stuff in comments.

Well, _if_ it is not important then I would not be writing a comment
in the first place!  Far too lazy for that.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-27 16:47                         ` Stefan Monnier
@ 2004-02-27 17:56                           ` Eli Zaretskii
  0 siblings, 0 replies; 49+ messages in thread
From: Eli Zaretskii @ 2004-02-27 17:56 UTC (permalink / raw)


> Newsgroups: gnu.emacs.help
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Fri, 27 Feb 2004 16:47:13 GMT
> 
> I see no reason not to try and push it at times unrelated to a new release.

The more the better.

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-27 16:31             ` Stefan Monnier
@ 2004-02-27 17:59               ` Eli Zaretskii
  0 siblings, 0 replies; 49+ messages in thread
From: Eli Zaretskii @ 2004-02-27 17:59 UTC (permalink / raw)


> Newsgroups: gnu.emacs.help
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Date: Fri, 27 Feb 2004 16:31:07 GMT
> 
> I'd love to see real concrete cases because I can't do much useful
> improvement with your above description.

I don't think you need to do anything, since these problems are all
but solved in CVS.  But I happen to use older (released) versions of
Emacs on some of the machines I work on, so I still need M-g M-g.

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-27 16:58                       ` David Kastrup
@ 2004-02-27 18:07                         ` Stefan Monnier
  2004-02-27 18:22                           ` David Kastrup
  0 siblings, 1 reply; 49+ messages in thread
From: Stefan Monnier @ 2004-02-27 18:07 UTC (permalink / raw)


> If one happens to have sane bold and italic fonts, probably not the
> worst idea.

Such things don't just happen.  I actually made up my own italics version of
misc-fixed-semicondensed since it didn't exist.  Nowadays, it comes
standard so I ditched my home-grown font.

>> Have you tried my new doctex-mode ?  It's not using AUCTeX so it's
>> probably no good for you, but you might like the idea.
> The thing in CVS?  That merely fiddles with fontlock, right?

Right.  Tho not the faces part of font-lock, but the syntactic part (the
face part then automatically follows from it).

>> I don't hack on such docs enough to have a good feel for what would
>> be really useful, tho.  The idea is just to try and turn those "code
>> in comment" back into non-comments.

> We (actually, mostly Ralf Angeli) currently are working on filling and
> insertion and other stuff in AUCTeX that will accept comments as a
> separate syntax domain with regard to LaTeX command insertion and
> indentation.  Separate branch named new-fill, currently.  Very
> impressive.

I don't actually understand what that means.  Can you show an example?

> Well, _if_ it is not important then I would not be writing a comment
> in the first place!  Far too lazy for that.

Well, I could say that making comments less legible forces one to read them
slowly so one better understands them ;-)


        Stefan

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-27 18:07                         ` Stefan Monnier
@ 2004-02-27 18:22                           ` David Kastrup
  2004-02-27 20:46                             ` Stefan Monnier
  0 siblings, 1 reply; 49+ messages in thread
From: David Kastrup @ 2004-02-27 18:22 UTC (permalink / raw)


Stefan Monnier <monnier@iro.umontreal.ca> writes:

> > If one happens to have sane bold and italic fonts, probably not the
> > worst idea.
> 
> Such things don't just happen.  I actually made up my own italics
> version of misc-fixed-semicondensed since it didn't exist.
> Nowadays, it comes standard so I ditched my home-grown font.

If it comes standard in the intl-fonts collection, one could rely on
it sufficiently to work.

> >> Have you tried my new doctex-mode ?  It's not using AUCTeX so
> >> it's probably no good for you, but you might like the idea.  The
> >> thing in CVS?  That merely fiddles with fontlock, right?
> 
> Right.  Tho not the faces part of font-lock, but the syntactic part
> (the face part then automatically follows from it).
> 
> >> I don't hack on such docs enough to have a good feel for what
> >> would be really useful, tho.  The idea is just to try and turn
> >> those "code in comment" back into non-comments.
> 
> > We (actually, mostly Ralf Angeli) currently are working on filling
> > and insertion and other stuff in AUCTeX that will accept comments
> > as a separate syntax domain with regard to LaTeX command insertion
> > and indentation.  Separate branch named new-fill, currently.  Very
> > impressive.
> 
> I don't actually understand what that means.  Can you show an
> example?

Pick some arbitrary .dtx code:

% Now redefine "\@tabarray" to restore "\hline" and "\multicolumn" so
% that arrays and tabulars nested in longtable (or in page headings on
% longtable pages) work out OK. Saving the original definitions done
% here so that you can load the \package{array} package before or after
% \package{longtable}.
%    \begin{macrocode}
  \let\LT@@tabarray\@tabarray
  \let\LT@@hl\hline
  \def\@tabarray{%
    \let\hline\LT@@hl
%    \end{macrocode}
%\begin{verbatim}
%    \let\multicolumn\LT@mcol
%\end{verbatim}
%    \begin{macrocode}
    \LT@@tabarray}%
  \let\\\LT@tabularcr\let\tabularnewline\\%
  \def\newpage{\noalign{\break}}%
%    \end{macrocode}
% \changes{v4.05}{1996/11/12}
%      {\cs{nopagebreak} and \cs{pagebreak} added}
% More or less standard definitions, but first start a "\noalign".
%    \begin{macrocode}
  \def\pagebreak{\noalign{\ifnum`}=0\fi\@testopt{\LT@no@pgbk-}4}%
  \def\nopagebreak{\noalign{\ifnum`}=0\fi\@testopt\LT@no@pgbk4}%
%    \end{macrocode}
%
%    \begin{macrocode}
  \let\hline\LT@hline \let\kill\LT@kill\let\caption\LT@caption
  \@tempdima\ht\strutbox
%    \end{macrocode}
%


With regard to indentation and environment completion, the comments
are one domain that is not interested in unmatched braced and
environments in the code, and vice versa.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-27 18:22                           ` David Kastrup
@ 2004-02-27 20:46                             ` Stefan Monnier
  0 siblings, 0 replies; 49+ messages in thread
From: Stefan Monnier @ 2004-02-27 20:46 UTC (permalink / raw)


> With regard to indentation and environment completion, the comments
> are one domain that is not interested in unmatched braced and
> environments in the code, and vice versa.

Oh I see what you mean (I got confused by the `fill' part because it seems
not so tricky to get filling to treat boundaries bewteen comments and
non-comments as paragraph separators;  but yes: for indentation and stuff,
it's more ... interesting).

All doctex-mode does is put the documentation part of the code in
font-lock-doc-face rather than font-lock-comment-face.


        Stefan

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-26 20:47                     ` Floyd L. Davidson
  2004-02-27  9:17                       ` Alan Mackenzie
@ 2004-02-29 15:29                       ` Kai Grossjohann
  2004-03-01  4:07                         ` Floyd L. Davidson
  1 sibling, 1 reply; 49+ messages in thread
From: Kai Grossjohann @ 2004-02-29 15:29 UTC (permalink / raw)


floyd@barrow.com (Floyd L. Davidson) writes:

> This is indeed a significant problem.  I've tried, with no
> success, to find a way to change font-lock face colors when
> switching between major modes.  That is because what for me is
> appropriate for C or Lisp programming is one set, which just
> makes TeX too hard to look at, or the other way around.

You could create faces fld-lisp-font-lock-comment-face and
fld-c-font-lock-comment-face, and then do

(make-local-variable 'font-lock-comment-face)
(setq font-lock-comment-face 'fld-lisp-font-lock-command-face)

in lisp-mode-hook and the corresponding thing in c-mode-hook.  Does it
work?

Kai

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

* Re: Newbie: Interactive goto-line ?!
  2004-02-29 15:29                       ` Kai Grossjohann
@ 2004-03-01  4:07                         ` Floyd L. Davidson
  2004-03-01  4:47                           ` Johan Bockgård
  0 siblings, 1 reply; 49+ messages in thread
From: Floyd L. Davidson @ 2004-03-01  4:07 UTC (permalink / raw)


Kai Grossjohann <kai@emptydomain.de> wrote:
>floyd@barrow.com (Floyd L. Davidson) writes:
>
>> This is indeed a significant problem.  I've tried, with no
>> success, to find a way to change font-lock face colors when
>> switching between major modes.  That is because what for me is
>> appropriate for C or Lisp programming is one set, which just
>> makes TeX too hard to look at, or the other way around.
>
>You could create faces fld-lisp-font-lock-comment-face and
>fld-c-font-lock-comment-face, and then do
>
>(make-local-variable 'font-lock-comment-face)
>(setq font-lock-comment-face 'fld-lisp-font-lock-command-face)
>
>in lisp-mode-hook and the corresponding thing in c-mode-hook.  Does it
>work?

Unfortunately, no it doesn't.  Whichever hook is run last, still
sets the colors for all other modes.

I tried a few variations on that too, and they all do
essentially the same.  I've used copy-face instead of setq to
change the font-lock- face.  I've used set-face-foreground to
change the color, and have tried it on the font-lock- face after
it has been changed, and on the fld-font-lock- face before it is
used to set the font-lock- face.

In all cases the results were the same.

I have figured out how to write a major mode of my own that can
be changed independantly of others, but I'd like to figure out
how to do it entirely within the init files and not have to
modify any distribution lisp files.

--
Floyd L. Davidson           <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)                         floyd@barrow.com

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

* Re: Newbie: Interactive goto-line ?!
  2004-03-01  4:07                         ` Floyd L. Davidson
@ 2004-03-01  4:47                           ` Johan Bockgård
  2004-03-01  6:12                             ` Floyd L. Davidson
  0 siblings, 1 reply; 49+ messages in thread
From: Johan Bockgård @ 2004-03-01  4:47 UTC (permalink / raw)


floyd@barrow.com (Floyd L. Davidson) writes:

> Kai Grossjohann <kai@emptydomain.de> wrote:

>>You could create faces fld-lisp-font-lock-comment-face and
>>fld-c-font-lock-comment-face, and then do
>>
>>(make-local-variable 'font-lock-comment-face)
>>(setq font-lock-comment-face 'fld-lisp-font-lock-command-face)
>>
>>in lisp-mode-hook and the corresponding thing in c-mode-hook.  Does it
>>work?
>
> Unfortunately, no it doesn't.  Whichever hook is run last, still
> sets the colors for all other modes.

Was that in XEmacs rather than Emacs?

-- 
Johan Bockgård

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

* Re: Newbie: Interactive goto-line ?!
  2004-03-01  4:47                           ` Johan Bockgård
@ 2004-03-01  6:12                             ` Floyd L. Davidson
  0 siblings, 0 replies; 49+ messages in thread
From: Floyd L. Davidson @ 2004-03-01  6:12 UTC (permalink / raw)


bojohan+news@dd.chalmers.se (Johan Bockgård) wrote:
>floyd@barrow.com (Floyd L. Davidson) writes:
>
>> Kai Grossjohann <kai@emptydomain.de> wrote:
>
>>>You could create faces fld-lisp-font-lock-comment-face and
>>>fld-c-font-lock-comment-face, and then do
>>>
>>>(make-local-variable 'font-lock-comment-face)
>>>(setq font-lock-comment-face 'fld-lisp-font-lock-command-face)
>>>
>>>in lisp-mode-hook and the corresponding thing in c-mode-hook.  Does it
>>>work?
>>
>> Unfortunately, no it doesn't.  Whichever hook is run last, still
>> sets the colors for all other modes.
>
>Was that in XEmacs rather than Emacs?

I did the testing in XEmacs.  However, spot checks with GNU Emacs
showed the same results with a few more quirks thrown in for
good measure (some of the things that work in XEmacs cause font-lock
to be erratic in GNU Emacs).

--
Floyd L. Davidson           <http://web.newsguy.com/floyd_davidson>
Ukpeagvik (Barrow, Alaska)                         floyd@barrow.com

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

end of thread, other threads:[~2004-03-01  6:12 UTC | newest]

Thread overview: 49+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-24 10:55 Newbie: Interactive goto-line ?! Karel Kubat
2004-02-24 10:58 ` Maurizio Loreti
2004-02-24 11:42   ` Gian Uberto Lauri
2004-02-24 16:08     ` Brad Collins
2004-02-24 11:00 ` Karel Kubat
2004-02-24 11:34 ` Jiri Pejchal
2004-02-24 22:21   ` Johan Bockgård
2004-02-24 18:35 ` Floyd Davidson
2004-02-24 21:01   ` Kevin Rodgers
2004-02-24 23:38     ` Floyd Davidson
2004-02-25  5:33       ` Eli Zaretskii
     [not found]       ` <mailman.436.1077687252.340.help-gnu-emacs@gnu.org>
2004-02-25  6:31         ` Floyd Davidson
2004-02-25  8:56           ` Kai Grossjohann
2004-02-25 10:05           ` Eli Zaretskii
     [not found]           ` <mailman.452.1077703465.340.help-gnu-emacs@gnu.org>
2004-02-25 16:29             ` Floyd Davidson
2004-02-26 17:32               ` Eli Zaretskii
     [not found]               ` <mailman.580.1077816762.340.help-gnu-emacs@gnu.org>
2004-02-26 17:50                 ` Jesper Harder
2004-02-26 18:22                   ` David Kastrup
2004-02-26 20:47                     ` Floyd L. Davidson
2004-02-27  9:17                       ` Alan Mackenzie
2004-02-27 12:56                         ` Eli Zaretskii
2004-02-27 15:17                         ` Johan Bockgård
2004-02-27 15:29                           ` David Kastrup
2004-02-27 16:04                             ` Johan Bockgård
2004-02-29 15:29                       ` Kai Grossjohann
2004-03-01  4:07                         ` Floyd L. Davidson
2004-03-01  4:47                           ` Johan Bockgård
2004-03-01  6:12                             ` Floyd L. Davidson
2004-02-27 16:42                     ` Stefan Monnier
2004-02-27 16:58                       ` David Kastrup
2004-02-27 18:07                         ` Stefan Monnier
2004-02-27 18:22                           ` David Kastrup
2004-02-27 20:46                             ` Stefan Monnier
2004-02-26 19:03                   ` Eli Zaretskii
     [not found]                   ` <mailman.586.1077822322.340.help-gnu-emacs@gnu.org>
2004-02-26 19:28                     ` David Kastrup
2004-02-26 21:25                       ` Kevin Rodgers
2004-02-27 12:59                       ` Eli Zaretskii
     [not found]                       ` <mailman.648.1077887747.340.help-gnu-emacs@gnu.org>
2004-02-27 16:47                         ` Stefan Monnier
2004-02-27 17:56                           ` Eli Zaretskii
2004-02-26 17:36             ` Dan Katz
2004-02-25 17:58         ` Stefan Monnier
2004-02-26  6:04           ` Eli Zaretskii
     [not found]           ` <mailman.541.1077775437.340.help-gnu-emacs@gnu.org>
2004-02-27 16:31             ` Stefan Monnier
2004-02-27 17:59               ` Eli Zaretskii
2004-02-25 16:47       ` Kevin Rodgers
2004-02-25 17:35         ` Floyd Davidson
2004-02-25 18:01       ` Stefan Monnier
2004-02-26  7:08         ` Kai Grossjohann
2004-02-26 19:38           ` Alan Mackenzie

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.