From 38fb7fa17af80c099e6f2fbafb39e29ceb37b5bb Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Sun, 5 Dec 2021 16:39:07 +0100 Subject: [PATCH] Improve the Emacs server section --- README.org | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/README.org b/README.org index 0748db0..c430aed 100644 --- a/README.org +++ b/README.org @@ -332,7 +332,10 @@ Facilitate installlation of the optional packages. (my-install-packages my-optional-packages)) #+end_src -* [[info:emacs#Emacs Server][Emacs Server (info)]] +* [[info:emacs#Emacs Server][Using Emacs as a server (info)]] +:PROPERTIES: +:CUSTOM_ID: sec:using-emacs-server +:END: Emacs can act as a server that listens to a socket to share its state (for instance buffers and command history) with other programs by means of a shell @@ -345,16 +348,21 @@ command =emacsclient=. (add-hook 'after-init-hook #'server-start))) #+end_src -** LaTeX compile-display-loop +The next two configuration blocks show how to use ~emacsclient~ to: +1. Install an asynchronous (or background) loop of saving a LaTeX file, + compiling it, and redisplaying the output in Emacs. +2. Make [[https://qutebrowser.org][qutebrowser]] send html links with document titles to Emacs. + +** LaTeX save-compile-display loop :PROPERTIES: -:CUSTOM_ID: sec:latex-compile-display-loop +:CUSTOM_ID: sec:latex-save-compile-display-loop :END: The =latexmk= resource file in the next source code block shows how to use =emacsclient= to (re)display the PDF file in Emacs after each succesful (re)compilation on condition that the settings of the ~compile-command~ local variable in section are compatible. The local variable ~compile-command~ in the -[[#sec:local-variables][Local Variables]] section (only visible in =org= files, but not in =html= and +[[#sec:local-variables][local variables]] section (only visible in =org= files, but not in =html= and =pdf= files) shows how to use the =latexmkrc= file.. #+attr_latex: :options bgcolor=LightGoldenrodYellow @@ -379,6 +387,9 @@ variable in section are compatible. The local variable ~compile-command~ in the #+end_src ** [[https://qutebrowser.org/doc/userscripts.html][Qutebrowser userscript]] +:PROPERTIES: +:CUSTOM_ID: sec:qutebrowser-userscript +:END: The next block contains an userscript that sends a [[info:org#The store-link protocol][store-link org-protocol]] message with the url and the title from [[https://qutebrowser.org][qutebrowser]] to =emacsclient=. The