* outline-minor-mode-prefix doen't work?
@ 2005-10-27 15:51 Brep
2005-10-28 10:25 ` Per Abrahamsen
0 siblings, 1 reply; 15+ messages in thread
From: Brep @ 2005-10-27 15:51 UTC (permalink / raw)
I'd like to change outline minor mode prefix
from "C-c @" to "C-o", or something like that,
according to the menual, this should work,
(global-unset-key "\C-o")
(setq outline-minor-mode-prefix "\C-o")
but it has no effect.
Any idea?
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: outline-minor-mode-prefix doen't work?
2005-10-27 15:51 outline-minor-mode-prefix doen't work? Brep
@ 2005-10-28 10:25 ` Per Abrahamsen
2005-10-28 16:25 ` Zhang Wei
0 siblings, 1 reply; 15+ messages in thread
From: Per Abrahamsen @ 2005-10-28 10:25 UTC (permalink / raw)
Brep <brep@163.com> writes:
> I'd like to change outline minor mode prefix
> from "C-c @" to "C-o", or something like that,
> according to the menual, this should work,
>
> (global-unset-key "\C-o")
> (setq outline-minor-mode-prefix "\C-o")
>
> but it has no effect.
Have you rebooted Emacs after put those lines in .emacs?
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: outline-minor-mode-prefix doen't work?
2005-10-28 10:25 ` Per Abrahamsen
@ 2005-10-28 16:25 ` Zhang Wei
2005-11-01 4:32 ` Stefan Monnier
0 siblings, 1 reply; 15+ messages in thread
From: Zhang Wei @ 2005-10-28 16:25 UTC (permalink / raw)
Per Abrahamsen <abraham@dina.kvl.dk> writes:
>> I'd like to change outline minor mode prefix
>> from "C-c @" to "C-o", or something like that,
>> according to the menual, this should work,
>>
>> (global-unset-key "\C-o")
>> (setq outline-minor-mode-prefix "\C-o")
>>
>> but it has no effect.
>
> Have you rebooted Emacs after put those lines in .emacs?
Somebody has told me the reason.
This line:
(setq outline-minor-mode-prefix "\C-o")
has to be put before:
(require 'outline)
otherwise it will has no effect.
Thank you anyway.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: outline-minor-mode-prefix doen't work?
2005-10-28 16:25 ` Zhang Wei
@ 2005-11-01 4:32 ` Stefan Monnier
2005-11-01 10:19 ` William Xu
` (2 more replies)
0 siblings, 3 replies; 15+ messages in thread
From: Stefan Monnier @ 2005-11-01 4:32 UTC (permalink / raw)
> has to be put before:
> (require 'outline)
Why do you need to (require 'outline)?
Stefan
PS: other than because of the desire to slow down Emacs's startup, that is.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: outline-minor-mode-prefix doen't work?
2005-11-01 4:32 ` Stefan Monnier
@ 2005-11-01 10:19 ` William Xu
[not found] ` <mailman.13541.1130841913.20277.help-gnu-emacs@gnu.org>
2005-11-06 12:17 ` Zhang Wei
2 siblings, 0 replies; 15+ messages in thread
From: William Xu @ 2005-11-01 10:19 UTC (permalink / raw)
Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> has to be put before:
>> (require 'outline)
>
> Why do you need to (require 'outline)?
;; suppose in outline.el
(defvar outline-minor-mode-prefix "\C-c")
(defvar outline-minor-mode-keys
(let ((map (make-sparse-keymap)))
(define-key map "\C-n" 'outline-mode-next-heading)
map))
(define-key outline-minor-mode-map
outline-minor-mode-prefix
outline-minor-mode-keys)
If outline.el is loaded before,
(setq outline-minor-mode-prefix "\C-c")
Then there's no chance to re-evaulate,
(define-key outline-minor-mode-map
outline-minor-mode-prefix
outline-minor-mode-keys)
to update keymaps, unless a forced `(require 'outline)' afterwards.
Just my guess...though.
--
William
((email . "william.xwl@gmail.com")
(blog . "http://matchsticker.mysmth.net"))
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: outline-minor-mode-prefix doen't work?
[not found] ` <mailman.13541.1130841913.20277.help-gnu-emacs@gnu.org>
@ 2005-11-01 12:00 ` David Kastrup
2005-11-01 14:26 ` William Xu
[not found] ` <mailman.13562.1130855207.20277.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 15+ messages in thread
From: David Kastrup @ 2005-11-01 12:00 UTC (permalink / raw)
William Xu <william.xwl@gmail.com> writes:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>>> has to be put before:
>>> (require 'outline)
>>
>> Why do you need to (require 'outline)?
>
> ;; suppose in outline.el
> (defvar outline-minor-mode-prefix "\C-c")
>
> (defvar outline-minor-mode-keys
> (let ((map (make-sparse-keymap)))
> (define-key map "\C-n" 'outline-mode-next-heading)
> map))
>
> (define-key outline-minor-mode-map
> outline-minor-mode-prefix
> outline-minor-mode-keys)
>
> If outline.el is loaded before,
>
> (setq outline-minor-mode-prefix "\C-c")
>
> Then there's no chance to re-evaulate,
defvar does not overwrite existing values. Even if it did,
eval-after-load could be used.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: outline-minor-mode-prefix doen't work?
2005-11-01 12:00 ` David Kastrup
@ 2005-11-01 14:26 ` William Xu
[not found] ` <mailman.13562.1130855207.20277.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 15+ messages in thread
From: William Xu @ 2005-11-01 14:26 UTC (permalink / raw)
David Kastrup <dak@gnu.org> writes:
> William Xu <william.xwl@gmail.com> writes:
>
>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>
>>>> has to be put before:
>>>> (require 'outline)
>>>
>>> Why do you need to (require 'outline)?
>>
>> ;; suppose in outline.el
>> (defvar outline-minor-mode-prefix "\C-c")
>>
>> (defvar outline-minor-mode-keys
>> (let ((map (make-sparse-keymap)))
>> (define-key map "\C-n" 'outline-mode-next-heading)
>> map))
>>
>> (define-key outline-minor-mode-map
>> outline-minor-mode-prefix
>> outline-minor-mode-keys)
>>
>> If outline.el is loaded before,
>>
>> (setq outline-minor-mode-prefix "\C-c")
Oh, here better be,
(setq outline-minor-mode-prefix "\C-o")
as an e.g. of changing the prefix.
>> Then there's no chance to re-evaulate,
>
> defvar does not overwrite existing values.
Yes. This is why placing (require 'outline) after
(setq outline-minor-mode-prefix "\C-o") works.
In all, i was saying these two cases,
;; change prefix successfully, prefix will be changed to "\C-o".
(setq outline-minor-mode-prefix "\C-o")
(require 'outline)
;; change prefix without success, prefix will still be the one
;; defined in `outline.el' as "\C-c".
(require 'outline)
(setq outline-minor-mode-prefix "\C-o")
--
William
((email . "william.xwl@gmail.com")
(blog . "http://matchsticker.mysmth.net"))
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: outline-minor-mode-prefix doen't work?
[not found] ` <mailman.13562.1130855207.20277.help-gnu-emacs@gnu.org>
@ 2005-11-01 15:38 ` David Kastrup
2005-11-01 16:17 ` William Xu
[not found] ` <mailman.13612.1130899457.20277.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 15+ messages in thread
From: David Kastrup @ 2005-11-01 15:38 UTC (permalink / raw)
William Xu <william.xwl@gmail.com> writes:
> David Kastrup <dak@gnu.org> writes:
>
>> William Xu <william.xwl@gmail.com> writes:
>>
>>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>>>
>>>>> has to be put before:
>>>>> (require 'outline)
>>>>
>>>> Why do you need to (require 'outline)?
>>>
>>> ;; suppose in outline.el
>>> (defvar outline-minor-mode-prefix "\C-c")
>>>
>>> (defvar outline-minor-mode-keys
>>> (let ((map (make-sparse-keymap)))
>>> (define-key map "\C-n" 'outline-mode-next-heading)
>>> map))
>>>
>>> (define-key outline-minor-mode-map
>>> outline-minor-mode-prefix
>>> outline-minor-mode-keys)
>>>
>>> If outline.el is loaded before,
>>>
>>> (setq outline-minor-mode-prefix "\C-c")
>
> Oh, here better be,
>
> (setq outline-minor-mode-prefix "\C-o")
>
> as an e.g. of changing the prefix.
>
>>> Then there's no chance to re-evaulate,
>>
>> defvar does not overwrite existing values.
>
> Yes. This is why placing (require 'outline) after
> (setq outline-minor-mode-prefix "\C-o") works.
I repeat Stefan's question:
>>>> Why do you need to (require 'outline)?
You don't need to load outline real fast for the setting of
outline-minor-mode-prefix to have an effect. It is sufficient that it
will be loaded at some point of time.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: outline-minor-mode-prefix doen't work?
2005-11-01 15:38 ` David Kastrup
@ 2005-11-01 16:17 ` William Xu
[not found] ` <mailman.13612.1130899457.20277.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 15+ messages in thread
From: William Xu @ 2005-11-01 16:17 UTC (permalink / raw)
David Kastrup <dak@gnu.org> writes:
[...]
> I repeat Stefan's question:
>
>>>>> Why do you need to (require 'outline)?
>
> You don't need to load outline real fast for the setting of
> outline-minor-mode-prefix to have an effect.
The point is that setting of outline-minor-mode-prefix should be done
before loading outline.el, or more exactly, defining the keymap. Do we
agree on this? If yes, adding (require 'outline) afterwards is just
explicitly to guarantee this.
Generally, we would require things at first, and settings follow
later. Prefix setting is kind of uncommon.
> It is sufficient that it will be loaded at some point of time.
This sufficiency depends on using some features like autoload,
eval-after-load, in outline.el ?
--
William
((email . "william.xwl@gmail.com")
(blog . "http://matchsticker.mysmth.net"))
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: outline-minor-mode-prefix doen't work?
[not found] ` <mailman.13612.1130899457.20277.help-gnu-emacs@gnu.org>
@ 2005-11-02 10:19 ` Per Abrahamsen
2005-11-02 11:47 ` William Xu
2005-11-02 10:20 ` David Kastrup
1 sibling, 1 reply; 15+ messages in thread
From: Per Abrahamsen @ 2005-11-02 10:19 UTC (permalink / raw)
William Xu <william.xwl@gmail.com> writes:
> The point is that setting of outline-minor-mode-prefix should be done
> before loading outline.el, or more exactly, defining the keymap. Do we
> agree on this? If yes, adding (require 'outline) afterwards is just
> explicitly to guarantee this.
The point Stefan and David are trying to make is that Emacs packages
are in general designed to be loaded as late as possible, and relying
on autoload are therefore better than using an explicit require.
You can, again in general, do lots of customizations to a package
before it is loaded.
The reason Emacs work like this is to make upstart faster, and avoid
loading stuff that might not be used in a given session.
Some independently developed packages are designed to take effect just
by loading them, but the Emacs developers try to fix that before
including them in the main distribution.
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: outline-minor-mode-prefix doen't work?
[not found] ` <mailman.13612.1130899457.20277.help-gnu-emacs@gnu.org>
2005-11-02 10:19 ` Per Abrahamsen
@ 2005-11-02 10:20 ` David Kastrup
1 sibling, 0 replies; 15+ messages in thread
From: David Kastrup @ 2005-11-02 10:20 UTC (permalink / raw)
William Xu <william.xwl@gmail.com> writes:
> David Kastrup <dak@gnu.org> writes:
>
> [...]
>
>> I repeat Stefan's question:
>>
>>>>>> Why do you need to (require 'outline)?
>>
>> You don't need to load outline real fast for the setting of
>> outline-minor-mode-prefix to have an effect.
>
> The point is that setting of outline-minor-mode-prefix should be done
> before loading outline.el, or more exactly, defining the keymap. Do we
> agree on this? If yes, adding (require 'outline) afterwards is just
> explicitly to guarantee this.
Nonsense. The require will do nothing if it has been loaded already,
and the effect of the setq will take place whenever outline eventually
gets loaded.
>> It is sufficient that it will be loaded at some point of time.
>
> This sufficiency depends on using some features like autoload,
> eval-after-load, in outline.el ?
Why would it?
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: outline-minor-mode-prefix doen't work?
2005-11-02 10:19 ` Per Abrahamsen
@ 2005-11-02 11:47 ` William Xu
0 siblings, 0 replies; 15+ messages in thread
From: William Xu @ 2005-11-02 11:47 UTC (permalink / raw)
Per Abrahamsen <abraham@dina.kvl.dk> writes:
> William Xu <william.xwl@gmail.com> writes:
>
>> The point is that setting of outline-minor-mode-prefix should be done
>> before loading outline.el, or more exactly, defining the keymap. Do we
>> agree on this? If yes, adding (require 'outline) afterwards is just
>> explicitly to guarantee this.
>
> The point Stefan and David are trying to make is that Emacs packages
> are in general designed to be loaded as late as possible, and relying
> on autoload are therefore better than using an explicit require.
>
> You can, again in general, do lots of customizations to a package
> before it is loaded.
>
> The reason Emacs work like this is to make upstart faster, and avoid
> loading stuff that might not be used in a given session.
>
> Some independently developed packages are designed to take effect just
> by loading them, but the Emacs developers try to fix that before
> including them in the main distribution.
Thanks. That helps a lot.
--
William
((email . "william.xwl@gmail.com")
(blog . "http://matchsticker.mysmth.net"))
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: outline-minor-mode-prefix doen't work?
2005-11-01 4:32 ` Stefan Monnier
2005-11-01 10:19 ` William Xu
[not found] ` <mailman.13541.1130841913.20277.help-gnu-emacs@gnu.org>
@ 2005-11-06 12:17 ` Zhang Wei
2005-11-06 12:50 ` David Kastrup
2005-11-22 20:05 ` Stefan Monnier
2 siblings, 2 replies; 15+ messages in thread
From: Zhang Wei @ 2005-11-06 12:17 UTC (permalink / raw)
Stefan Monnier <monnier@iro.umontreal.ca> writes:
> Why do you need to (require 'outline)?
If (setq outline-minor-mode-prefix "\C-o") is put before any statement involve
outline mode, such as (setq default-major-mode 'outline), it will take effect,
otherwise it won't.
So (require 'outline) could _guarantee_ (setq outline-minor-mode-prefix "\C-o")
takes effect, though it's ugly, but it's better than talking about: "Put it as
the first statement of your .emacs file, or you may suck."
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: outline-minor-mode-prefix doen't work?
2005-11-06 12:17 ` Zhang Wei
@ 2005-11-06 12:50 ` David Kastrup
2005-11-22 20:05 ` Stefan Monnier
1 sibling, 0 replies; 15+ messages in thread
From: David Kastrup @ 2005-11-06 12:50 UTC (permalink / raw)
Zhang Wei <id.brep@gmail.com> writes:
> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
>> Why do you need to (require 'outline)?
>
> If (setq outline-minor-mode-prefix "\C-o") is put before any statement involve
> outline mode, such as (setq default-major-mode 'outline), it will take effect,
> otherwise it won't.
>
> So (require 'outline) could _guarantee_
> (setq outline-minor-mode-prefix "\C-o") takes effect,
No. If outline is loaded before the setting of
outline-minor-mode-prefix, (require 'outline) will not magically make
it become reloaded again.
If outline is not loaded before the setting of
outline-minor-mode-prefix, one does not need the (require 'outline) to
guarantee that it won't be loaded before the setting.
And requiring outline will not make the stuff work when it is already
loaded.
> though it's ugly, but it's better than talking about: "Put it as the
> first statement of your .emacs file, or you may suck."
No, it isn't better. It is snake oil: it helps in absolutely no case
at all, and it causes additional startup delays for no conceivable
reason whatsoever.
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum
^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: outline-minor-mode-prefix doen't work?
2005-11-06 12:17 ` Zhang Wei
2005-11-06 12:50 ` David Kastrup
@ 2005-11-22 20:05 ` Stefan Monnier
1 sibling, 0 replies; 15+ messages in thread
From: Stefan Monnier @ 2005-11-22 20:05 UTC (permalink / raw)
> So (require 'outline) could _guarantee_ (setq outline-minor-mode-prefix
> "\C-o") takes effect
No: such a `require' can only cause a package to be loaded *earlier*,
not later.
Stefan
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2005-11-22 20:05 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-27 15:51 outline-minor-mode-prefix doen't work? Brep
2005-10-28 10:25 ` Per Abrahamsen
2005-10-28 16:25 ` Zhang Wei
2005-11-01 4:32 ` Stefan Monnier
2005-11-01 10:19 ` William Xu
[not found] ` <mailman.13541.1130841913.20277.help-gnu-emacs@gnu.org>
2005-11-01 12:00 ` David Kastrup
2005-11-01 14:26 ` William Xu
[not found] ` <mailman.13562.1130855207.20277.help-gnu-emacs@gnu.org>
2005-11-01 15:38 ` David Kastrup
2005-11-01 16:17 ` William Xu
[not found] ` <mailman.13612.1130899457.20277.help-gnu-emacs@gnu.org>
2005-11-02 10:19 ` Per Abrahamsen
2005-11-02 11:47 ` William Xu
2005-11-02 10:20 ` David Kastrup
2005-11-06 12:17 ` Zhang Wei
2005-11-06 12:50 ` David Kastrup
2005-11-22 20:05 ` Stefan Monnier
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).