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).
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).