Sometimes I would like to include a version number in a package name, for example: "FOO.BAR-2.1". This isn't handled well by auto-abbreviated-package-name when *auto-abbreviate-dotted-packages* is true.
Would it be a good idea to add some heuristic to handle this better?
E.g., reject a short string consisting of only digits:
(when *auto-abbreviate-dotted-packages* (let ((last-dot (position #. (package-name package) :from-end t))) (when last-dot (let ((string (subseq (package-name package) (1+ last-dot)))) (when (or (> (length string) 2) (some (complement #'digit-char-p) string)) string)))))
or exclude the last few charcters in the search for a period:
(when *auto-abbreviate-dotted-packages* (let* ((name (package-name package)) (length (length name)) (last-dot (position #. name :from-end t :end (- length 2)))) (when last-dot (subseq (package-name package) (1+ last-dot)))))