From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Code cleanup. Date: Mon, 23 Oct 2006 13:55:19 +0200 Message-ID: <85y7r7l00o.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1161604612 18282 80.91.229.2 (23 Oct 2006 11:56:52 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 23 Oct 2006 11:56:52 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 23 13:56:52 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GbyQ2-0004XK-Rk for ged-emacs-devel@m.gmane.org; Mon, 23 Oct 2006 13:56:39 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GbyQ2-0001gf-21 for ged-emacs-devel@m.gmane.org; Mon, 23 Oct 2006 07:56:38 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GbyPo-0001ds-5a for emacs-devel@gnu.org; Mon, 23 Oct 2006 07:56:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GbyPm-0001bQ-VH for emacs-devel@gnu.org; Mon, 23 Oct 2006 07:56:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GbyPm-0001aq-LW for emacs-devel@gnu.org; Mon, 23 Oct 2006 07:56:22 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GbyPm-00043l-7L for emacs-devel@gnu.org; Mon, 23 Oct 2006 07:56:22 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1GbyPk-0005KJ-4P for emacs-devel@gnu.org; Mon, 23 Oct 2006 07:56:21 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id C026A1CD3543; Mon, 23 Oct 2006 13:55:19 +0200 (CEST) Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:61039 Archived-At: --=-=-= Hi, in the course of checking the code for call-interactively (I have a tendency to read code rather than the documentation), I felt a bit like coming upon an obfuscated C contest. I attach a patch (untested though) that does nothing except hopefully get a more readable code. Ok, so we are in freeze anyway, so tampering with any code that works by replacing it with code designed to be completely equivalent is probably not worth the potential trouble. At what stage of development (if at all) should such janitorial changes be usually applied? And are there others that would agree with my assessment concerning the readability here, or that would have even better ideas how this would be expressed more obvious? On a completely different tangent: wouldn't it be much more readable (though likely not completely correct in some perverse manner) if diff-mode actually had its TAB positions in column 9,17,25... instead of the customary 8,16,24...? At least in context and unified diffs, that would _much_ better reflect the relative indentation of the actual change than the current behavior. It does not look like `tab-width' can be made to do that, but maybe one could use a display property in order to move the information of column 0 into the fringe. But it would probably be saner if tab-width were extended to allow, say, a cons-cell of initial offset and tab-width. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum --=-=-= Content-Type: text/x-patch Content-Disposition: attachment *** callint.c 19 Oct 2006 21:07:18 +0200 1.148 --- callint.c 23 Oct 2006 13:30:50 +0200 *************** *** 473,488 **** /* Count the number of arguments the interactive spec would have us give to the function. */ tem = string; ! for (j = 0; *tem; j++) { /* 'r' specifications ("point and mark as 2 numeric args") produce *two* arguments. */ ! if (*tem == 'r') j++; tem = (unsigned char *) index (tem, '\n'); if (tem) ! tem++; else ! tem = (unsigned char *) ""; } count = j; --- 473,491 ---- /* Count the number of arguments the interactive spec would have us give to the function. */ tem = string; ! for (j = 0; *tem;) { /* 'r' specifications ("point and mark as 2 numeric args") produce *two* arguments. */ ! if (*tem == 'r') ! j += 2; ! else ! j++; tem = (unsigned char *) index (tem, '\n'); if (tem) ! ++tem; else ! break; } count = j; --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--