Wywołuję git, uzyskuję katalog polecenia (zgodnie z Is there a way to get the git root directory in one command? ).Jak usunąć nowy wiersz z wyjścia procesowego?
(let ((tmpbuffer (get-buffer-create (make-temp-name "git"))))
(call-process "git" nil tmpbuffer nil "rev-parse" "--show-toplevel")
(with-current-buffer tmpbuffer
(with-output-to-string
(princ (buffer-string))
(kill-buffer))))
Ale jest zwracany ciąg znaków nowej linii. Nie jestem pewien, jak się tego pozbyć.
To nie tylko usuwa znaki nowej linii na końcu wydruku. Dodałem alternatywną odpowiedź. –