GNU bug report logs - #12215
CSET is unnecessarily confusing

Previous Next

Package: emacs;

Reported by: Paul Eggert <eggert <at> cs.ucla.edu>

Date: Fri, 17 Aug 2012 00:14:01 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Antipov <dmantipov <at> yandex.ru>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 12215 <at> debbugs.gnu.org
Subject: bug#12215: CSET is unnecessarily confusing
Date: Fri, 17 Aug 2012 08:12:07 +0400
On 08/17/2012 04:04 AM, Paul Eggert wrote:
> Recent changes to Emacs have introduced code like the following:
>
>     CSET (XCHAR_TABLE (char_table), parent, parent);
>
> This is unnecessarily confusing.  Those two 'parent' expressions
> refer to different things; the first 'parent' is not really a C
> expression at all.  I recall that Stefan also expressed unease about
> CSET's not acting like a function, in this respect.
>
> It's easy to change lisp.h so that the same code can be
> written as follows, which is shorter and clearer:
>
>    char_table_set_parent (char_table, parent);
>
> The main objection to changing lisp.h, if I recall correctly, is that
> it will make lisp.h longer, since lisp.h will need a separate setter
> function for each field.  But that's not much of a problem since
> these functions are really simple.  And the advantage of readability
> in users of the code makes the .h change worthwhile.
>
> Here's a patch to make this change for CSET.  I'd like to install this,
> along with similar patches for the other non-function ?SET macros defined
> recently.

OK

Dmitry






This bug report was last modified 12 years and 329 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.