[implementations-list] style; VCS

Štěpán Němec stepnem at gmail.com
Thu Mar 18 20:09:50 CET 2010


Hello Vegard,
some oh-so-helpful remarks from me again!

1.
(defvar vimpulse-state-vars-alist
  '((vi-state
     . ((id . viper-vi-state-id)
        (basic-mode . viper-vi-basic-minor-mode)
        (basic-map . viper-vi-basic-map)
[...]


In lisp,

'(<object> . <list>) is the same as '(<object> <list>) (with an
exception of <list> being `nil' of course, if you want to be really
anal), so you don't need some of those dots in there.


2.
;; Viper's definition lacks an indentation specification
(defmacro viper-deflocalvar
  (var default-value &optional documentation)
  "Define VAR as a buffer-local variable.
DEFAULT-VALUE is the default value and DOCUMENTATION is the
docstring. The variable becomes buffer-local whenever set."
  (declare (indent defun))
  `(progn
     (defvar ,var ,default-value
       ,(format "%s\n\(buffer local\)" documentation))
     (make-variable-buffer-local ',var)))


You don't need to redefine the whole function/macro only to add a
docstring or indent spec.
You can use the `function-documentation' and `lisp-indent-function'
symbol properties for that, i.e.

(put 'viper-deflocalvar 'function-documentation
  "Define VAR as a buffer-local variable.
DEFAULT-VALUE is the default value and DOCUMENTATION is the
docstring. The variable becomes buffer-local whenever set.")

(put 'viper-deflocalvar 'lisp-indent-function 'defun)

But actually, wouldn't it make more sense to send a patch for inclusion
in Emacs core? Viper could definitely use some affection (btw you
didn't reply to my related question in the last mail).


Also, have you thought about moving Vimpulse to some usable VCS like
Git? It would be soooo much more convenient to even just track the
development, not mentioning possible contributions from others.


Best wishes,

    Štěpán



More information about the implementations-list mailing list