Recent Questions - Emacs Stack Exchange most recent 30 from 2019-04-20T08:42:18Z 0 Check if a character is in a string gavenkoa 2019-04-19T23:17:33Z 2019-04-20T01:02:18Z <p>It is easy to present list of allowed characters as string, like <code>" \n\t"</code>.</p> <p><code>(char-before)</code> return integer.</p> <p>How can I check that a character is in a string?</p> <p>There is <a href="">What is the easiest way to check if a character belongs to a particular set of characters?</a> where <code>(memq ch (list ?a ?b))</code> is suggested.</p> <p>I think that string is constant and don't need to be evaluated in comparison to <code>(list ?a ?b)</code>.</p> <p>I wrote <code>(seq-some (lambda (el) (eq el 32)) "a b")</code> but it also is too high level.</p> <p>It is possible to convert a character to string: <code>(string-match "[a b]" (char-to-string 32))</code>.</p> <p>If string is a sequence there is probably a function that detects element in a sequence... <code>(member 32 "a b")</code> doesn't work...</p> 0 Tangling latex code Pr-San 2019-04-19T23:04:23Z 2019-04-19T23:04:23Z <p>I am migrating to org-mode to keep track of my research. My org-file contains scheduling information, questions that I am thinking of. In the past, I spun off completed material into papers (written in latex, but in a different file). </p> <p>I would now like to see if I can use the same org file to also keep the text of the papers I am writing. An example org file would be:</p> <pre><code>#+begin_src latex :tangle paper.tex \documentclass[11pt]{article} \usepackage{./mylayoutfile} \input ./myspecialpreamble \title{To be determined } \author{Frankenstein} +end_src * DONE email collaborator about new idea #+begin_src latex :tangle paper.tex Introduction to evil theorem idea. Blah blah blah. #+end_src * ASSIGNED literature survey (ask grad student) #+begin_src latex :tangle paper.tex \paragraph{Prior work} ..asdf #+end_src * DONE prove theorem 1 #+begin_src latex :tangle paper.tex \begin{theorem} 1+1 = 11 \end{theorem} #+end_src * Verify results #+begin_src python :tangle return(11) #+end_src * TODO take over the world. </code></pre> <p>What I want is the following. I want to export just the source code of latex into a new file paper.tex. When I run org-babel-tangle, I get the message "Tangled 0 code blocks from" and no output. What am I missing? </p> <p>PS: I know org-mode can help with the latex preamble, exporting the entire org file etc etc, but I do not want to do all that---I am pretty good at latex, and I prefer to type in latex within the begin_src fragments. All I want is to export the latex code contained in the #+begin_src latex #end_src blocks as paper.tex, and export the python code into a separate file </p> 0 How can I get superscripts at the beginning of a line in org-mode? lindes 2019-04-19T20:00:22Z 2019-04-19T20:00:22Z <p>I'm writing a document (in <a href="" rel="nofollow noreferrer">org-mode</a>) that quotes another document, including its footnotes. As such, I'd like to have a line like:</p> <pre><code>#+BEGIN_QUOTE ^123 The contents of footnote 123 go here. #+END_QUOTE </code></pre> <p>And have that render as something like:</p> <blockquote> <p>¹²³ The contents of footnote 123 go here.</p> </blockquote> <p>But what I'm actually getting is:</p> <blockquote> <p>^123 The contents of footnote 123 go here.</p> </blockquote> <p>I've tried using braces around the numbers, which just gets me this:</p> <blockquote> <p>^{123} The contents of footnote 123 go here.</p> </blockquote> <p>And that's true even if I also set this option at the top of my file:</p> <p><code>#+OPTIONS: ^:{}</code></p> <p>If I put something before the superscript, it sort of works – e.g., entering:</p> <p><code>.^123 The contents of footnote 123 go here.</code></p> <p>... renders (within Emacs, assuming <code>org-toggle-pretty-entities</code> (<kbd>C-C C-X \</kbd>) is enabled) as:</p> <blockquote> <p>.¹²³ The contents of footnote 123 go here.</p> </blockquote> <p>Or, in HTML export, gives:</p> <p><code>.&lt;sup&gt;123&lt;/sup&gt; The contents of footnote 123 go here.</code></p> <p>which renders similarly (though <a href="">not identically</a>) to the above, as:</p> <blockquote> <p>.<sup>123</sup> The contents of footnote 123 go here.</p> </blockquote> <p>But I don't want that <code>.</code> (or anything else obviously visible) to be there (I <em>might</em> be OK with some whitespace, but I'd prefer not), and I'm not sure what I could put there that would be invisible, yet cause the parsing engine to actually treat things as a superscript, and/or what to do to actually tell the parsing engine to parse superscript indicators that don't have anything before them at the beginning of the line.</p> <p>I've tried inserting some characters like <a href="" rel="nofollow noreferrer">U+00A0</a> (<kbd>C-x 8 RET</kbd><code>no-break space</code><kbd>RET</kbd>) – which works, but gives a visible space; <a href="" rel="nofollow noreferrer">U+2008</a> (<kbd>C-x 8 RET</kbd><code>zero width space</code><kbd>RET</kbd>) – which doesn't work; and a few other things, but none of the things I've tried so far both works to get a superscript, and leaves the output at the beginning of the line.</p> <p>As mentioned, I also tried setting the <code>^:{}</code> option, to no avail.</p> <p>Is there a way to tell org-mode to parse <code>^</code>, <em>even at the beginning of a line</em>, as a superscript indicator? Or at least something invisible I could put in front of the <code>^</code> that would cause it to render as superscript, while still visibly rendering as the beginning of the line?</p> 0 Is there regex match at point? gavenkoa 2019-04-19T19:54:55Z 2019-04-19T21:50:36Z <p>I want to match a certain string (not even a regex!) at point. <code>re-search-forward</code> skips characters after the point. </p> <p>With <code>char-after</code> it is possible to build a framework for matching a string at point. I hope there is an idiomatic way to match a string at point.</p> <p><strong>UPDATE</strong> alternatively I can <code>search-forward</code> and if:</p> <pre><code>old point - new point != string length </code></pre> <p>I miss match...</p> <p>Or set <code>bound</code> to string length:</p> <pre><code>(search-forward str (+ (point) (length str)) nil) </code></pre> <p>Pity that <code>search-forward</code> moves pointer...</p> 0 remove duplicate word one by one [duplicate] underflow 2019-04-19T19:23:25Z 2019-04-19T20:12:26Z <div class="question-status question-originals-of-duplicate"> <p>This question already has an answer here:</p> <ul> <li> <a href="/questions/42444/find-and-remove-consecutive-duplicated-words-while-ignoring-case" dir="ltr">Find and remove consecutive duplicated words while ignoring case</a> <span class="question-originals-answer-count"> 1 answer </span> </li> </ul> </div> <p>I'm looking for ways to detect duplicate, not case-sensitive words in a text/latex document. Google turns up this elisp-macro</p> <p><a href="" rel="nofollow noreferrer"></a></p> <p>which completely solves my problem. But it can only handle one duplicate word at a time; I would have to run it again to find the next one, etc.</p> <p>Question: Is it possible to modify this macro so that (1) it offers to delete the duplicate word, and (2) continue to find the next duplicate word until it is done? (like the built-in spell checker)</p> <p>I am absolutely zero experience in elisp programming; apologies if I asked a trivial question. I also realize that this exact same question was posted in</p> <p><a href=";s=4|19.8966">Find and remove consecutive duplicated words while ignoring case</a> </p> <p>EDIT: Indeed I do not know how to use the answer provided in the post linked above -- I am a regexp newbie. Any help/clarification is most appreciative.</p> 0 Line numbering: stick with linum or nlinum? [on hold] 9000 2019-04-19T17:19:07Z 2019-04-19T18:42:48Z <p>I see that both <code>linum</code> and <code>nlinum</code> are actively maintained: one is built-in, another recently had a release.</p> <p>With older Emacs version, <code>linum</code> used to be slow with a lot of folding in a buffer (e.g. in Org mode, and with <code>hs-minor-mode</code> in various source code modes). So I switched to <code>nlinum</code>.</p> <p>Currently (on Emacs 15 and 26) I see that <code>linum</code> is sort of fast again, though maybe not always as smooth as <code>nlinum</code>.</p> <p>Is there a reason why I should stick to one of them from <em>maintainability</em> POV? That is, does one of them obsolete, or is going to obsolete, another?</p> 0 Inline Code Annotations? Adam Thompson 2019-04-19T16:46:32Z 2019-04-19T16:46:32Z <p>I'd like to be able to add inline annotations to my code files that appear to me but do not actually change the file.</p> <p>I looked around for solutions but couldn't find anything besides <code>annotate.el</code> but it is very flakey on Spacemacs.</p> <p>Does anything more robust exist out there? Perhaps some way to display bookmarks inline?</p> 0 Is it possible to export R code within Latex code in an org-mode document? Daniel 2019-04-19T16:21:49Z 2019-04-19T16:21:49Z <p>I am trying to evaluate R code within LaTeX code in an org-mode document. The objective is to export the org-mode document to a <code>.tex</code> document and, ultimately, to a nice pdf document.</p> <p>My problem is that I cannot get the R code to be evaluated when it is placed within LaTeX code in the org-mode document. </p> <p>If you run my MWE below you will see what I mean, i.e., the pdf produced does not contain the values 4 and 3 in place of the R inline code that lives within the LaTeX code</p> <p>How could I possibly accomplish this feat?</p> <pre><code> # -*- find-file-hook: org-babel-execute-buffer -*- #+TITLE: My Minimal Working Example (MWE) #+AUTHOR: Daangui #+DATE: #+PROPERTY: header-args :tangle yes #+PROPERTY: header-args:R :session *R* Here I create some data in R: #+HEADER: :dir ~/temp #+begin_src R :exports code x &lt;- (1:10) #+end_src Now I try to show something nice in /LaTeX/: $100 \times \left( \frac{src_R{x[4]}}{src_R{x[3]}} - 1 \right) =$ src_R{100*(x[4]/x[3])-100} % increase! </code></pre> <p>I could add <code>[:exports results]</code> or <code>[:results latex]</code> as options to <code>src_R</code> and still, I would not get the results of evaluating <code>x[4]</code> and <code>x[3]</code>, i.e., the numbers 4 and 3.</p> 0 How do I set up all the fonts in my GUI Emacs klaus 2019-04-19T14:23:24Z 2019-04-19T16:49:18Z <p>I have the following in my <code>init.el</code>:</p> <pre><code>(add-to-list 'default-frame-alist '(font . "Monaco-10")) </code></pre> <p>The above does the job, but Emacs uses some other fonts when displaying headlines in org files or words enclosed in <code>‘’</code> quotes in Emacs info (<code>C-h i</code>). I would like to have a way to set up those fonts myself as well. Is there a way?</p> <p>Here is an image denoting the different fonts used for different parts. You can see that the fonts used for the headline and the fonts used for text between <code>‘’</code> quotes (denoted by pink highlight) are different than the default Monaco font used otherwise. It's pretty easy to see the differences, I hope. <a href="" rel="nofollow noreferrer"><img src="" alt="Emacs info page"></a></p> 0 How to pass noweb variables to latex blocks Wilder 2019-04-19T14:19:41Z 2019-04-19T14:19:41Z <p>I need to tangle a LaTeχ file from code blocks in an org file. How do I pass variables to the SRC block? </p> <p>In theory I should use <code>:var var1=value</code>, but is there any way to reference <code>var1</code> in the LaTeχ block? The tangled file does not set any variable (of sorts). Is passing variables to LaTeχ blocks even supported?</p> 0 Connecting to VMS VAX using FTP Prasanna 2019-04-19T13:57:59Z 2019-04-19T14:35:24Z <p>I have to connect to a VMS machine (legacy systems from 1960's) TELNET PORT23 at work. They are used in process control plants and are being upgraded to modern systems.<br> We have to access these systems to do code update / code check. </p> <p>I used the <code>ftp</code> command. It asked for the VMS host name and password. When I gave the VAX name, it rightly identified it with domain name. I provided the same and there are no responses on the screen. It is just blank. I don't know if it is expecting some sort of other input from me. </p> <p>There is another application that my employer uses currenntly, it is old and outdated and I want to emacs for the same. </p> 0 Transparent tangling and detangling? Toothrot 2019-04-19T12:20:12Z 2019-04-19T12:20:12Z <p>I'm working on a latex document which I tangle from org mode. With the header argument <code>:comments link</code>, I get a tex file that can be detangled back into the original org file (<code>org-babel-detangle</code>). But working on both files now looks like this:</p> <ul> <li>edit org file</li> <li>tangle</li> <li>revert tex-file buffer</li> <li>edit tex file</li> <li>detangle</li> <li>edit org file ..</li> </ul> <p>Could this be less cumbersome? Ideally, changing one of the buffers should immediately change the other.</p> <p>I saw there is a package called <em>lentic,</em> but I don't know if it can be used for this? The documentation was a bit difficult.</p> 1 Shortcut to put the selected region in an ordinary LaTeX environment (not with begin-end style) using auctex Name 2019-04-18T07:34:10Z 2019-04-19T16:45:25Z <p>In auctex if one has a selected region and then apply the command <code>c-c c-e</code> (LaTeX-environment) then by selecting an environment, the selected region will be folded between that environment.</p> <p>Is there a similar command to put a selected region between an ordinary command (not begin-end environments, but ordinary latex environment)? </p> <p>As a specific example assume that one would like to put the selected region between the braces in <code>\underline{}</code>. Is there a command which takes the name of the environment (in this case <code>unerline</code>) then put the selected region between the braces in <code>\underline{}</code>?</p> 6 How to blockquote text in one go Tankman六四 2019-04-15T02:54:21Z 2019-04-19T22:13:13Z <p>With this text:</p> <pre><code>Play with it a few times you will see my point. The command you need is: $ echo hello </code></pre> <p>How do I make it into:</p> <pre><code>&gt; Play with it a few times you will see my point. The &gt; command you need is: &gt; &gt; $ echo hello </code></pre> <p>Without using the complicated regular expression: <code>M-x replace-regexp</code> <kbd>RET</kbd> <code>^</code> <kbd>RET</kbd> <code>&gt;</code> <kbd>RET</kbd></p> <p>Note that I couldn't use <code>C-M-%</code> shortcut key to conjure <code>query-replace-regexp</code> since it's not possible to produce that key combination in a terminal.</p> 1 Cannot run a file-local after-save-hook with arguments HaoZeke 2019-04-08T03:14:04Z 2019-04-20T00:08:12Z <p>I have been trying to make auto-save compilation rules for my <code>org</code> files. I have tested the following functions in the interpreter:</p> <pre class="lang-lisp prettyprint-override"><code>(defun async-shell-command-no-window (command) (interactive) (let ((display-buffer-alist (list (cons "\\*Async Shell Command\\*.*" (cons #'display-buffer-no-window nil))))) (async-shell-command command))) (defun haozeke/org-pandoc-markdown (dir &amp;optional pargs) "A wrapper to generate yaml metadata markdown files. Takes the output directory followed by pandoc arguments" (if (not (file-exists-p dir)) (make-directory dir)) (async-shell-command-no-window (concat "pandoc -f org -t markdown -s " pargs " " (buffer-name) " -o " dir "/" (file-name-sans-extension (buffer-name)) ".md"))) (haozeke/org-pandoc-markdown "./") </code></pre> <p>Where the first function has been adapted from <a href="">this question</a>.</p> <p>The error I get is:</p> <pre class="lang-none prettyprint-override"><code>run-hooks: Wrong number of arguments: (lambda (dir &amp;optional pargs) "A wrapper to generate yaml metadata markdown files. Takes the output directory followed by pandoc arguments" (if (not (file-exists-p dir)) (make-directory dir)) (async-shell-command-no-window (concat "pandoc -f org -t markdown -s " pargs " " (buffer-name) " -o " dir ".md"))), 0 </code></pre> <p>The local variable setup I have is:</p> <pre><code># Local Variables: # after-save-hook: haozeke/org-pandoc-markdown "test" # End: </code></pre> 3 Is there an X11-free build of Emacs that can run on Wayland (not going through XWayland) Craig Hicks 2019-03-24T21:21:44Z 2019-04-19T18:28:53Z <p>I am running Wayland on Ubuntu 18.04.</p> <p>According to the <a href="" rel="nofollow noreferrer">Wayland FAX</a>, one of it's advantages, compared to X11, is that</p> <blockquote> Wayland allows better isolation between processes: one window cannot access resources from, or inject keystrokes into, another window. </blockquote> <p>That same Wayland document also <a href="" rel="nofollow noreferrer">says that</a></p> <blockquote> because Emacs is not a real GTK apps, it still talks with X11 and therefore will use XWayland </blockquote> <p>where <a href="" rel="nofollow noreferrer">XWayland is described as:</a></p> <blockquote> Note that any X program will still run, as there is a XWayland server that provides backwards compatibility with X program. Those programs will not, however, benefit from the security and performance improvements Wayland provides. </blockquote> <p>There is a <a href="" rel="nofollow noreferrer">2016 devlevel discussion thread</a> which considers removing X11 dependency from Emacs - notably a condition already achieved in Win23 and NS versions of Emacs. </p> <p>It's now 2019 and so my question is, as the title states:<br> <strong>Is there an X11-free build of Emacs that can run on Wayland (not going through XWayland)?</strong></p> <p>If the answer is no, I do have another question which is probably off topic for this list:<br> <strong>Why can't Wayland just intercept all X11 calls in XWayland and convert them into proper Wayland calls?</strong></p> <hr> <p>Edit Background Info: Apparently Electron (which the editor Atom uses to interface with Linux) <a href="" rel="nofollow noreferrer">has some X-call dependencies</a> which require a setting <code>DISABLE_WAYLAND=1</code> causing it to run via XWayland when running on Wayland. Also <a href="" rel="nofollow noreferrer">see Arch docs on Wayland</a> which suggests setting <code>GDK_BACKEND=x11</code> for Electron. So it's by no means an Emacs only issue. </p> <hr> <p>Edit: Clarification (c.f. @phils very helpful and through provoking comments)</p> <p>Wayland does intercept X11-calls, and of course Wayland-calls. However, the Wayland documention suggests only the Wayland calls enjoy the security benefits that Wayland has to offer. </p> <p>As @phils and @wasamasa point out, <code>emacs-nox</code> makes no X-calls, so it should theoretically be able to run on a terminal-emulator (e.g. <em>terminology</em>, <em>termite</em>) which itself is using only Wayland protocol, and not X-protocol. </p> <p>Testing that on Ubuntu has turned out not to simple, as even with a Wayland desktop on 18.04 it seems to use XWayland as the default. So the dual Wayland/X compatible <em>terminology</em> terminal emulator runs in X mode by default. From <em>terminology</em>:</p> <pre><code>~$ echo $XDG_SESSION_TYPE x11 </code></pre> <hr> <p>FINISHED</p> <p>Emacs-nox runs well in Fedora 29 (personally ran it), and Fedora 29 doesn't support X at all. By default it seems to not share the system clipboard - the same as seen in emacs-nox on Ubuntu. But emacs-nox can be modified easily enough to work with @wasamasa' s <a href="">answer below</a> and custom emacs calls to external clipboard<a href="">here</a> and <a href="">here</a>. </p> 0 Adding speedbar support for a language major mode? Realraptor 2019-03-20T23:03:51Z 2019-04-20T02:01:05Z <p>It appears to me that go-mode and speedbar are not working together - the .go files do not appear in the file list.</p> <p><a href="" rel="nofollow noreferrer"></a> is a bug on go-mode which suggests that it isn't just me seeing this problem.</p> <p>What is required to change this?</p> 1 Org-mode ellipsis arrow is not using my defined encoding (utf-8) DerpKat 2019-03-11T17:50:49Z 2019-04-19T18:30:22Z <p>First, some info on my system/version:<br> Windows 10<br> Emacs 26.1<br> (I'm new to Emacs, so let me know if there is more information I should provide)</p> <p>This is what is happening:<br> <a href="" rel="nofollow noreferrer"><img src="" alt="character/symbol being displayed in what looks to be latin-1, when it should be utf-8"></a></p> <p>The image above shows that the UTF-8 arrow is being correctly displayed within quotes in the line that sets the variable for the org-ellipsis; however, the actual ellipsis that is being displayed (in cyan) looks to be Latin-1 (I think) instead of UTF-8.</p> <p>I have explicitly set my coding systems to UTF-8 with the following lines:</p> <pre><code>(prefer-coding-system 'utf-8) (set-language-environment 'utf-8) (set-default-coding-systems 'utf-8) (set-terminal-coding-system 'utf-8) (set-keyboard-coding-system 'utf-8) </code></pre> <p><strong><em>Note:</strong> I realize that the functions <code>prefer-coding-system</code> and <code>set-default-coding-systems</code> already include code that sets the terminal and keyboard coding systems; however, I don't know much about coding systems and wanted to see if, for some reason, calling them explicitly would solve my problem.</em></p> <p>When I run the command, <code>describe-current-coding-system</code>, this is what I get:</p> <pre><code>Coding system for saving this buffer: U -- utf-8-dos (alias: mule-utf-8-dos) Default coding system (for new files): U -- utf-8 (alias: mule-utf-8) Coding system for keyboard input: U -- utf-8-unix (alias: mule-utf-8-unix) Coding system for terminal output: U -- utf-8 (alias: mule-utf-8) Coding system for inter-client cut and paste: U -- utf-16le-dos Defaults for subprocess I/O: decoding: U -- utf-8-dos (alias: mule-utf-8-dos) encoding: U -- utf-8-unix (alias: mule-utf-8-unix) Priority order for recognizing coding systems when reading files: 1. utf-8 (alias: mule-utf-8) 2. iso-2022-7bit 3. iso-latin-1 (alias: iso-8859-1 latin-1) 4. iso-2022-7bit-lock (alias: iso-2022-int-1) 5. iso-2022-8bit-ss2 6. emacs-mule 7. raw-text 8. iso-2022-jp (alias: junet) 9. in-is13194-devanagari (alias: devanagari) 10. chinese-iso-8bit (alias: cn-gb-2312 euc-china euc-cn cn-gb gb2312) 11. utf-8-auto 12. utf-8-with-signature 13. utf-16 14. utf-16be-with-signature (alias: utf-16-be) 15. utf-16le-with-signature (alias: utf-16-le) 16. utf-16be 17. utf-16le 18. japanese-shift-jis (alias: shift_jis sjis) 19. chinese-big5 (alias: big5 cn-big5 cp950) 20. undecided Other coding systems cannot be distinguished automatically from these, and therefore cannot be recognized automatically with the present coding system priorities. </code></pre> <p>Is there some coding system variable I'm missing?</p> <p>Is this happening because I'm on Windows?</p> <p>Can someone please shed some light on why this might be happening and a possible solution?</p> <hr> <p>EDIT (with more information that could indicate what may be happening):</p> <p>What is particularly frustrating is that when I make an irrelevant change to my config file (like setting an unrelated variable or even simply adding a comment), upon saving and reloading my config file, my UTF-8 arrows appear as they should.</p> <p>This is frustrating because, if I'm making a change in an attempt to solve the issue, when I save and reload, the problem is gone, which leads me to believe that I've solved the problem with that change. However, when I load my Emacs config on a new machine, the arrows are gone and my org-mode outlines appear as they do in the image near the top of this post.</p> <p>EDIT 2:</p> <p>After modifying and reloading my config with an arbitrary change completely unrelated to this issue and the ellipsis loading correctly, sometimes I can restart Emacs and it will still display the arrows as intended, but other times, it will revert back to displaying what is in the screenshot near the top of this post.</p> 0 changing display function in define-word package skhairy 2018-10-21T19:13:50Z 2019-04-20T05:03:30Z <p>How to replace the displayfn from <code>message</code> to a function which displays the result in a temporary window? (I have limited knowledge of elisp.)</p> 1 Error adding LaTeX class to org-latex-classes Mali Remorker 2018-09-21T08:46:17Z 2019-04-19T14:03:55Z <p>I am trying to register the jfm LaTeX class (Journal of Fluid Mechanics) with the Org LaTeX export backend. </p> <p>After looking around, I have put the following elisp snippet into my <em>.emacs</em></p> <pre><code>(with-eval-after-load 'ox-latex (add-to-list 'org-latex-classes '("jfm" "\\documentclass{jfm}" ("\\section{%s}" . "\\section*{%s}") ("\\subsection{%s}" . "\\subsection*{%s}") ("\\subsubsection{%s}" . "\\subsubsection*{%s}") ("\\paragraph{%s}" . "\\paragraph*{%s}") ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))) . </code></pre> <p>Basically, I've looked up how the article class entry looks like and just made the minimal necessary changes.</p> <p>Exporting the minimal, empty article with only title defined works and pure text works. For example,</p> <pre><code>#+TITLE: On the Uptightness of Stackoverflow Mods #+LATEX_CLASS: jfm #+LATEX_HEADER: \usepackage{graphicx} #+LATEX_HEADER: \usepackage{epstopdf, epsfig} #+LATEX_HEADER: \usepackage{float} Here is the text that does not produce any errors. </code></pre> <p>shall indeed compile without errors.</p> <p>However, as soon as I add an Org heading somewhere in the above example,</p> <p>say <code>* Introduction</code>, and try to export to LaTeX, I get the following error:</p> <p>org-export-get-all-transcoders: Wrong type argument: org-export-backend, [cl-struct-org-export-backend nil latex ((underline lambda (o c i) (format "\underline{%s}" c))) nil nil nil nil] .</p> <p>Org package summary on my emacs build:</p> <pre><code>Status: Installed in ‘org-20170821/’,shadowing a built-in package. Version: 20170821 Summary: Outline-based notes management and organizer Other versions: 9.1.14 (gnu), 9.1.9 (builtin) </code></pre> 1 org-edit-special to respect the :lines parameter of `+INCLUDE`s foki 2018-05-23T18:57:53Z 2019-04-20T01:02:00Z <p>When one invoke <code>org-edit-special</code> at the line containing an <code>#+INCLUDE</code>, it opens a new buffer with the referenced file. Although, if an <code>#+INCLUDE</code> contains the <code>:lines</code> clause it will not respect what is written in it.</p> <p>Is there a method to enforce opening file at the place referenced by the <code>:lines</code> parameter?</p> 6 How to group digits in minibuffer when sending input to calc? Name 2018-02-04T15:02:40Z 2019-04-19T16:01:40Z <p>Is it possible to send something like <code>200*100,000</code> as an input to calc?</p> <p><a href="" rel="noreferrer">Documentation</a> says <code>Long numbers can be hard to read if they have too many digits. Press d g (calc-group-digits) to enable Grouping mode, in which digits are displayed in clumps of 3 or 4 (depending on the current radix) separated by commas.</code></p> <p>When using <code>(calc-group-digits)</code> the digits are grouped in clumps of 3, for example the value of <code>200*100000</code> is shown as <code>20,000,000</code>. It would be great if it would be possible to also give the input in clumps of 3 separated by comma in the minibuffer. I tried <code>200*100,000</code> but it didn't work.</p> 3 org-element-parse-buffer usage 147pm 2018-01-24T03:33:47Z 2019-04-20T04:06:16Z <p>I've been struggling with the basic <code>org-element-parse-buffer</code> (see <a href="" rel="nofollow noreferrer">here</a>) usage. Specifically, how do I make it work? It's not interactive, so it has to be called from within an org-mode buffer, I'm guessing in a source code block. I try <a href="">this</a> solution:</p> <pre><code>#+begin_src emacs-lisp (let ((parsetree (org-element-parse-buffer 'headline))) (org-element-map parsetree 'headline (lambda (hl) (org-element-property :title hl)))) #+end_src #+RESULTS: | JANUARY | 2018-01-23T16:54:53 | 2018-01-23T19:37:21 | 2018-01-24T02:37:07 | </code></pre> <p>and get the results in a results table format. Good. But how do I get the whole buffer as an AST (one big nested list) as advertised?</p> <pre><code>#+begin_src emacs-lisp (org-element-parse-buffer) #+end_src </code></pre> <p>I get <code>org-babel-insert-result: Wrong type argument: markerp, nil</code></p> <p>I still have hope that some year I'll be productive with Emacs/org-mode....</p> 0 setup shell to default eshell wolfv 2017-11-16T00:00:15Z 2019-04-19T21:02:35Z <p>I am new to Spacemacs and eshell.</p> <p>I try to open eshell via the default shortcut key <code>SPC '</code> but it opens the bash shell:</p> <pre><code>[wolfv@localhost ~] $ message "hello" bash: message: command not found... </code></pre> <p>I was expecting the eshell.</p> <p>However, <code>SPC a s e</code> opens eshell as expected:</p> <pre><code>~ λ message "hello" hello </code></pre> <p>I followed the install instructions on <a href="" rel="nofollow noreferrer"></a></p> <p>My ~/.spacemacs file has the following lines in dotspacemacs-configuration-layers:</p> <pre><code> shell (shell :variables shell-default-height 30 shell-default-position 'bottom) </code></pre> <p>and the following lines in defun dotspacemacs/user-config ():</p> <pre><code>(setq-default dotspacemacs-configuration-layers '((shell :variables shell-default-shell 'eshell))) </code></pre> <p><strong>UPDATE</strong></p> <p>I found the problem by trouble shooting, but don't know how to fix it.</p> <p>After restarting Spacemacs, shell-default-shell help says:</p> <blockquote> <p>shell-default-shell is a variable defined in ‘config.el’. Its value is ‘ansi-term’</p> </blockquote> <p>I was expecting its value to be ‘eshell’.</p> <p>Apparently the above mentioned defun dotspacemacs/user-config () entry did not work.</p> <p>How to make shell-default-shell value be ‘eshell’?</p> 0 compilation-scroll-output doesn't work if *compilation* buffer is created by hand Louis Roché 2017-10-16T06:37:31Z 2019-04-20T03:02:10Z <p>Emacs version 25</p> <p>I have a short piece of elisp to create a few buffers and split my frame into multiple windows that are displayed the way I like. This code creates a <code>*compilation*</code> buffer and dedicates it using this code:</p> <pre><code>;; ;; Toggle window dedication (defun toggle-window-dedicated () "Toggle whether the current active window is dedicated or not" (interactive) (message (if (let (window (get-buffer-window (current-buffer))) (set-window-dedicated-p window (not (window-dedicated-p window)))) "Window '%s' is dedicated" "Window '%s' is normal") (current-buffer))) (switch-to-buffer (get-buffer-create "*compilation*")) (toggle-window-dedicated) </code></pre> <p>My issue is that when running a compilation, even if the compiler output goes to the correct buffer, the <code>*compilation*</code> buffer doesn't scroll automatically to always display the most recent text.</p> <p>My configuration is <code>(setq compilation-scroll-output 'first-error) </code></p> <p>The normal scrolling behavior seems to only be enabled when the <code>*compilation*</code> buffer is created by the <code>compile</code> command and not by hand. Even if I make the window with this buffer dedicated latter.</p> <p>Is there a correct way to create the <code>*compilation*</code> buffer without running the <code>compile</code> command but keeping the <code>compilation-scroll-output</code> configuration behavior?</p> <p>EDIT: a more detailed procedure:</p> <p>How to trigger the problem:</p> <ul> <li>put <code>mybuffer.el</code> and <code>Makefile</code> in one directory (<code>/tmp/emacs_problem</code> for example)</li> <li>open file <code>mybuffer.el</code></li> <li>go to end of the <code>create-my-buffers</code> function and execute the code (C-x C-e)</li> <li>execute the <code>create-my-buffers</code> function with <code>M-x create-my-buffers</code></li> <li>execute <code>M-x compile RET RET</code></li> </ul> <p>How to see the expected behavior:</p> <ul> <li>open file <code>mybuffer.el</code></li> <li>execute <code>M-x compile RET RET</code></li> </ul> <p>The Makefile:</p> <pre><code>default: ls -1 /bin </code></pre> <p>mybuffer.el:</p> <pre><code>(defun create-my-buffers () (interactive) (delete-other-windows) (setq total-window-size (window-width (frame-selected-window))) (setq total-window-height (window-height (frame-selected-window))) (split-window-vertically) (other-window 1) (switch-to-buffer (get-buffer-create "*compilation*")) (setq second-window-height (window-height (frame-selected-window))) (setq expected-window-height (* 0.10 total-window-height)) (setq expand-window-height (- expected-window-height second-window-height)) (enlarge-window (round expand-window-height)) (other-window 1) ) </code></pre> <p>The result with the "bad" behavior, the window with the compilation buffer has not scrolled to the bottom: <a href="" rel="nofollow noreferrer"><img src="" alt="The result with the &quot;bad&quot; behavior, the window with the compilation buffer has not scrolled to the bottom"></a></p> <p>The result with the good behavior, the cursor is at the end of the content and the window has scrolled correctly: <a href="" rel="nofollow noreferrer"><img src="" alt="The result with the good behavior, the cursor is at the end of the content and the window has scrolled correctly"></a></p> <p>The output for <code>M-x describe-mode</code> after calling <code>M-x compile</code> is:</p> <pre><code>Enabled minor modes: Auto-Composition Auto-Compression Auto-Encryption Autopair-Global Column-Number Company Company-Quickhelp Company-Quickhelp-Local Delete-Selection Display-Time Electric-Indent Evil-Matchit File-Name-Shadow Font-Lock Global-Auto-Revert Global-Company Global-Eldoc Global-Evil-Matchit Global-Font-Lock Global-Git-Gutter Global-Linum Global-Undo-Tree Global-Visual-Line Global-Whitespace Hl-Line Line-Number Mouse-Wheel Save-Place Shell-Dirtrack Show-Paren Tooltip Transient-Mark Undo-Tree Visual-Line (Information about these minor modes follows the major mode info.) Compilation mode defined in ‘compile.el’: Major mode for compilation log buffers. To visit the source for a line-numbered error, move point to the error message line and type RET. To kill the compilation, type C-c C-k. Runs ‘compilation-mode-hook’ with ‘run-mode-hooks’ (which see). </code></pre> <p>EDIT 2: It seems that the scrolling is done correctly if I launch <code>M-x compile</code> from the window containing <code>*compilation*</code> rather than from the window containing <code>mybuffer.el</code>.</p> 0 How to add matlab integration-spacemacs? Lona gracia 2017-07-24T16:23:16Z 2019-04-20T07:01:45Z <p>I already installed matlab-mode from the package list. However, not sure<br> where to add the path in ~/.spacemacs. Its a huge file, and the code structure look different from the path file: </p> <pre><code>(autoload 'matlab-mode "matlab" "Matlab Editing Mode" t) (add-to-list 'auto-mode-alist '("\\.m$" . matlab-mode)) (setq matlab-indent-function t) (setq matlab-shell-command "matlab") </code></pre> 7 Set default coding system = UTF-8 Alex 2017-07-21T08:51:19Z 2019-04-20T03:54:21Z <p>Windows 10 (64 bit), Emacs 25.1</p> <p>I want when I save any file to save them (by default) with coding system = <strong>UTF-8</strong>.</p> <p>So In my <strong>init.el</strong> I has :</p> <pre><code>(prefer-coding-system 'utf-8) (set-default-coding-systems 'utf-8) (set-language-environment 'utf-8) (set-selection-coding-system 'utf-8) </code></pre> <p>But it not help. When I try to save file (<strong>C-x C-s</strong>) Emacs prompt me: "<strong>Select coding system</strong>"</p> 6 How to show the total match count in swiper? xuhdev 2017-04-25T18:05:48Z 2019-04-20T03:45:46Z <p>When using swiper for search, it only shows the number of matching lines. How can I view the number of matches?</p> 2 TBLFM insert new row with current time Pål GD 2016-08-02T13:02:27Z 2019-04-20T08:02:40Z <p>I want to insert a new row at line 2 in a table (preferably using TBLFM), and I want it to be prefilled with the current date (col 1) and time (col 2).</p> <p>How do I insert a new row (something like <code>#+TBLFM: @2..@-1=@#-1</code>?) ?</p> <p>Here is my current table:</p> <pre><code>| date | start | end | lunch | total | expected | + time | |------------------+-------+-------+-------+----------+----------+-----------| | [2016-08-02 Tue] | 08:58 | 17:00 | 0:15 | 07:47:00 | 07:30:00 | 00:17:00 | | [2016-08-01 Mon] | 08:37 | 16:12 | 0:15 | 07:20:00 | 07:30:00 | -00:10:00 | |------------------+-------+-------+-------+----------+----------+-----------| | | | | | | | 00:07:00 | #+TBLFM: @2$5..@-1$5=$3-$2-$4;T::@2$7..@-1$7=$5-$6;T::@&gt;$7=vsum(@2$7..@-1$7);T </code></pre> 4 Terminal Emacs not receiving <wheel-up> or <wheel-down>? Zhro 2015-08-07T01:23:52Z 2019-04-19T19:04:50Z <p>From what I understand, I should be able to get mouse scrolling to work in emacs nox mode with the following:</p> <pre><code>(require 'mouse) (xterm-mouse-mode t) (mouse-wheel-mode t) (global-set-key (kbd "&lt;wheel-up&gt;") '(lambda () (interactive) (scroll-up 1))) (global-set-key (kbd "&lt;wheel-down&gt;") '(lambda () (interactive) (scroll-down 1))) </code></pre> <p>But for some reason I'm not getting the or signals. Instead I get this from <code>C-h k</code>:</p> <p>Wheel up:</p> <pre><code>mintty - ESC [ M ` X 1- xterm - ESC [ M ` ] &amp;- </code></pre> <p>Wheel down:</p> <pre><code>mintty - ESC [ M a r -- xterm - ESC [ M a J /- </code></pre> <p>If I scroll down more than once I get this:</p> <pre><code>down-mouse-66- </code></pre> <p>I'm providing examples between mintty and xterm to show that it does not appear to be limited by the terminal. It might be a Cygwin problem but I'm not sure. I AM getting escape sequences but I'm not sure how to map them. They are.. very strange.</p> <p>Normally I'd used <code>Ctrl-v</code> in bash for something like this but obviously it just scrolls the window.</p> <p>My cursor IS moving when I use the scroll wheel with these settings so it is being detected in some form but it's doing strange things I can't quite describe, like moving up several lines then jumping down again, but this may change with the context. Might there be a problem with mouse.el?</p> <p>I'm not sure what to do with this.</p>