[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] emacs-25 b6d6304: Comment on last change to define-der

From: Oleh Krehel
Subject: Re: [Emacs-diffs] emacs-25 b6d6304: Comment on last change to define-derived-mode
Date: Mon, 07 Mar 2016 09:48:25 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

John Wiegley <address@hidden> writes:

>> Adding meta-data is an innocuous operation, just like adding documentation
>> where there was none before.
> Wouldn't it change the way old code might get re-indented?  In other words,
> was this a no-op addition of metadata, or did it have aesthetic impact on the
> way code gets indented?

A bit from column A, a bit from column B. I think it's a flaw in the
current `indent' metadata design that the absence of metadata is itself
metadata. Since it makes it impossible to distinguish whether the
absence of metadata is intentional or an oversight.

You can grep the core for "(define-derived-mode " and see the possible
effect for yourself. Here's a summary: out of 301 grep hits in *.el
files, 19 instances don't follow the (indent 3) rule - all the others

    (define-derived-mode bookmark-edit-annotation-mode
    (define-derived-mode diary-fancy-display-mode special-mode
    (define-derived-mode semantic-grammar-mode
    (define-derived-mode electric-buffer-menu-mode Buffer-menu-mode
    (define-derived-mode reb-lisp-mode
    (define-derived-mode smime-mode fundamental-mode
    (define-derived-mode image-dired-thumbnail-mode
    (define-derived-mode image-dired-display-image-mode
    (define-derived-mode network-connection-mode
    (define-derived-mode newsticker-mode fundamental-mode
    (define-derived-mode newsticker-treeview-list-mode newsticker-treeview-mode
    (define-derived-mode newsticker-treeview-item-mode newsticker-treeview-mode
    (define-derived-mode ebrowse-electric-list-mode
    (define-derived-mode ebrowse-electric-position-mode
    (define-derived-mode elisp-byte-code-mode emacs-lisp-mode
    (define-derived-mode pages-directory-address-mode pages-directory-mode
    (define-derived-mode thumbs-mode
    (define-derived-mode thumbs-view-image-mode
    (define-derived-mode vc-git-region-history-mode

So I've added an indentation hint that 94% of the code already follows,
while 6% doesn't. It's up to you as the maintainer to decide if we want
to have a 94/6 split just to not ruffle any feathers. Or we want to
enforce a rule to make all code uniform - easier to read and contribute

Personally I find it annoying tripping over things and trying to
preserve the ancient indentation when contributing to the Emacs core.
This could be a non-issue in the future.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]