To get an absolute file path without extension in the buffer, for example. /home/alice/hello.cpp→ /home/alice/hello, the following code works
(concat (file-name-directory (buffer-file-name)) (file-name-base (buffer-file-name)))
But he looks too verbose. Is there an elegant way or direct function for this?
source
share