ada-mode-users
[Top][All Lists]
Advanced

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

Re: [Ada-mode-users] Ada-mode unconditionally sets comment-padding


From: Stephen Leake
Subject: Re: [Ada-mode-users] Ada-mode unconditionally sets comment-padding
Date: Fri, 30 Sep 2016 11:43:57 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (windows-nt)

SCHOEPFLIN Markus <address@hidden> writes:

> Ada-mode currently contains the following code:
>
>   ;; AdaCore standard style (enforced by -gnaty) requires two spaces
>   ;; after '--' in comments; this makes it easier to distinguish
>   ;; special comments that have something else after '--'
>   (set (make-local-variable 'comment-padding) "  ")
>
> This unconditionally overwrites commend-padding, despite the variable
> being explicitly documented as customizable. In my case this breaks a
> number of elisp functions defined locally for dealing with comments.

I gather you don't follow the AdaCore convention for comments.

It might be straightforward to modify your functions to deal with a
variable number of spaces after the comment chars. But that depends a
lot on what they do.

> Could this please be replaced with something that checks if the
> variable has been customized before? 

I guess that means checking if it is different than the default value.
Unless there is some 'custom-modified-p' function? (Help appropos
"custom.*modif" only returns custom-modified-face).

> Or even better, don't overwrite it in the first place? Anybody wanting
> to follow AdaCore standards can still customize it to two spaces
> manually.

That might have been better in the first place, but it's not
backward-compatible now.

You can set comment-padding in ada-mode-hook (which is run after the
above code):

(add-hook 'ada-mode-hook
    (lambda () (setq comment-padding " ")))

or whatever you want it set to.

Is that sufficient?

-- 
-- Stephe



reply via email to

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