emacscollective / epkg

Browse the Emacsmirror package database
https://emacsmirror.net/manual/epkg
GNU General Public License v3.0
55 stars 7 forks source link

epkg-read-package: Improve default guessing #29

Closed stepnem closed 4 years ago

stepnem commented 4 years ago

Often (e.g., Elisp comments, Magit submodule lists), 'symbol-at-point' returns a path or URL. Chop off the part before last slash and after any dot in the remaining part (the extension). (Package names containing slashes or dots don't seem to occur, so this is safe.)

The trimming order is important, so 'string-trim' doesn't fit the bill (and wouldn't save any funcalls, either).

tarsius commented 4 years ago

Thanks!