diff options
| author | 2026-02-09 12:10:10 -0800 | |
|---|---|---|
| committer | 2026-02-09 12:10:10 -0800 | |
| commit | 4507f247da15230c8aa653dad8d0349523a29fee (patch) | |
| tree | d15dc7eb10e18c1994db0a69fecfc04f8222e5d4 /oni-php | |
| parent | 8e88ad44c2f3b7efca4ef25e1cb889a8834a8569 (diff) | |
| download | emacs-config-4507f247da15230c8aa653dad8d0349523a29fee.tar.gz emacs-config-4507f247da15230c8aa653dad8d0349523a29fee.zip | |
oni-php/snippets/namespace: Don't capitalize already capitalized
If a part of the directory tree is already capitalized a certain way, don't
capitalize it.
Diffstat (limited to 'oni-php')
| -rw-r--r-- | oni-php/snippets/php-mode/namespace | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/oni-php/snippets/php-mode/namespace b/oni-php/snippets/php-mode/namespace index a63d713..01abd02 100644 --- a/oni-php/snippets/php-mode/namespace +++ b/oni-php/snippets/php-mode/namespace @@ -2,4 +2,8 @@ # name: namespace # key: ns # -- -namespace ${1:`(string-join (mapcar #'capitalize (cdr (split-string (directory-file-name (file-name-directory (file-relative-name buffer-file-name (project-root (project-current))))) "/"))) "\\")`};
\ No newline at end of file +namespace ${1:`(string-join + (mapcar + (lambda (s) (let ((case-fold-search nil)) (if (string-match-p (rx upper-case) s) s (capitalize s)))) + (cdr (split-string (directory-file-name (file-name-directory (file-relative-name buffer-file-name (project-root (project-current))))) "/"))) + "\\")`};
\ No newline at end of file |
