aboutsummaryrefslogtreecommitdiffstats
path: root/oni-php
diff options
context:
space:
mode:
authorGravatar Tom Willemse2026-02-09 12:10:10 -0800
committerGravatar Tom Willemse2026-02-09 12:10:10 -0800
commit4507f247da15230c8aa653dad8d0349523a29fee (patch)
treed15dc7eb10e18c1994db0a69fecfc04f8222e5d4 /oni-php
parent8e88ad44c2f3b7efca4ef25e1cb889a8834a8569 (diff)
downloademacs-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/namespace6
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