all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Code cleanup.
@ 2006-10-23 11:55 David Kastrup
  2006-10-23 16:50 ` Kim F. Storm
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: David Kastrup @ 2006-10-23 11:55 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 1437 bytes --]


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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1013 bytes --]

*** 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;
  

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-10-25 19:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-23 11:55 Code cleanup David Kastrup
2006-10-23 16:50 ` Kim F. Storm
2006-10-23 17:29   ` David Kastrup
2006-10-23 18:03     ` David Kastrup
2006-10-23 19:35 ` Stefan Monnier
2006-10-25 18:03 ` Richard Stallman
2006-10-25 19:01   ` David Kastrup

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.