William Stevenson | 1 Feb 2012 03:05
Picon
Gravatar

/etc/TODO: define-minor-mode & minor-mode-list

Looking in the TODO file for a beginner item I started with:

** Check what minor modes don't use define-minor-mode and convert them
to use it.

I'm confused about minor-mode-list. Why are some minor-modes added in
the definition even though they are defined with define-minor-mode? 
I also found that abbrev-mode remained in the list if it was removed 
from this definition.

Also is this todo considered todone?

;; If a minor mode is not defined with define-minor-mode,
;; add it here explicitly.
;; isearch-mode is deliberately excluded, since you should
;; not call it yourself.
(defvar minor-mode-list '(auto-save-mode auto-fill-mode abbrev-mode
					 overwrite-mode view-mode
                                         hs-minor-mode)
  "List of all minor mode functions.")

Juanma Barranquero | 1 Feb 2012 03:32
Picon
Gravatar

Re: /etc/TODO: define-minor-mode & minor-mode-list

On Wed, Feb 1, 2012 at 03:05, William Stevenson <yhvh2000 <at> gmail.com> wrote:

> I'm confused about minor-mode-list. Why are some minor-modes added in
> the definition even though they are defined with define-minor-mode?

Likely because these minor modes were converted to use
define-minor-mode, but not removed from minor-mode-list.

> I also found that abbrev-mode remained in the list if it was removed
> from this definition.

define-minor-mode (conditionally) calls add-minor-mode, which does

  (unless (memq toggle minor-mode-list)
    (push toggle minor-mode-list))

so minor modes defined with define-minor-mode will end in the list.
For preloaded minor modes, that's already so:

 emacs -Q --batch --eval "(princ (length minor-mode-list))"  => 30

> Also is this todo considered todone?

There are 300+ instances of "(defun .*-mode " in the sources. Not all
are really modes, and many are major modes, but surely there are still
unconverted minor modes.

    Juanma

(Continue reading)

William Stevenson | 1 Feb 2012 03:46
Picon
Gravatar

Re: /etc/TODO: define-minor-mode & minor-mode-list

Juanma Barranquero <lekktu <at> gmail.com> writes:

> On Wed, Feb 1, 2012 at 03:05, William Stevenson <yhvh2000 <at> gmail.com> wrote:
>
>> I'm confused about minor-mode-list. Why are some minor-modes added in
>> the definition even though they are defined with define-minor-mode?
>
> Likely because these minor modes were converted to use
> define-minor-mode, but not removed from minor-mode-list.
>
>> I also found that abbrev-mode remained in the list if it was removed
>> from this definition.
>
> define-minor-mode (conditionally) calls add-minor-mode, which does
>
>   (unless (memq toggle minor-mode-list)
>     (push toggle minor-mode-list))
>
> so minor modes defined with define-minor-mode will end in the list.
> For preloaded minor modes, that's already so:
>
>  emacs -Q --batch --eval "(princ (length minor-mode-list))"  => 30

Sorry, I didn't explain clearly. I found that abbrev-mode was the _only_
mode that could be removed from the definition and still end up in the
list. And my confusion arose from my inability to see what caused this
when all 5 of these modes are defined using define-minor-mode.

For example:

(Continue reading)

Chong Yidong | 1 Feb 2012 03:51
Picon

Re: Could distributed tarballs be compressed with xz instead of bzip2?

Ulrich Mueller <ulm <at> gentoo.org> writes:

> It would be considerably smaller (sizes are for "bzip2 -9" and "xz -6"
> which is the default):
>
>    51056640 emacs-24.0.92.tar.gz
>    41410560 emacs-24.0.92.tar.bz2
>    34443264 emacs-24.0.92.tar.xz
>
> Also xz can be uncompressed much faster:

I'll do that for Emacs 24.4.  Thanks for the suggestion.

Chong Yidong | 1 Feb 2012 03:51
Picon

Re: Could distributed tarballs be compressed with xz instead of bzip2?

Chong Yidong <cyd <at> gnu.org> writes:

> I'll do that for Emacs 24.4.  Thanks for the suggestion.

Whoops, I mean 24.1.

Chong Yidong | 1 Feb 2012 04:10
Picon

Re: AUCTeX Mode

Angelo Graziosi <angelo.graziosi <at> alice.it> writes:

> Hi guys...
>
> any news? which is the final decision?

We won't do it in Emacs 24.1 for sure, since we are well into pretest.

I have no major objection to including AUCTeX in future Emacs releases,
if the AUCTeX developers are amenable and willing to help do the
integration work (stuff like using define-derived-mode and
completion-at-point).

(Personally, I prefer using tex-mode.el because AUCTeX "feels" a bit too
heavyweight for me, but I can see how AUCTeX's features would be a draw
for most.)

Chong Yidong | 1 Feb 2012 04:14
Picon

Re: /etc/TODO: define-minor-mode & minor-mode-list

Juanma Barranquero <lekktu <at> gmail.com> writes:

> There are 300+ instances of "(defun .*-mode " in the sources. Not all
> are really modes, and many are major modes, but surely there are still
> unconverted minor modes.

Probably many of those major modes should use define-derived-mode and
inherit from text-mode/prog-mode/special-mode.

Juanma Barranquero | 1 Feb 2012 04:39
Picon
Gravatar

Re: /etc/TODO: define-minor-mode & minor-mode-list

On Wed, Feb 1, 2012 at 03:46, William Stevenson <yhvh2000 <at> gmail.com> wrote:

> Sorry, I didn't explain clearly. I found that abbrev-mode was the _only_
> mode that could be removed from the definition and still end up in the
> list. And my confusion arose from my inability to see what caused this
> when all 5 of these modes are defined using define-minor-mode.

These modes are all auto-loaded, but if you look at the definition of
define-minor-mode, you'll see that the part that invokes
add-minor-mode (and so, sets minor-mode-list) is not autoloaded (it's
after :autoload-end). So these modes do not enter into minor-mode-list
until they are run. I haven't checked, but I suspect that abbrev-mode
is run at some point during initialization and so it does enter the
list.

    Juanma

Harald Hanche-Olsen | 1 Feb 2012 10:31
Picon
Picon
Favicon
Gravatar

Re: Could distributed tarballs be compressed with xz instead of bzip2?

[Chong Yidong <cyd <at> gnu.org> (2012-02-01 02:51:09 UTC)]

> Ulrich Mueller <ulm <at> gentoo.org> writes:
> 
> > Also xz can be uncompressed much faster:
> 
> I'll do that for Emacs 24.4.  Thanks for the suggestion.

On the other hand, a cursory glance at the xz manual page indicates
that xz may have rather extreme memory requirements: Several gigabytes
in some cases! Is that something to worry about?

- Harald

Harald Hanche-Olsen | 1 Feb 2012 14:44
Picon
Picon
Favicon
Gravatar

Re: Could distributed tarballs be compressed with xz instead of bzip2?

[Harald Hanche-Olsen <hanche <at> math.ntnu.no> (2012-02-01 09:31:13 UTC)]

> On the other hand, a cursory glance at the xz manual page indicates
> that xz may have rather extreme memory requirements: Several gigabytes
> in some cases! Is that something to worry about?

I looked a bit more carefully, and it seems there is little reason to
worry, at least if compression is done with the default setting (-6).
Even with compression level at -9, the memory requirement for
decompression is only 65 MiB, which is not a problem on modern
computers (though I think many emacs users are still on quite old
hardware). I guess the extreme memory requirements come from unusual
combinations of the many flags affecting the detailed operations of
the compression algorithm, and should be of little concern for regular
use.

- Harald


Gmane