0

I'm trying emacs to create a simple .rst mode. I tyoe M-x rst-mode then I wrote a simple code then type

M-x compile (proposed 'make -k') I obtain this message and it doesn't compile -- mode: compilation; default-directory: "~/" -- Compilation started at Mon Aug 1 17:46:51

make -k

/bin/sh: sphinx-build: command not found make: *** [help] Error 127

Compilation exited abnormally with code 2 at Mon Aug 1 17:46:51

what does it mean?

Thank you

Renato

RenatoP
  • 121
  • 4
  • It means you need to install the program `make`. What system are you on? – NickD Aug 01 '22 at 16:00
  • aaaah..I 'm on mac osx 14.5 what I've to do? – RenatoP Aug 01 '22 at 16:26
  • ... except you only need to install `make` because that's what Emacs was expecting you to want to run (the default option) when you executed `M-x compile`. In other words, to be clear, you do *not* need to install `make` (unless you have some other reason). – Phil Hudson Aug 01 '22 at 16:45
  • Emacs does not know how to "compile" a `.rst` file; you need to either configure it (by setting variable `compile-command`) or type in the command you want executed. – Phil Hudson Aug 01 '22 at 16:48
  • ok. emacs don't know 'compile'. what I have to do to install it? – RenatoP Aug 01 '22 at 17:01
  • @PhilHudson: `make -k` calls `sphinx-build` (come to think of it, not sure how if `make` is not installed) which uses `make`. The shortest method from here to there is to install `make`. The OP is a noob (see his other question about how to learn emacs), so the generality of the compile mechanism does not help in this case. OTOH, if you can suggest how he can install `make` on MacOSX, that *should* help. – NickD Aug 01 '22 at 17:13
  • so, what can I made?\ I have understund I do not have make installed. I need to install Sphinx anyway? – RenatoP Aug 01 '22 at 19:07
  • I don't know how to install packages on MacOSX but yes, you will need to install Sphinx (as I suggested in another question of yours). It should be the case that `make` is already installed: what happens if you type `make` on the command line in a terminal? If it is not installed, you will have to instaill it too. That has *nothing* to do with Emacs however: you are probably better off asking in a MacOSX forum. – NickD Aug 01 '22 at 19:26
  • The version of `make` that comes installed on a Mac will be the BSD one, which has different flags/switches from the Gnu one, so `-k` may not exist or may mean something else. See `man make`. But again, unless you *know* you need `make`, you don't. – Phil Hudson Aug 01 '22 at 19:29
  • It seems that `rst-mode` provides a command `rst-compile`. So I would suggest to first try that command (`M-x rst-compile`), and see what 'it tells you'. Additionally, `rst-mode` provides a variable `rst-compile-toolsets`, you can check out its docstring (`C-h v`) to find what commands/python libraries it expects to be available for certain tasks. If necessary, you can customize it via `M-x customize-variable`. – dalanicolai Aug 02 '22 at 05:13
  • -*- mode: compilation; default-directory: "~/sphinx/" -*- Compilation started at Tue Aug 2 11:14:24 rst2html README.rst README.html zsh:1: command not found: rst2html Compilation exited abnormally with code 127 at Tue Aug 2 11:14:24 Do this mean I don't have rst2html installed or installed on the correct path? – RenatoP Aug 02 '22 at 09:16

2 Answers2

0

finaly...it works! 1 - installed Docutil (https://docutils.sourceforge.io/README.html#gnu-linux-bsds-unix-mac-os-x-etc) 2 - M-x rst-compile obtain this messageCompile command: rst2html.py README.rst README.html press return and...

-*- mode: compilation; default-directory: "~/sphinx/" -*-
Compilation started at Tue Aug  2 11:38:56

rst2html.py   README.rst README.html

Compilation finished at Tue Aug  2 11:38:56

and now...obtaining a .pdf! (is it possible to obtain .pdf from inside emacs? How?)

RenatoP
  • 121
  • 4
0

SOLVED! (quite solved) I've finaly produced my pdf on emacs (C-c C-c C-p), but using linux. Finaly I've understand that the prob was not emacs, but it is python and utility of python!. So I've made my issue on another s.o. (Manjaro quite of Arch linux). here, a start from beginning and step by step...all goes well.

Thank you

RenatoP
  • 121
  • 4