emacs-devel
[Top][All Lists]
Advanced

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

Re: visual-line-mode and line wrapping


From: MON KEY
Subject: Re: visual-line-mode and line wrapping
Date: Mon, 24 May 2010 22:52:21 -0400

> You're preaching to the choir here (why do you think we have an "80
> columns max" limit on C and Elisp code?).

This limit has really been on my mind lately. FTMP I agree with the
rationale, its benefits, and am (in general) a strong advocate.

However, something I find really disconcerting (and biased) is that
there is a fundamental difference between (E)lisp code and C code, and
the 80 col limit is far more C centric. Moreover, the convention is
not particularly friendly to code that employs features from the CL
package. Likewise, in the absence of _real_ namespacing third party
fncns must extend by at least two extra tokens for each def* in order
not to step on Emacs' core fncns. In the aggregate these factors can
make it particularly difficult for third party code to meet with the
80 col rule. Following are examples of moderately sized lambda lists
(with IMHO unreasonably truncated arg names):

A conventional Elisp fncn from Emacs' lisp/* directory:

(defun elisp-fun (arg1 arg2 &optional arg3 &rest arg4)
^^^^^!^^^^^^^^^!^^^^^!^^^^!^^^^^^^^^^^^^^!^^^^^^^^^^^!
     5        15    21   26             41          53

Same Elisp fncn from Emacs' lisp/* directory with CL features:

(defun* elisp-fun (arg1 arg2 &optional (arg3 arg3-dflt) &rest arg4)
^^^^^^!^^^^^^^^^!^^^^^!^^^^!^^^^^^^^^^^^^^^!^^^^^^^^^^!^^^^^^^^^^^!
      6        16    22   27              44         54          66

Same(ish) but w/ CL packages keywords feature:
(defun* elisp-fun (arg1 arg2 &rest arg4 &key arg3 arg3-alt)
^^^^^^!^^^^^^^^^!^^^^^!^^^^!^^^^^^^^^^!^^^^^^^^^!^^^^^^^^^!
      6        16    22   27         38        47        58

User function with four token textual namespace:
(defun usr-elisp-fun (arg1 arg2 &optional arg3 &rest arg4)
^^^^^!^^^^^^^^^^^^^!^^^^^!^^^^!^^^^^^^^^^^^^^!^^^^^^^^^^^!
     5            15    25   30             45          57

It would be an interesting exercise to do a count of the number of defun,
defsubst,, defmacro forms in lisp/* which have their parameter
list split over two or more lines to accommodate the 80 limit.

--
/s_P\



reply via email to

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