emacs-devel
[Top][All Lists]
Advanced

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

Re: getting the same indentation as flet


From: Nic Ferrier
Subject: Re: getting the same indentation as flet
Date: Mon, 03 Jun 2013 10:01:08 +0100

Stefan Monnier <address@hidden> writes:

>> That isn't the flet specification. It may be the cl-flet specification
>> but the flet specification I have is:
>
>>  (lisp-indent-function 1 edebug-form-spec cl-flet 
>>     byte-obsolete-info ("use either `cl-flet' or `cl-letf'." nil "24.3") 
>>     common-lisp-indent-function 
>>      ((&whole 4 &rest (&whole 1 &lambda &body)) &body))
>
> "lisp-indent-function 1" is the part that affects Elisp indentation.
>
>> I  guess that's because I've configured common-lisp indent functionality
>> but I  think the elisp one is similarly good.
>
> "common-lisp-indent-function ((&whole 4 &rest (&whole 1 &lambda &body)) 
> &body)"
> is the part that affects cl-indent, IIUC, indeed.
>
>> cl-flet has no identation. That's just another reason that cl-flet is
>> not very good.
>
> Patches welcome,

I doubt you'd accept a patch to make cl-flet back into something that is
dynamically bound (which is what I care about with cl-flet).

But here's the trivial patch for the cl-flet indentation:

diff -c -L 
/home/nferrier/emacs-local-20130401/share/emacs/24.3/lisp/emacs-lisp/cl-macs.el.gz.\~1\~
 -L 
/home/nferrier/emacs-local-20130401/share/emacs/24.3/lisp/emacs-lisp/cl-macs.el.gz
 /tmp/jka-com8047btu /tmp/jka-com8047aBE
*** 
/home/nferrier/emacs-local-20130401/share/emacs/24.3/lisp/emacs-lisp/cl-macs.el.gz.~1~
--- 
/home/nferrier/emacs-local-20130401/share/emacs/24.3/lisp/emacs-lisp/cl-macs.el.gz
***************
*** 1657,1663 ****
  Like `cl-labels' but the definitions are not recursive.
  
  \(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
!   (declare (indent 1) (debug ((&rest (cl-defun)) cl-declarations body)))
    (let ((binds ()) (newenv macroexpand-all-environment))
      (dolist (binding bindings)
        (let ((var (make-symbol (format "--cl-%s--" (car binding)))))
--- 1657,1664 ----
  Like `cl-labels' but the definitions are not recursive.
  
  \(fn ((FUNC ARGLIST BODY...) ...) FORM...)"
!   (declare (indent ((&whole 4 &rest (&whole 1 &lambda &body)) &body))
!            (debug ((&rest (cl-defun)) cl-declarations body)))
    (let ((binds ()) (newenv macroexpand-all-environment))
      (dolist (binding bindings)
        (let ((var (make-symbol (format "--cl-%s--" (car binding)))))

Diff finished.  Mon Jun  3 09:58:56 2013



reply via email to

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