clojure-emacs / clojure-emacs/clojure-mode

Defining indentation specs for multi-arity functions

Aperta
#501 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Emacs Lisp
Stelle
1k
Fork
249
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I have a function (function, not macro. But I don't think it matters) with the following signatures:

```
[request payoff right-body]
[request response-data payoff right-body]
[request response-data includes payoff & right-body]
```

The correct indentation for these would be to indent right-body as a 'body' parameter.

Given that the position of right-body in the arglist varies, one cannot use a fixed number for `(put-clojure-indent ...)`.

Is this a known problem?

Intuitively, I'd want to express indentation as `(put-clojure-indent 'my-fn :last)`, :last being the thing to implement.

(By the way I don't like the original function to begin with, but I shouldn't refactor other people's code just because I can't indent it)

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia dal punto di ingresso `(put-clojure-indent ...)` e verifica come vengono interpretate le specifiche di indentazione. Esplora come una specifica `:last` potrebbe gestire la posizione variabile di `right-body`, quindi convalida il comportamento rispetto ai tre esempi con più arità nell’issue.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
emacs, emacs-lisp
Ambito
tooling
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.